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

tests: pvmove better delay check

Improve testing for condition that pvmove0 is already running in the
table (so we do not kill pvmove while it has loaded target, but
it's not yet Live).

Also delay_dev for 200ms.
This commit is contained in:
Zdenek Kabelac 2015-03-26 16:03:24 +01:00
parent d24b6cfb1f
commit 147b0a1700
2 changed files with 7 additions and 4 deletions

View File

@ -11,7 +11,6 @@
. lib/inittest . lib/inittest
# 15 extents
aux prepare_pvs 3 22 aux prepare_pvs 3 22
vgcreate -s 32K $vg $(cat DEVICES) vgcreate -s 32K $vg $(cat DEVICES)

View File

@ -1,5 +1,5 @@
#!/bin/sh #!/bin/sh
# Copyright (C) 2013 Red Hat, Inc. All rights reserved. # Copyright (C) 2013-2015 Red Hat, Inc. All rights reserved.
# #
# This copyrighted material is made available to anyone wishing to use, # This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions # modify, copy, or redistribute it subject to the terms and conditions
@ -29,12 +29,16 @@ lvextend -l+5 $vg/$lv1 "$dev1"
lvextend -l+10 $vg/$lv1 "$dev2" lvextend -l+10 $vg/$lv1 "$dev2"
# Slowdown writes # Slowdown writes
aux delay_dev "$dev3" 0 100 aux delay_dev "$dev3" 0 200
pvmove -i0 -n $vg/$lv1 "$dev1" "$dev3" $mode & pvmove -i0 -n $vg/$lv1 "$dev1" "$dev3" $mode &
PVMOVE=$! PVMOVE=$!
# Let's wait a bit till pvmove starts and kill it # Let's wait a bit till pvmove starts and kill it
while not dmsetup status "$vg-pvmove0"; do sleep .1; done while : ; do
dmsetup info -c -o tables_loaded "$vg-pvmove0" > out || true;
not grep Live out || break
sleep .1
done
kill -9 $PVMOVE kill -9 $PVMOVE
wait wait