summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarian Csontos <mcsontos@redhat.com>2019-11-26 09:11:05 +0100
committerMarian Csontos <mcsontos@redhat.com>2019-11-26 09:13:17 +0100
commitb6902585187e9a7e29fb57d8415743db1bf80dab (patch)
tree0e150f97bb1c46382fe88ed3abb970a3ba4c1c15
parent4757ce4c2a4d67ca7170fd25a5dc6e160fb7a788 (diff)
downloadlvm2-dev-mcsontos-md-stop-scan.tar.gz
tests: Find md name using lsblkdev-mcsontos-md-stop-scan
After stopping MD device and rescanning the leg, it is created with different name.
-rw-r--r--test/shell/duplicate-pvs-md0.sh6
-rw-r--r--test/shell/duplicate-pvs-md1.sh9
2 files changed, 5 insertions, 10 deletions
diff --git a/test/shell/duplicate-pvs-md0.sh b/test/shell/duplicate-pvs-md0.sh
index 036f5707c..6ff9ba245 100644
--- a/test/shell/duplicate-pvs-md0.sh
+++ b/test/shell/duplicate-pvs-md0.sh
@@ -368,8 +368,7 @@ aux enable_dev "$dev2"
aux aux udev_wait
cat /proc/mdstat
# for some reason enabling dev2 starts an odd md dev
-mdadm --stop "$mddev" || true
-mdadm --stop --scan
+mdadm --stop $(lsblk -al -o NAME --noheadings "$dev2" | grep '^md') || true
cat /proc/mdstat
aux wipefs_a "$dev1" || true
aux wipefs_a "$dev2" || true
@@ -434,8 +433,7 @@ aux enable_dev "$dev2"
aux aux udev_wait
cat /proc/mdstat
# for some reason enabling dev2 starts an odd md dev
-mdadm --stop "$mddev" || true
-mdadm --stop --scan
+mdadm --stop $(lsblk -al -o NAME --noheadings "$dev2" | grep '^md') || true
cat /proc/mdstat
aux wipefs_a "$dev1" || true
aux wipefs_a "$dev2" || true
diff --git a/test/shell/duplicate-pvs-md1.sh b/test/shell/duplicate-pvs-md1.sh
index 64d9b98ef..0e1b83cca 100644
--- a/test/shell/duplicate-pvs-md1.sh
+++ b/test/shell/duplicate-pvs-md1.sh
@@ -415,8 +415,7 @@ aux enable_dev "$dev2"
aux udev_wait
cat /proc/mdstat
# for some reason enabling dev2 starts an odd md dev
-mdadm --stop "$mddev" || true
-mdadm --stop --scan
+mdadm --stop $(lsblk -al -o NAME --noheadings "$dev2" | grep '^md') || true
cat /proc/mdstat
aux wipefs_a "$dev1" || true
aux wipefs_a "$dev2" || true
@@ -480,8 +479,7 @@ aux enable_dev "$dev2"
aux udev_wait
cat /proc/mdstat
# for some reason enabling dev2 starts an odd md dev
-mdadm --stop "$mddev" || true
-mdadm --stop --scan
+mdadm --stop $(lsblk -al -o NAME --noheadings "$dev2" | grep '^md') || true
cat /proc/mdstat
aux wipefs_a "$dev1" || true
aux wipefs_a "$dev2" || true
@@ -619,8 +617,7 @@ aux enable_dev "$dev4"
aux udev_wait
cat /proc/mdstat
# for some reason enabling dev2 starts an odd md dev
-mdadm --stop "$mddev" || true
-mdadm --stop --scan
+mdadm --stop $(lsblk -al -o NAME --noheadings "$dev2" | grep '^md') || true
cat /proc/mdstat
aux wipefs_a "$dev1" || true
aux wipefs_a "$dev2" || true