From b6902585187e9a7e29fb57d8415743db1bf80dab Mon Sep 17 00:00:00 2001 From: Marian Csontos Date: Tue, 26 Nov 2019 09:11:05 +0100 Subject: [PATCH] tests: Find md name using lsblk After stopping MD device and rescanning the leg, it is created with different name. --- test/shell/duplicate-pvs-md0.sh | 6 ++---- test/shell/duplicate-pvs-md1.sh | 9 +++------ 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 -- 2.43.5