From: Ruediger Meier Date: Tue, 11 Mar 2014 14:53:19 +0000 (+0100) Subject: tests, skip fallocate for unsupported filesystems X-Git-Tag: v2.25-rc1~436^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fd25dcf456001557ffa02ad5f98edc8cf903df91;p=thirdparty%2Futil-linux.git tests, skip fallocate for unsupported filesystems --- diff --git a/tests/ts/misc/fallocate b/tests/ts/misc/fallocate index cbb25d8e87..8888bf1c11 100755 --- a/tests/ts/misc/fallocate +++ b/tests/ts/misc/fallocate @@ -23,8 +23,16 @@ ts_check_test_command "$TS_CMD_FALLOCATE" IMAGE=${TS_OUTDIR}/${TS_TESTNAME}.file rm -f $IMAGE -$TS_CMD_FALLOCATE -o 128 -l 256 $IMAGE > $TS_OUTPUT 2>&1 -stat -c "%s" $IMAGE > $TS_OUTPUT 2>&1 +# 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 + test "$(<$TS_OUTPUT)" \ + = "fallocate: fallocate failed: Operation not supported" \ + && ts_skip "filesystem '${fs_type}' not supported" +fi rm -f $IMAGE