From: Josef Bacik Date: Fri, 12 Nov 2021 21:10:27 +0000 (-0500) Subject: fstests: check if the scratch device is an lv device for certain tests X-Git-Tag: v2022.05.01~177 X-Git-Url: http://git.apps.os.sepia.ceph.com/?p=xfstests-dev.git;a=commitdiff_plain;h=bf3d7aba247d9ea89d4bf50ead44f2964237ead5 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 Reviewed-by: Eryu Guan Signed-off-by: Eryu Guan --- diff --git a/common/rc b/common/rc index de5be4aa..0a30a842 100644 --- a/common/rc +++ b/common/rc @@ -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 9f294c11..22ac94de 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 6e1ea5b9..ad43269f 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 5b44e245..cda19e6e 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