summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2021-06-30 11:56:42 -0500
committerDavid Teigland <teigland@redhat.com>2021-06-30 11:56:42 -0500
commita47e20a0929bc0d399851c398e7e3d06e97daf65 (patch)
treebc2e829d257343b2d38df2905fbed3d936863461
parent39f497b9d8d35c77716014a3ba7074a2fc8955ac (diff)
downloadlvm2-a47e20a0929bc0d399851c398e7e3d06e97daf65.tar.gz
tests: skip tests that require blkid BLOCK_SIZE
Recent commit 84bd394cf9aaa581b4bf980f764544dda26a0305 "writecache: use block size 4096 when no fs is found" changed the default writecache block size from 512 to 4096 when no file system is detected. The fs block size detection requires the libblkid BLOCK_SIZE feature, so skip tests on systems without this. Otherwise, 4096 writecache added to 512 xfs leads fs io or mount failures.
-rw-r--r--test/shell/lvextend-caches-on-thindata.sh8
-rw-r--r--test/shell/writecache-cache-blocksize-2.sh8
-rw-r--r--test/shell/writecache.sh8
3 files changed, 24 insertions, 0 deletions
diff --git a/test/shell/lvextend-caches-on-thindata.sh b/test/shell/lvextend-caches-on-thindata.sh
index aab571611..ef47d76d0 100644
--- a/test/shell/lvextend-caches-on-thindata.sh
+++ b/test/shell/lvextend-caches-on-thindata.sh
@@ -118,6 +118,14 @@ mkdir -p "$mount_dir"
aux prepare_devs 6 70 # want 64M of usable space from each dev
+# Tests with fs block sizes require a libblkid version that shows BLOCK_SIZE
+vgcreate $vg "$dev1"
+lvcreate -n $lv1 -L50 $vg
+mkfs.xfs -f "$DM_DEV_DIR/$vg/$lv1"
+blkid -c /dev/null "$DM_DEV_DIR/$vg/$lv1" | grep BLOCK_SIZE || skip
+lvchange -an $vg
+vgremove -ff $vg
+
# generate random data
dd if=/dev/urandom of=pattern bs=512K count=1
diff --git a/test/shell/writecache-cache-blocksize-2.sh b/test/shell/writecache-cache-blocksize-2.sh
index af4f60e1d..dfb4f19a1 100644
--- a/test/shell/writecache-cache-blocksize-2.sh
+++ b/test/shell/writecache-cache-blocksize-2.sh
@@ -159,6 +159,14 @@ _run_test() {
aux prepare_scsi_debug_dev 256 sector_size=512 physblk_exp=3
aux prepare_devs 2 64
+# Tests with fs block sizes require a libblkid version that shows BLOCK_SIZE
+vgcreate $vg "$dev1"
+lvcreate -n $lv1 -L50 $vg
+mkfs.xfs -f "$DM_DEV_DIR/$vg/$lv1"
+blkid -c /dev/null "$DM_DEV_DIR/$vg/$lv1" | grep BLOCK_SIZE || skip
+lvchange -an $vg
+vgremove -ff $vg
+
# loopa/loopb have LBS 512 PBS 512
which fallocate || skip
fallocate -l 64M loopa
diff --git a/test/shell/writecache.sh b/test/shell/writecache.sh
index e549b113c..421c5bb4f 100644
--- a/test/shell/writecache.sh
+++ b/test/shell/writecache.sh
@@ -25,6 +25,14 @@ check sysfs "$(< SCSI_DEBUG_DEV)" queue/logical_block_size "512"
check sysfs "$(< SCSI_DEBUG_DEV)" queue/physical_block_size "512"
aux prepare_devs 2 64
+# Tests with fs block sizes require a libblkid version that shows BLOCK_SIZE
+vgcreate $vg "$dev1"
+lvcreate -n $lv1 -L50 $vg
+mkfs.xfs -f "$DM_DEV_DIR/$vg/$lv1"
+blkid -c /dev/null "$DM_DEV_DIR/$vg/$lv1" | grep BLOCK_SIZE || skip
+lvchange -an $vg
+vgremove -ff $vg
+
# scsi_debug devices with 512 LBS and 4K PBS
#aux prepare_scsi_debug_dev 256 sector_size=512 physblk_exp=3
#check sysfs "$(< SCSI_DEBUG_DEV)" queue/logical_block_size "512"