fstests: check if the scratch device is an lv device for certain tests
[xfstests-dev.git] / common / rc
index de5be4aa4bd278fe0b7d5d27b8b5b4a2d7896f36..0a30a8421328043da671e00384e46c86ccece5c1 100644 (file)
--- 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()
 {