From: Theodore Ts'o Date: Wed, 26 Apr 2017 05:05:56 +0000 (-0400) Subject: tests: fix bash'isms in f_large_dir X-Git-Tag: v1.44.0-rc1~118 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b772dc5a7374b3c85cae7839270ca0178f18f30e;p=thirdparty%2Fe2fsprogs.git tests: fix bash'isms in f_large_dir Fix portability problems in the test script for f_large_dir. Also clean up messages that the script prints while it runs (and unfortunately it takes a very long time to run). Signed-off-by: Theodore Ts'o --- diff --git a/tests/f_large_dir/script b/tests/f_large_dir/script index e68576d16..0b5fdfff7 100644 --- a/tests/f_large_dir/script +++ b/tests/f_large_dir/script @@ -13,19 +13,26 @@ INDEX_L2=$(((BLOCKSZ - DIRENT_SZ) / INDEX_SZ)) ENTRIES=$((INDEX_L1 * INDEX_L2 * DIRENT_PER_LEAF)) cp /dev/null $OUT -$MKE2FS -b 1024 -O large_dir,uninit_bg,dir_nlink -F $TMPFILE 460800 > /dev/null +$MKE2FS -b 1024 -O large_dir,uninit_bg,dir_nlink -F $TMPFILE 460800 \ + > /dev/null 2>&1 { echo "feature large_dir" echo "mkdir /foo" echo "cd /foo" touch foofile echo "write foofile foofile" - for ((i = 0; i < $ENTRIES; i++)); do - [[ $(( i % DIRENT_PER_LEAF )) -eq 0 ]] && echo "expand ./" - [[ $(( i % 5000 )) -eq 0 ]] && >&2 echo "$i processed" - printf "ln foofile %0255X\n" $i + i=0 + while test $i -lt $ENTRIES ; do + if test $(( i % DIRENT_PER_LEAF )) -eq 0 ; then + echo "expand ./" + fi + if test $(( i % 5000 )) -eq 0 -a $i -gt 0 ; then + >&2 echo "$test_name: $i processed" + fi + printf "ln foofile %0255X\n" $i + i=$(($i + 1)) done -} | $DEBUGFS -w -f /dev/stdin $TMPFILE > /dev/null +} | $DEBUGFS -w -f /dev/stdin $TMPFILE > /dev/null 2>&1 $E2FSCK -yfD $TMPFILE > $OUT.new 2>&1 status=$? @@ -42,6 +49,3 @@ else echo "$test_name: $test_description: failed" diff -u $EXP $OUT > $test_name.failed fi - - -