* 'master' of https://github.com/rudimeier/util-linux:
  tests, skip fallocate for unsupported filesystems
This commit is contained in:
Karel Zak 2014-03-12 10:55:47 +01:00
commit 2d12322958
1 changed files with 10 additions and 2 deletions

View File

@ -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