aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosef Bacik <josef@toxicpanda.com>2021-11-12 16:10:27 -0500
committerEryu Guan <guaneryu@gmail.com>2021-11-14 20:50:15 +0800
commitbf3d7aba247d9ea89d4bf50ead44f2964237ead5 (patch)
treea43ed724014c2e64d1b7a08256c1b8be552017f4
parent090e349abcbb31dcde14618290bf0fdd8b4eca61 (diff)
downloadxfstests-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/rc11
-rwxr-xr-xtests/generic/0812
-rwxr-xr-xtests/generic/1082
-rwxr-xr-xtests/generic/4592
4 files changed, 14 insertions, 3 deletions
diff --git a/common/rc b/common/rc
index de5be4aa4b..0a30a84213 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 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