Skip to contentSkip to conversation

master - test: Avoid a race in pvmove-restart.sh.

PATCH Petr Rockai 1 participant 1 message Feb 18, 2015

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=88411fb6f97937c6cac573e2720ae30fafe96761
Commit:        88411fb6f97937c6cac573e2720ae30fafe96761
Parent:        733e3f6f983d26c346c5426915abfd9594e85a49
Author:        Petr Rockai <[email protected]>
AuthorDate:    Wed Feb 18 12:27:47 2015 +0100
Committer:     Petr Rockai <[email protected]>
CommitterDate: Wed Feb 18 12:27:47 2015 +0100

test: Avoid a race in pvmove-restart.sh.

---
 test/shell/pvmove-restart.sh |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
test/shell/pvmove-restart.sh +4 -2
index 5e4fd8b..398095b 100644
@@ -15,7 +15,9 @@
 
 aux prepare_pvs 3 60
 
-vgcreate -s 128k $vg "$dev1" "$dev2" "$dev3"
+vgcreate -s 128k $vg "$dev1" "$dev2"
+pvcreate --metadatacopies 0 "$dev3"
+vgextend $vg "$dev3"
 
 for mode in "--atomic" ""
 do
@@ -32,7 +34,7 @@ aux delay_dev "$dev3" 0 100
 pvmove -i0 -n $vg/$lv1 "$dev1" "$dev3" &
 PVMOVE=$!
 # Let's wait a bit till pvmove starts and kill it
-sleep 1
+while not dmsetup status "$vg-pvmove0"; do sleep .1; done
 kill -9 $PVMOVE
 wait