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

tests: use throttle_dm_mirror

In this case it's better to use throttling of mirror sync,
that delay everything with dm_delay.
This commit is contained in:
Zdenek Kabelac 2018-05-07 11:45:11 +02:00
parent 172d8fb355
commit f5da325d70

View File

@ -17,7 +17,7 @@ export LVM_TEST_LVMETAD_DEBUG_OPTS=${LVM_TEST_LVMETAD_DEBUG_OPTS-}
. lib/inittest
aux prepare_pvs 5 100
aux prepare_pvs 5
get_devs
# proper DEVRANGE needs to be set according to extent size
@ -319,10 +319,12 @@ fi
#
aux zero_dev "$dev2" $(get first_extent_sector "$dev2"):
aux zero_dev "$dev4" $(get first_extent_sector "$dev4"):
aux throttle_dm_mirror
# Use large enough mirror that takes time to sychronize with small regionsize
lvcreate -aey -L80 -Zn -Wn --type mirror --regionsize 16k -m2 -n $lv1 $vg "$dev1" "$dev2" "$dev4" "$dev3:$DEVRANGE"
lvcreate -aey -L20 -Zn -Wn --type mirror --regionsize 16k -m2 -n $lv1 $vg "$dev1" "$dev2" "$dev4" "$dev3:$DEVRANGE"
not lvconvert -m-1 $vg/$lv1 "$dev1" 2>&1 | tee out
aux restore_dm_mirror
grep "not in-sync" out
lvconvert $vg/$lv1 # wait
@ -334,9 +336,11 @@ check linear $vg $lv1
check lv_on $vg $lv1 "$dev4"
lvremove -ff $vg
aux throttle_dm_mirror
# No parallel lvconverts on a single LV please
# Use big enough mirror size and small regionsize to run on all test machines succesfully
lvcreate -aey -Zn -Wn -L80 --type mirror --regionsize 16k -m1 -n $lv1 $vg "$dev1" "$dev2" "$dev3:0-8"
lvcreate -aey -Zn -Wn -L20 --type mirror --regionsize 16k -m1 -n $lv1 $vg "$dev1" "$dev2" "$dev3:0-8"
check mirror $vg $lv1
check mirror_legs $vg $lv1 2
@ -345,6 +349,7 @@ LVM_TEST_TAG="kill_me_$PREFIX" lvconvert -m+1 -b $vg/$lv1 "$dev4"
# Next convert should fail b/c we can't have 2 at once
not lvconvert -m+1 $vg/$lv1 "$dev5" 2>&1 | tee out
aux restore_dm_mirror
grep "is already being converted" out
lvconvert $vg/$lv1 # wait