]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tests: cleanup fallocate
authorKarel Zak <kzak@redhat.com>
Wed, 12 Mar 2014 10:02:15 +0000 (11:02 +0100)
committerKarel Zak <kzak@redhat.com>
Wed, 12 Mar 2014 10:02:15 +0000 (11:02 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
tests/ts/misc/fallocate

index 8888bf1c11b0d11cb16712ac5137770ace22f72c..e938abb3023e5f4bc5cea3076935788c495f550e 100755 (executable)
@@ -19,19 +19,20 @@ TS_DESC="fallocate"
 ts_init "$*"
 
 ts_check_test_command "$TS_CMD_FALLOCATE"
+ts_check_test_command "$TS_CMD_FINDMNT"
 
 IMAGE=${TS_OUTDIR}/${TS_TESTNAME}.file
 rm -f $IMAGE
 
-# fs type of $TS_OUTDIR, could be used to skip this test early
-fs_type=$(${TS_CMD_FINDMNT} -n -o FSTYPE -T ${TS_OUTDIR})
-
 if $TS_CMD_FALLOCATE -o 128 -l 256 $IMAGE > $TS_OUTPUT 2>&1; then
        stat -c "%s" $IMAGE >> $TS_OUTPUT 2>&1
 else
+       # fs type of $TS_OUTDIR, could be used to skip this test early
+       fs_type=$(${TS_CMD_FINDMNT} -n -o FSTYPE -T ${TS_OUTDIR})
+
        test "$(<$TS_OUTPUT)" \
             = "fallocate: fallocate failed: Operation not supported" \
-       && ts_skip "filesystem '${fs_type}' not supported"
+       && ts_skip "'${fs_type}' not supported"
 fi
 
 rm -f $IMAGE