1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-04-01 18:50:41 +03:00

tests: add helper routine for pvmove status check

This commit is contained in:
Ondrej Kozina 2015-03-27 14:24:16 +01:00
parent c8caa04b1c
commit 7c66850ce5
2 changed files with 14 additions and 5 deletions

View File

@ -902,6 +902,18 @@ dmsetup_wrapped() {
dmsetup "$@"
}
wait_pvmove_lv_ready() {
# given sleep .1 this is about 60 secs of waiting
local retries=${2:-600}
while : ; do
test $retries -le 0 && die "Waiting for pvmove LV to get activated has timed out"
dmsetup info -c -o tables_loaded $1 > out || true;
not grep Live out || break
sleep .1
retries=$((retries-1))
done
}
test -z "$LVM_TEST_AUX_TRACE" || set -x
test -f DEVICES && devs=$(< DEVICES)

View File

@ -34,11 +34,8 @@ aux delay_dev "$dev3" 0 200
pvmove -i0 -n $vg/$lv1 "$dev1" "$dev3" $mode &
PVMOVE=$!
# Let's wait a bit till pvmove starts and kill it
while : ; do
dmsetup info -c -o tables_loaded "$vg-pvmove0" > out || true;
not grep Live out || break
sleep .1
done
aux wait_pvmove_lv_ready "$vg-pvmove0" 300
kill -9 $PVMOVE
wait