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>
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()
{
# 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
# 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
# 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