fstests: _fail test by default when _scratch_mount fails

Previously _scratch_mount didn't check the mount status and most
tests continue to run even if the mount failed (unless test checks
for the mount status explicitly). This would result in running tests
on the underlying filesystem (usually rootfs) and implicit test
failures, and such failures can be annoying and are usually hard to
debug.

Now _fail test by default if _scratch_mount failed and introduce
_try_scratch_mount for tests that need to check mount results
themselves.

Suggested-by: Andreas Gruenbacher <agruenba@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Andreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
This commit is contained in:
Eryu Guan
2018-02-07 17:31:36 +08:00
parent 729381bda4
commit 69eb6281a9
109 changed files with 184 additions and 192 deletions
+2 -2
View File
@@ -75,7 +75,7 @@ _do_die_on_error=message_only
echo -n "Make a 48 megabyte filesystem on SCRATCH_DEV and mount... "
_scratch_mkfs_xfs -dsize=48m,agcount=3 2>&1 >/dev/null || _fail "mkfs failed"
_scratch_mount || _fail "mount failed"
_scratch_mount
echo "done"
@@ -97,7 +97,7 @@ _do "xfs_bmap -vp $SCRATCH_MNT/fill"
echo "done"
# flush the filesystem - make sure there is no space "lost" to pre-allocation
_do "_scratch_unmount"
_do "_scratch_mount"
_do "_try_scratch_mount"
echo -n "Use up any further available space... "
_do "$XFS_IO_PROG -f -c \"falloc 0 1m\" $SCRATCH_MNT/pad"
echo "done"