diff options
-rw-r--r-- | tests/r_64bit_big_expand/script | 8 | ||||
-rw-r--r-- | tests/r_bigalloc_big_expand/script | 8 | ||||
-rw-r--r-- | tests/r_ext4_big_expand/script | 8 | ||||
-rwxr-xr-x | tests/scripts/resize_test | 15 |
4 files changed, 33 insertions, 6 deletions
diff --git a/tests/r_64bit_big_expand/script b/tests/r_64bit_big_expand/script index 3b34a62b..51f36e98 100644 --- a/tests/r_64bit_big_expand/script +++ b/tests/r_64bit_big_expand/script @@ -10,10 +10,14 @@ E2FSCK=../e2fsck/e2fsck . $cmd_dir/scripts/resize_test -if resize_test -then +resize_test +RC=$? +if [ $RC -eq 0 ]; then echo "$test_name: $test_description: ok" touch $test_name.ok +elif [ $RC -eq 111 ]; then + echo "$test_name: $test_description: skipped" + touch $test_name.ok else echo "$test_name: $test_description: failed" touch $test_name.failed diff --git a/tests/r_bigalloc_big_expand/script b/tests/r_bigalloc_big_expand/script index 2b9cc633..56c8c15d 100644 --- a/tests/r_bigalloc_big_expand/script +++ b/tests/r_bigalloc_big_expand/script @@ -10,10 +10,14 @@ RESIZE2FS_OPTS=-f . $cmd_dir/scripts/resize_test -if resize_test -then +resize_test +RC=$? +if [ $RC -eq 0 ]; then echo "$test_name: $test_description: ok" touch $test_name.ok +elif [ $RC -eq 111 ]; then + echo "$test_name: $test_description: skipped" + touch $test_name.ok else echo "$test_name: $test_description: failed" touch $test_name.failed diff --git a/tests/r_ext4_big_expand/script b/tests/r_ext4_big_expand/script index fb31d7a8..a4f8fe63 100644 --- a/tests/r_ext4_big_expand/script +++ b/tests/r_ext4_big_expand/script @@ -10,10 +10,14 @@ E2FSCK=../e2fsck/e2fsck . $cmd_dir/scripts/resize_test -if resize_test -then +resize_test +RC=$? +if [ $RC -eq 0 ]; then echo "$test_name: $test_description: ok" touch $test_name.ok +elif [ $RC -eq 111 ]; then + echo "$test_name: $test_description: skipped" + touch $test_name.ok else echo "$test_name: $test_description: failed" touch $test_name.failed diff --git a/tests/scripts/resize_test b/tests/scripts/resize_test index 964150ed..30532a51 100755 --- a/tests/scripts/resize_test +++ b/tests/scripts/resize_test @@ -4,6 +4,21 @@ resize_test () { rm -f $TMPFILE touch $TMPFILE + +# Verify that the $TMP filesystem handles $SIZE_2 sparse files. +# If that fails, try the local filesystem instead. +if truncate -s $SIZE_2 $TMPFILE 2> /dev/null; then + > $TMPFILE +else + rm $TMPFILE + export TMPFILE=$(TMPDIR=. mktemp -t $test_name.XXXXXX.tmp) + touch $TMPFILE + if ! truncate -s $SIZE_2 $TMPFILE 2> /dev/null; then + rm $TMPFILE + return 111 + fi +fi + echo $MKE2FS $FEATURES -qF $TMPFILE $SIZE_1 > $LOG $MKE2FS $FEATURES -qF $TMPFILE $SIZE_1 >> $LOG |