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

TEST: Workaround for lvmetad vs inconsistent metadata.

This commit is contained in:
Petr Rockai 2012-09-20 01:57:55 +02:00
parent 9f96286c29
commit f8e287cca2
2 changed files with 9 additions and 4 deletions

View File

@ -37,6 +37,7 @@ test -e LOCAL_LVMETAD && cache="--cache"
init
vgscan $cache 2>&1 | tee cmd.out
grep "Inconsistent metadata found for VG $vg" cmd.out
test -e LOCAL_LVMETAD && vgrename $vg foo && vgrename foo $vg # trigger a write
vgscan $cache 2>&1 | tee cmd.out
not grep "Inconsistent metadata found for VG $vg" cmd.out
check

View File

@ -15,26 +15,30 @@ check_() {
# vgscan needs --cache option for direct scan if lvmetad is used
test -e LOCAL_LVMETAD && cache="--cache"
vgscan $cache 2>&1 | tee vgscan.out
grep "Inconsistent metadata found for VG $vg" vgscan.out
vgscan $cache 2>&1 | tee vgscan.out
not grep "Inconsistent metadata found for VG $vg" vgscan.out
$1 grep "Inconsistent metadata found for VG $vg" vgscan.out
}
aux prepare_vg 3
lvcreate -m 1 -l 1 -n mirror $vg
lvchange -a n $vg/mirror
lvchange -a n $vg
# try orphaning a missing PV (bz45867)
aux disable_dev "$dev1"
vgreduce --removemissing --force $vg
aux enable_dev "$dev1"
check_
test -e LOCAL_LVMETAD && pvcreate -f "$dev1"
check_ not
# try to just change metadata; we expect the new version (with MISSING_PV set
# on the reappeared volume) to be written out to the previously missing PV
vgextend $vg "$dev1"
lvcreate -l 1 -n boo -a n --zero n $vg
aux disable_dev "$dev1"
lvremove $vg/mirror
aux enable_dev "$dev1"
check_
test -e LOCAL_LVMETAD && lvremove $vg/boo # FIXME trigger a write :-(
check_ not