mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
common: don't check scratch dev on all tests
Some tests deliberately corrupt scratch devices and so will fail the post-test check. Add a "_require_scratch_nocheck" helper function for such tests to avoid false test failure detection. Also, ensure that _notrun cleans up the trigger for the post-test checks. Otherwise the next test to run may try to validate the scratch/test devices even though they are not used by the test. Further, _check_xfs_filesystem() causes check to exit if it finds a corruption. This is extremely annoying as it terminates the entire test run rather than just reporting that the test fails. Hence add an "iam != check" test before exiting so that calls from tests will cause the test to fail, but calls from check won't cause the harness to exit. There are still some tests that fail the scratch check, these are not obvious test failures and so need further investigation to determine the cause of the failures. Signed-off-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
This commit is contained in:
committed by
Dave Chinner
parent
f7d0a30629
commit
c941f156e9
@@ -908,12 +908,15 @@ _do()
|
||||
return $ret
|
||||
}
|
||||
|
||||
# bail out, setting up .notrun file
|
||||
# bail out, setting up .notrun file. Need to kill the filesystem check files
|
||||
# here, otherwise they are set incorrectly for the next test.
|
||||
#
|
||||
_notrun()
|
||||
{
|
||||
echo "$*" > $seqres.notrun
|
||||
echo "$seq not run: $*"
|
||||
rm -f ${RESULT_DIR}/require_test
|
||||
rm -f ${RESULT_DIR}/require_scratch
|
||||
status=0
|
||||
exit
|
||||
}
|
||||
@@ -960,8 +963,9 @@ _supported_os()
|
||||
}
|
||||
|
||||
# this test needs a scratch partition - check we're ok & unmount it
|
||||
#
|
||||
_require_scratch()
|
||||
# No post-test check of the device is required. e.g. the test intentionally
|
||||
# finishes the test with the filesystem in a corrupt state
|
||||
_require_scratch_nocheck()
|
||||
{
|
||||
case "$FSTYP" in
|
||||
nfs*)
|
||||
@@ -1005,9 +1009,17 @@ _require_scratch()
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
touch ${RESULT_DIR}/require_scratch
|
||||
rm -f ${RESULT_DIR}/require_scratch
|
||||
}
|
||||
|
||||
# we need the scratch device and it should be checked post test.
|
||||
_require_scratch()
|
||||
{
|
||||
_require_scratch_nocheck
|
||||
touch ${RESULT_DIR}/require_scratch
|
||||
}
|
||||
|
||||
|
||||
# this test needs a test partition - check we're ok & unmount it
|
||||
#
|
||||
_require_test()
|
||||
@@ -1681,7 +1693,9 @@ _check_xfs_filesystem()
|
||||
|
||||
if [ $ok -eq 0 ]; then
|
||||
status=1
|
||||
exit 1
|
||||
if [ "$iam" != "check" ]; then
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
return 0
|
||||
|
||||
+1
-1
@@ -54,7 +54,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
|
||||
_supported_fs generic
|
||||
_supported_os Linux
|
||||
_need_to_be_root
|
||||
_require_scratch
|
||||
_require_scratch_nocheck
|
||||
_require_dm_flakey
|
||||
|
||||
# xfs_io is not required for this test, but it's the best way to verify
|
||||
|
||||
+1
-1
@@ -43,7 +43,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
|
||||
_supported_fs generic
|
||||
_supported_os Linux
|
||||
_need_to_be_root
|
||||
_require_scratch
|
||||
_require_scratch_nocheck
|
||||
_require_dm_flakey
|
||||
|
||||
rm -f $seqres.full
|
||||
|
||||
+1
-1
@@ -43,7 +43,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
|
||||
_supported_fs generic
|
||||
_supported_os Linux
|
||||
_need_to_be_root
|
||||
_require_scratch
|
||||
_require_scratch_nocheck
|
||||
_require_dm_flakey
|
||||
|
||||
rm -f $seqres.full
|
||||
|
||||
+1
-1
@@ -63,7 +63,7 @@ _do_bit_test()
|
||||
# Modify as appropriate.
|
||||
_supported_fs xfs
|
||||
_supported_os Linux
|
||||
_require_scratch
|
||||
_require_scratch_nocheck
|
||||
_require_xfs_mkfs_crc
|
||||
|
||||
_scratch_mkfs -m crc=0 >/dev/null 2>&1
|
||||
|
||||
+1
-1
@@ -50,8 +50,8 @@ _cleanup()
|
||||
# Modify as appropriate.
|
||||
_supported_fs xfs
|
||||
_supported_os Linux
|
||||
_require_scratch_nocheck
|
||||
|
||||
_require_scratch
|
||||
# So we can explicitly turn it _off_:
|
||||
_require_xfs_mkfs_crc
|
||||
|
||||
|
||||
+1
-1
@@ -53,7 +53,7 @@ filter_mount()
|
||||
_supported_fs xfs
|
||||
_supported_os Linux
|
||||
|
||||
_require_scratch
|
||||
_require_scratch_nocheck
|
||||
_require_xfs_mkfs_crc
|
||||
|
||||
rm -f $seqres.full
|
||||
|
||||
+1
-1
@@ -45,7 +45,7 @@ _supported_fs xfs
|
||||
_supported_os Linux
|
||||
|
||||
_require_test
|
||||
_require_scratch
|
||||
_require_scratch_nocheck
|
||||
|
||||
echo "*** get uuid"
|
||||
uuid=`_get_existing_uuid`
|
||||
|
||||
+1
-2
@@ -60,7 +60,7 @@ _log()
|
||||
}
|
||||
|
||||
_require_nonexternal
|
||||
_require_scratch
|
||||
_require_scratch_nocheck
|
||||
_require_no_large_scratch_dev
|
||||
_require_loop
|
||||
_require_ext2
|
||||
@@ -133,7 +133,6 @@ umount -d $SCRATCH_MNT/test >> $seqres.full 2>&1 \
|
||||
echo "--- mounts at end (before cleanup)" >> $seqres.full
|
||||
mount >> $seqres.full
|
||||
|
||||
rm -f $seqres.full
|
||||
# success, all done
|
||||
status=0
|
||||
exit
|
||||
|
||||
+3
-1
@@ -38,7 +38,9 @@ status=1 # failure is the default!
|
||||
_supported_fs xfs
|
||||
_supported_os Linux
|
||||
|
||||
_require_scratch
|
||||
# single AG will cause default xfs_repair to fail. This test is actually
|
||||
# testing the special corner case option needed to repair a single AG fs.
|
||||
_require_scratch_nocheck
|
||||
|
||||
#
|
||||
# The AG size is limited to 1TB (or even less with historic xfsprogs),
|
||||
|
||||
+2
-1
@@ -37,7 +37,8 @@ status=1 # failure is the default!
|
||||
_supported_fs xfs
|
||||
_supported_os Linux
|
||||
|
||||
_require_scratch
|
||||
# single AG will cause xfs_repair to fail checks.
|
||||
_require_scratch_nocheck
|
||||
|
||||
rm -f $seqres.full
|
||||
|
||||
|
||||
Reference in New Issue
Block a user