diff options
author | Josef Bacik <josef@toxicpanda.com> | 2021-11-12 16:10:27 -0500 |
---|---|---|
committer | Eryu Guan <guaneryu@gmail.com> | 2021-11-14 20:50:15 +0800 |
commit | bf3d7aba247d9ea89d4bf50ead44f2964237ead5 (patch) | |
tree | a43ed724014c2e64d1b7a08256c1b8be552017f4 | |
parent | 090e349abcbb31dcde14618290bf0fdd8b4eca61 (diff) | |
download | xfstests-dev-bf3d7aba247d9ea89d4bf50ead44f2964237ead5.tar.gz |
fstests: check if the scratch device is an lv device for certain tests
I use lvm to carve up a large disk so I can run the btrfs raid related xfstests.
However this messes with tests that try to greate lvm devices ontop of
SCRATCH_DEV. Handle this by adding a _require_scratch_nolvm helper to skip
tests that are going to try and create lvm devices.
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
-rw-r--r-- | common/rc | 11 | ||||
-rwxr-xr-x | tests/generic/081 | 2 | ||||
-rwxr-xr-x | tests/generic/108 | 2 | ||||
-rwxr-xr-x | tests/generic/459 | 2 |
4 files changed, 14 insertions, 3 deletions
@@ -1676,6 +1676,17 @@ _require_scratch_nocheck() rm -f ${RESULT_DIR}/require_scratch } +# we need the scratch device and it needs to not be an lvm device +_require_scratch_nolvm() +{ + _require_scratch_nocheck + + # This works if we don't have LVM, all we want is to skip if the scratch + # device is an lvm device. + $LVM_PROG lvdisplay $SCRATCH_DEV > /dev/null 2>&1 + [ $? -eq 0 ] && _notrun "test requires a non-lvm scratch device" +} + # we need the scratch device and it should be checked post test. _require_scratch() { diff --git a/tests/generic/081 b/tests/generic/081 index 9f294c118c..22ac94de53 100755 --- a/tests/generic/081 +++ b/tests/generic/081 @@ -50,7 +50,7 @@ _cleanup() # real QA test starts here _supported_fs generic _require_test -_require_scratch_nocheck +_require_scratch_nolvm _require_dm_target snapshot _require_command $LVM_PROG lvm diff --git a/tests/generic/108 b/tests/generic/108 index 6e1ea5b9d2..ad43269f50 100755 --- a/tests/generic/108 +++ b/tests/generic/108 @@ -32,7 +32,7 @@ _cleanup() # real QA test starts here _supported_fs generic -_require_scratch_nocheck +_require_scratch_nolvm _require_block_device $SCRATCH_DEV _require_scsi_debug _require_command "$LVM_PROG" lvm diff --git a/tests/generic/459 b/tests/generic/459 index 5b44e2451d..cda19e6eb2 100755 --- a/tests/generic/459 +++ b/tests/generic/459 @@ -39,7 +39,7 @@ _cleanup() # This tests for filesystem lockup not consistency, so don't check for fs # consistency after test _supported_fs generic -_require_scratch_nocheck +_require_scratch_nolvm _require_dm_target thin-pool _require_dm_target snapshot _require_command $LVM_PROG lvm |