master - lvconvert: improve validation thin and cache pool conversion
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=7612c21f5511c58bac8...
Commit: 7612c21f5511c58bac81fc46e304bd9f4cd2cd75
Parent: 13fb57bbb1deca9ea14e58a3a4edf284d3f4846c
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Sep 6 18:09:40 2019 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Sep 17 13:13:49 2019 +0200
lvconvert: improve validation thin and cache pool conversion
Limit convertible LVs to thin-pool and cache-pools.
Also fix return code on interal error path to return ECMD_FAILED.
---
WHATS_NEW | 1 +
tools/lvconvert.c | 52 +++++++++++++++++++++++++++++++++++++++++++++++-----
2 files changed, 48 insertions(+), 5 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index cb93bbe..518b944 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.03.06 -
================================
+ Enhance validation for thin and cache pool conversion and swapping.
Improve internal removal of cached devices.
Synchronize with udev when dropping snapshot.
Add missing device synchronization point before removing pvmove node.
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index 31f9296..d64ab22 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -4455,24 +4455,66 @@ static int _lvconvert_to_pool_or_swap_metadata_single(struct cmd_context *cmd,
struct dm_list *use_pvh = NULL;
int to_thinpool = 0;
int to_cachepool = 0;
+ int lvt_enum = get_lvt_enum(lv);
+ struct lv_type *lvtype;
switch (cmd->command->command_enum) {
case lvconvert_to_thinpool_or_swap_metadata_CMD:
+ if (lv_is_cache(lv))
+ /* For cached LV check the cache origin LV type */
+ lvt_enum = get_lvt_enum(seg_lv(first_seg(lv), 0));
to_thinpool = 1;
break;
case lvconvert_to_cachepool_or_swap_metadata_CMD:
+ if (lv_is_cache(lv))
+ goto_bad; /* Cache over cache is not supported */
to_cachepool = 1;
break;
default:
- log_error(INTERNAL_ERROR "Invalid lvconvert pool command");
- return 0;
- };
+ log_error(INTERNAL_ERROR "Invalid lvconvert pool command.");
+ return ECMD_FAILED;
+ }
+
+ switch (lvt_enum) {
+ case thinpool_LVT:
+ if (!to_thinpool)
+ goto_bad; /* can't accept cache-pool */
+ break; /* swap thin-pool */
+ case cachepool_LVT:
+ if (!to_cachepool)
+ goto_bad; /* can't accept thin-pool */
+ break; /* swap cache-pool */
+ case linear_LVT:
+ case raid_LVT:
+ case striped_LVT:
+ case zero_LVT:
+ break;
+ default:
+bad:
+ lvtype = get_lv_type(lvt_enum);
+ log_error("LV %s with type %s cannot be used as a %s pool LV.",
+ display_lvname(lv), lvtype ? lvtype->name : "unknown",
+ to_thinpool ? "thin" : "cache");
+ return ECMD_FAILED;
+ }
if (lv_is_origin(lv)) {
log_error("Cannot convert logical volume %s under snapshot.",
display_lvname(lv));
- return 0;
- };
+ return ECMD_FAILED;
+ }
+
+ if (!lv_is_visible(lv)) {
+ log_error("Can't convert internal LV %s.",
+ display_lvname(lv));
+ return ECMD_FAILED;
+ }
+
+ if (lv_is_locked(lv)) {
+ log_error("Can't convert locked LV %s.",
+ display_lvname(lv));
+ return ECMD_FAILED;
+ }
if (cmd->position_argc > 1) {
/* First pos arg is required LV, remaining are optional PVs. */
4 years, 7 months
stable-2.02 - tests: pool conversion
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=2694f93bb4b670d5afc...
Commit: 2694f93bb4b670d5afc51ff656f51e1e2945664a
Parent: e147786bac52fea240955329963c9eed0eebfb18
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Sep 17 11:27:13 2019 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Sep 17 11:33:55 2019 +0200
tests: pool conversion
Test conversion of cached LV.
---
test/shell/lvconvert-cache-thin.sh | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/test/shell/lvconvert-cache-thin.sh b/test/shell/lvconvert-cache-thin.sh
index e1d38b8..7dda6e6 100644
--- a/test/shell/lvconvert-cache-thin.sh
+++ b/test/shell/lvconvert-cache-thin.sh
@@ -51,4 +51,20 @@ check lv_field $vg/$lv1 segtype "thin"
lvconvert --uncache $vg/tpool
lvs -a $vg
+lvremove -f $vg
+
+# Check conversion of cached LV works as thin-pool
+lvcreate -L10 -n $lv $vg
+lvcreate -L10 -n $lv1 $vg
+lvcreate -H -L10 $vg/$lv
+
+# Stack of cache over cache is unsupported ATM
+fail lvconvert --yes --cachepool $vg/$lv
+
+# Thin-pool cannot use cached metaddata LV (meta should be on FAST device)
+fail lvconvert --yes --thinpool $vg/$lv1 --poolmetadata $vg/$lv
+
+# Thin-pool CAN use cached data LV
+lvconvert --yes --thinpool $vg/$lv
+
vgremove -f $vg
4 years, 7 months
stable-2.02 - lvconvert: improve validation thin and cache pool conversion
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=e147786bac52fea2409...
Commit: e147786bac52fea240955329963c9eed0eebfb18
Parent: 1c07c5482916d493caf951cac5b5b22af0620724
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Sep 6 18:09:40 2019 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Sep 17 11:33:53 2019 +0200
lvconvert: improve validation thin and cache pool conversion
Limit convertible LVs to thin-pool and cache-pools.
Also fix return code on interal error path to return ECMD_FAILED.
---
WHATS_NEW | 1 +
tools/lvconvert.c | 52 +++++++++++++++++++++++++++++++++++++++++++++++-----
2 files changed, 48 insertions(+), 5 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index afdf523..8a597ba 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.187 -
===================================
+ Enhance validation for thin and cache pool conversion and swapping.
Version 2.02.186 - 27th August 2019
===================================
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index 8a07a84..31ca5a1 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -4304,24 +4304,66 @@ static int _lvconvert_to_pool_or_swap_metadata_single(struct cmd_context *cmd,
struct dm_list *use_pvh = NULL;
int to_thinpool = 0;
int to_cachepool = 0;
+ int lvt_enum = get_lvt_enum(lv);
+ struct lv_type *lvtype;
switch (cmd->command->command_enum) {
case lvconvert_to_thinpool_or_swap_metadata_CMD:
+ if (lv_is_cache(lv))
+ /* For cached LV check the cache origin LV type */
+ lvt_enum = get_lvt_enum(seg_lv(first_seg(lv), 0));
to_thinpool = 1;
break;
case lvconvert_to_cachepool_or_swap_metadata_CMD:
+ if (lv_is_cache(lv))
+ goto_bad; /* Cache over cache is not supported */
to_cachepool = 1;
break;
default:
- log_error(INTERNAL_ERROR "Invalid lvconvert pool command");
- return 0;
- };
+ log_error(INTERNAL_ERROR "Invalid lvconvert pool command.");
+ return ECMD_FAILED;
+ }
+
+ switch (lvt_enum) {
+ case thinpool_LVT:
+ if (!to_thinpool)
+ goto_bad; /* can't accept cache-pool */
+ break; /* swap thin-pool */
+ case cachepool_LVT:
+ if (!to_cachepool)
+ goto_bad; /* can't accept thin-pool */
+ break; /* swap cache-pool */
+ case linear_LVT:
+ case raid_LVT:
+ case striped_LVT:
+ case zero_LVT:
+ break;
+ default:
+bad:
+ lvtype = get_lv_type(lvt_enum);
+ log_error("LV %s with type %s cannot be used as a %s pool LV.",
+ display_lvname(lv), lvtype ? lvtype->name : "unknown",
+ to_thinpool ? "thin" : "cache");
+ return ECMD_FAILED;
+ }
if (lv_is_origin(lv)) {
log_error("Cannot convert logical volume %s under snapshot.",
display_lvname(lv));
- return 0;
- };
+ return ECMD_FAILED;
+ }
+
+ if (!lv_is_visible(lv)) {
+ log_error("Can't convert internal LV %s.",
+ display_lvname(lv));
+ return ECMD_FAILED;
+ }
+
+ if (lv_is_locked(lv)) {
+ log_error("Can't convert locked LV %s.",
+ display_lvname(lv));
+ return ECMD_FAILED;
+ }
if (cmd->position_argc > 1) {
/* First pos arg is required LV, remaining are optional PVs. */
4 years, 7 months
master - Revert "tests: drop unnecessary pid from LVMTEST prefix"
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=13fb57bbb1deca9ea14...
Commit: 13fb57bbb1deca9ea14e58a3a4edf284d3f4846c
Parent: 6e1cf248d4a9520b6e342dc583f1e4f7d4c5f8fa
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Mon Sep 16 13:01:50 2019 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Mon Sep 16 13:01:50 2019 -0500
Revert "tests: drop unnecessary pid from LVMTEST prefix"
This reverts commit 51c105702f24d64f1adc25a692ef37e20878cec5.
it seems the test system still needs this for some reason
---
test/lib/inittest.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/test/lib/inittest.sh b/test/lib/inittest.sh
index 4914b29..a6cefa8 100644
--- a/test/lib/inittest.sh
+++ b/test/lib/inittest.sh
@@ -68,7 +68,7 @@ export LVM_TEST_LVMPOLLD LVM_TEST_LOCK_TYPE_DLM LVM_TEST_LOCK_TYPE_SANLOCK
TESTOLDPWD=$(pwd)
COMMON_PREFIX="LVMTEST"
-PREFIX="${COMMON_PREFIX}"
+PREFIX="${COMMON_PREFIX}$$"
# Check we are not conflickting with some exiting setup
if test -z "$SKIP_ROOT_DM_CHECK" ; then
4 years, 7 months
master - Revert "lvmlockd: use commonly used define NOTIFYDBUS_SUPPORT"
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=6e1cf248d4a9520b6e3...
Commit: 6e1cf248d4a9520b6e342dc583f1e4f7d4c5f8fa
Parent: 51c105702f24d64f1adc25a692ef37e20878cec5
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Mon Sep 16 11:42:23 2019 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Mon Sep 16 11:44:42 2019 -0500
Revert "lvmlockd: use commonly used define NOTIFYDBUS_SUPPORT"
This reverts commit 71af650760c2b75b3c267277f47d8ba235421300.
It disabled sd_notify() which broke 'systemctl start lvmlockd'.
---
daemons/lvmlockd/Makefile.in | 21 ++++++++++++++-------
daemons/lvmlockd/lvmlockd-core.c | 2 +-
2 files changed, 15 insertions(+), 8 deletions(-)
diff --git a/daemons/lvmlockd/Makefile.in b/daemons/lvmlockd/Makefile.in
index dca05b8..9c03401 100644
--- a/daemons/lvmlockd/Makefile.in
+++ b/daemons/lvmlockd/Makefile.in
@@ -38,18 +38,25 @@ TARGETS = lvmlockd lvmlockctl
include $(top_builddir)/make.tmpl
-CFLAGS += $(EXTRA_EXEC_CFLAGS) $(SYSTEMD_CFLAGS)
+CFLAGS += $(EXTRA_EXEC_CFLAGS)
INCLUDES += -I$(top_srcdir)/libdaemon/server
-LDFLAGS += $(EXTRA_EXEC_LDFLAGS) $(ELDFLAGS)
-LIBS += $(PTHREAD_LIBS) $(SYSTEMD_LIBS)
+LDFLAGS += -L$(top_builddir)/libdaemon/server $(EXTRA_EXEC_LDFLAGS) $(ELDFLAGS)
+LIBS += $(RT_LIBS) $(DAEMON_LIBS) $(PTHREAD_LIBS)
-lvmlockd: $(OBJECTS) $(top_builddir)/libdaemon/server/libdaemonserver.a $(INTERNAL_LIBS)
+
+ifeq ($(USE_SD_NOTIFY),yes)
+ CFLAGS += $(shell pkg-config --cflags libsystemd) -DUSE_SD_NOTIFY
+ LIBS += $(shell pkg-config --libs libsystemd)
+endif
+
+lvmlockd: $(OBJECTS) $(top_builddir)/libdaemon/client/libdaemonclient.a \
+ $(top_builddir)/libdaemon/server/libdaemonserver.a
@echo " [CC] $@"
- $(Q) $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $+ $(LOCK_LIBS) $(LIBS)
+ $(Q) $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJECTS) $(LOCK_LIBS) -ldaemonserver $(INTERNAL_LIBS) $(LIBS)
-lvmlockctl: lvmlockctl.o $(INTERNAL_LIBS)
+lvmlockctl: lvmlockctl.o $(top_builddir)/libdaemon/client/libdaemonclient.a
@echo " [CC] $@"
- $(Q) $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $+ $(LIBS)
+ $(Q) $(CC) $(CFLAGS) $(LDFLAGS) -o $@ lvmlockctl.o $(INTERNAL_LIBS) $(LIBS)
install_lvmlockd: lvmlockd
@echo " [INSTALL] $<"
diff --git a/daemons/lvmlockd/lvmlockd-core.c b/daemons/lvmlockd/lvmlockd-core.c
index 5609ccc..39275fb 100644
--- a/daemons/lvmlockd/lvmlockd-core.c
+++ b/daemons/lvmlockd/lvmlockd-core.c
@@ -31,7 +31,7 @@
#include <sys/utsname.h>
#include <sys/un.h>
-#ifdef NOTIFYDBUS_SUPPORT
+#ifdef USE_SD_NOTIFY
#include <systemd/sd-daemon.h>
#endif
4 years, 7 months
master - tests: drop unnecessary pid from LVMTEST prefix
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=51c105702f24d64f1ad...
Commit: 51c105702f24d64f1adc25a692ef37e20878cec5
Parent: df36a8eadfbbfe547cc734259dfc598cb773b59c
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Thu Sep 12 14:52:13 2019 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Thu Sep 12 14:52:13 2019 -0500
tests: drop unnecessary pid from LVMTEST prefix
---
test/lib/inittest.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/test/lib/inittest.sh b/test/lib/inittest.sh
index a6cefa8..4914b29 100644
--- a/test/lib/inittest.sh
+++ b/test/lib/inittest.sh
@@ -68,7 +68,7 @@ export LVM_TEST_LVMPOLLD LVM_TEST_LOCK_TYPE_DLM LVM_TEST_LOCK_TYPE_SANLOCK
TESTOLDPWD=$(pwd)
COMMON_PREFIX="LVMTEST"
-PREFIX="${COMMON_PREFIX}$$"
+PREFIX="${COMMON_PREFIX}"
# Check we are not conflickting with some exiting setup
if test -z "$SKIP_ROOT_DM_CHECK" ; then
4 years, 7 months
master - tests: don't change real test output
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=df36a8eadfbbfe547cc...
Commit: df36a8eadfbbfe547cc734259dfc598cb773b59c
Parent: 196a9ed59fa65666a1efa26440166ace6206e545
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Thu Sep 12 14:45:13 2019 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Thu Sep 12 14:45:13 2019 -0500
tests: don't change real test output
---
test/lib/brick-shelltest.h | 14 --------------
1 files changed, 0 insertions(+), 14 deletions(-)
diff --git a/test/lib/brick-shelltest.h b/test/lib/brick-shelltest.h
index 56429c7..b58f3d6 100644
--- a/test/lib/brick-shelltest.h
+++ b/test/lib/brick-shelltest.h
@@ -376,20 +376,6 @@ struct Substitute {
std::string prefix;
std::string map( std::string line ) {
- if ( std::string( line, 0, 9 ) == "@TESTDIR=" )
- testdir = std::string( line, 9, line.length() - 10 ); // skip \n
- else if ( std::string( line, 0, 8 ) == "@PREFIX=" )
- prefix = std::string( line, 8, line.length() - 9 ); // skip \n
- else {
- size_t off;
- if (!testdir.empty())
- while ( (off = line.find( testdir )) != std::string::npos )
- line.replace( off, testdir.length(), "@TESTDIR@" );
-
- if (!prefix.empty())
- while ( (off = line.find( prefix )) != std::string::npos )
- line.replace( off, prefix.length(), "@PREFIX@" );
- }
return line;
}
};
4 years, 7 months
master - tests: metadata-zero-space more debugging
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=196a9ed59fa65666a1e...
Commit: 196a9ed59fa65666a1efa26440166ace6206e545
Parent: 39a0de68bdbd26bf64e2cc92731c9095c5d36e17
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Thu Sep 12 14:38:20 2019 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Thu Sep 12 14:38:20 2019 -0500
tests: metadata-zero-space more debugging
---
test/shell/metadata-zero-space.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/test/shell/metadata-zero-space.sh b/test/shell/metadata-zero-space.sh
index ec7b65c..1bd1eef 100644
--- a/test/shell/metadata-zero-space.sh
+++ b/test/shell/metadata-zero-space.sh
@@ -38,7 +38,7 @@ xxd meta.raw > meta.txt
# to help debug if the next grep fails
ls -l meta.txt
head -n 100 meta.txt
-grep -A4 -B4 00001200 meta.txt
+grep -A4 -B4 1200 meta.txt
grep -B1 "$vg {" meta.txt > meta.vg
4 years, 7 months
master - tests: unnecessary braces causes test failures
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=39a0de68bdbd26bf64e...
Commit: 39a0de68bdbd26bf64e2cc92731c9095c5d36e17
Parent: 585db872749a08dd42139cbf4234cbcd50a19683
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Thu Sep 12 12:55:00 2019 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Thu Sep 12 12:55:00 2019 -0500
tests: unnecessary braces causes test failures
---
test/lib/aux.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/test/lib/aux.sh b/test/lib/aux.sh
index b7207eb..9c9e1fd 100644
--- a/test/lib/aux.sh
+++ b/test/lib/aux.sh
@@ -1190,7 +1190,7 @@ devices/dir = "$DM_DEV_DIR"
devices/filter = "a|.*|"
devices/global_filter = [ "a|$DM_DEV_DIR/mapper/${PREFIX}.*pv[0-9_]*$|", "r|.*|" ]
devices/md_component_detection = 0
-devices/scan = [ "$DM_DEV_DIR" ]
+devices/scan = "$DM_DEV_DIR"
devices/sysfs_scan = 1
devices/write_cache_state = 0
global/abort_on_internal_errors = 1
4 years, 7 months
master - tests: skip some without wipefs
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=585db872749a08dd421...
Commit: 585db872749a08dd42139cbf4234cbcd50a19683
Parent: 82b887a4cfa12f32781cc0dc89c51d89658179a1
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Thu Sep 12 11:23:30 2019 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Thu Sep 12 11:23:30 2019 -0500
tests: skip some without wipefs
---
test/shell/allow-mixed-block-sizes.sh | 1 +
test/shell/duplicate-pvs-md0.sh | 2 ++
test/shell/duplicate-pvs-md1.sh | 2 ++
test/shell/lvm-on-md.sh | 2 ++
test/shell/pvcreate-operation-md.sh | 2 ++
5 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/test/shell/allow-mixed-block-sizes.sh b/test/shell/allow-mixed-block-sizes.sh
index 2f0b3a0..ec60bc6 100644
--- a/test/shell/allow-mixed-block-sizes.sh
+++ b/test/shell/allow-mixed-block-sizes.sh
@@ -15,6 +15,7 @@ SKIP_WITH_LVMPOLLD=1
. lib/inittest
losetup -h | grep sector-size || skip
+wipefs -V || skip
dd if=/dev/zero of=loopa bs=$((1024*1024)) count=2 2> /dev/null
dd if=/dev/zero of=loopb bs=$((1024*1024)) count=2 2> /dev/null
diff --git a/test/shell/duplicate-pvs-md0.sh b/test/shell/duplicate-pvs-md0.sh
index 4c7863d..d64da4a 100644
--- a/test/shell/duplicate-pvs-md0.sh
+++ b/test/shell/duplicate-pvs-md0.sh
@@ -28,6 +28,8 @@ _clear_online_files() {
. lib/inittest
+wipefs -V || skip
+
test -f /proc/mdstat && grep -q raid0 /proc/mdstat || \
modprobe raid0 || skip
not grep md0 /proc/mdstat
diff --git a/test/shell/duplicate-pvs-md1.sh b/test/shell/duplicate-pvs-md1.sh
index d242e03..d186c0f 100644
--- a/test/shell/duplicate-pvs-md1.sh
+++ b/test/shell/duplicate-pvs-md1.sh
@@ -33,6 +33,8 @@ _clear_online_files() {
. lib/inittest
+wipefs -V || skip
+
test -f /proc/mdstat && grep -q raid1 /proc/mdstat || \
modprobe raid1 || skip
not grep md0 /proc/mdstat
diff --git a/test/shell/lvm-on-md.sh b/test/shell/lvm-on-md.sh
index 6862101..7bcc276 100644
--- a/test/shell/lvm-on-md.sh
+++ b/test/shell/lvm-on-md.sh
@@ -28,6 +28,8 @@ _clear_online_files() {
. lib/inittest
+wipefs -V || skip
+
test -f /proc/mdstat && grep -q raid1 /proc/mdstat || \
modprobe raid1 || skip
not grep md0 /proc/mdstat
diff --git a/test/shell/pvcreate-operation-md.sh b/test/shell/pvcreate-operation-md.sh
index 12cf891..1774d23 100644
--- a/test/shell/pvcreate-operation-md.sh
+++ b/test/shell/pvcreate-operation-md.sh
@@ -18,6 +18,8 @@ SKIP_WITH_LVMPOLLD=1
# skip this test if mdadm or sfdisk (or others) aren't available
which sfdisk || skip
+wipefs -V || skip
+
test -f /proc/mdstat && grep -q raid0 /proc/mdstat || \
modprobe raid0 || skip
not grep md0 /proc/mdstat
4 years, 7 months