1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-02 01:18:26 +03:00

tests: check for raid sync in progress

TODO: this needs to be built-in in lvm command itself.
This commit is contained in:
Zdenek Kabelac 2021-03-17 11:22:16 +01:00
parent accf324ccb
commit 26fb6b5e8d

View File

@ -232,10 +232,11 @@ lvcreate -aey -l 2 -n $lv1 $vg "$dev1"
lvconvert -y -m 1 $vg/$lv1 \
--config 'global { mirror_segtype_default = "raid1" }' "$dev2"
lvs --noheadings -o attr $vg/$lv1 | grep '^[[:space:]]*r'
# FIXME: lvconvert/lvcreate should trace state of target
for i in {1..10}; do
check raid_leg_status $vg $lv1 "Aa" && break
check raid_leg_status $vg $lv1 "aa" || die "Cannot wait for Aa on $vg/$lv1"
sleep .1
dmsetup status | grep $vg-$lv1: | tee out
grep -E "recover|rebuild" out && break
sleep .05
done
not lvconvert --yes -m 0 $vg/$lv1 "$dev1"
lvconvert --yes -m 0 $vg/$lv1 "$dev2"