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

Make the calls to pvscan --lvmetad in the testsuite slightly more civilised.

This commit is contained in:
Petr Rockai 2012-02-23 23:58:42 +00:00
parent 3f694b1265
commit 726cf41b80
4 changed files with 13 additions and 7 deletions

View File

@ -78,6 +78,12 @@ prepare_lvmetad() {
sleep 1
}
notify_lvmetad() {
if test -e LOCAL_LVMETAD; then
pvscan --lvmetad "$@" || true
fi
}
teardown_devs() {
# Delete any remaining dm/udev semaphores
teardown_udev_cookies
@ -328,7 +334,7 @@ disable_dev() {
min=$(($(stat --printf=0x%T $dev)))
echo "disabling device $dev ($maj:$min)"
dmsetup remove -f $dev || true
pvscan --lvmetad $maj:$min || true
notify_lvmetad $maj:$min
done
finish_udev_transaction
@ -342,7 +348,7 @@ enable_dev() {
dmsetup create -u TEST-$name $name $name.table || dmsetup load $name $name.table
# using device name (since device path does not exists yes with udev)
dmsetup resume $name
pvscan --lvmetad $dev || true
notify_lvmetad $dev
done
finish_udev_transaction
}

View File

@ -86,7 +86,7 @@ dd if=backup_i of="$dev1" bs=256K count=1
# dirty game
dd if=/dev/zero of="$dev3" bs=256K count=1
pvscan --lvmetad $dev3 || true # udev be watching you
aux notify_lvmetad $dev3 # udev be watching you
vgreduce --removemissing --force $vg

View File

@ -18,7 +18,7 @@ create_pool_label_()
# printf comes from coreutils, and is probably not posix either
env printf "\x01\x16\x70\x06\x5f\xcf\xff\xb9\xf8\x24\x8apool1" | dd of=$2 bs=5 seek=1 conv=notrunc
env printf "\x04\x01\x03\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x0$1\x68\x01\x16\x70\x00\x00\x00\x00\x00\x06\x5f\xd0" | dd of=$2 bs=273 seek=1 conv=notrunc
pvscan --lvmetad "$2" || true
aux notify_lvmetad "$2"
}
env printf "" || exit 200 # skip if printf is not available

View File

@ -17,7 +17,7 @@ lvcreate -l100%FREE -n $lv1 $vg1
# Clone the LUN
dd if=$dev1 of=$dev2 bs=256K count=1
pvscan --lvmetad $dev2 || true
aux notify_lvmetad $dev2
# Verify pvs works on each device to give us vgname
check pv_field $dev1 vg_name $vg1
@ -30,8 +30,8 @@ vgimportclone --basevgname $vg2 $dev2
# concerned, can only live on a single device. With the last pvscan, we told it
# that PV from $dev1 now lives on $dev2, but in fact this is not true anymore,
# since we wrote a different PV over $dev2.
pvscan --lvmetad $dev2 || true
pvscan --lvmetad $dev1 || true
aux notify_lvmetad $dev2
aux notify_lvmetad $dev1
# Verify we can activate / deactivate the LV from both VGs
lvchange -ay $vg1/$lv1 $vg2/$lv1