1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

tests: improve usability on older systems

This commit is contained in:
Zdenek Kabelac 2018-05-24 15:20:22 +02:00
parent d6f2445996
commit 3702f39ef3

View File

@ -33,7 +33,7 @@ aux prepare_md_dev 1 64 2 "$dev1" "$dev2"
mddev=$(< MD_DEV)
pvdev=$(< MD_DEV_PV)
sleep 3
mdadm --stop "$mddev"
# copy fake PV/VG header PV3 -> PV2 (which is however md raid1 leg)
@ -52,7 +52,7 @@ sleep 3
# print what blkid thinks about each PV
for i in "$dev1" "$dev2" "$dev3" "$dev4"
do
blkid "$i"
blkid -c /dev/null -w /dev/null "$i" || echo "Unknown signature"
done
# expect open count for each PV to be 0
@ -74,11 +74,11 @@ sleep 3
dmsetup info -c
# if for any reason array went up - stop it again
mdadm --detail "$mddev" && {
if mdadm --detail "$mddev" ; then
mdadm --stop "$mddev"
aux udev_wait
should not mdadm --detail "$mddev"
}
fi
# now reassemble array from PV1 & PV2
mdadm --assemble --verbose "$mddev" "$dev1" "$dev2"
@ -86,8 +86,9 @@ aux udev_wait
sleep 1
# and let 'fake hdr' to be fixed from master/primary leg
mdadm --action=repair "$mddev"
sleep 1
# should be showing correctly PV3 & PV4
pvs
# (when mdadm supports repair)
if mdadm --action=repair "$mddev" ; then
sleep 1
# should be showing correctly PV3 & PV4
pvs
fi