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

tests: check that pvscan --cache ignores certain PVs

This commit is contained in:
David Teigland 2019-03-06 12:17:47 -06:00
parent 4e20ebd6a1
commit 98b7a3a42d
2 changed files with 50 additions and 1 deletions

View File

@ -38,6 +38,20 @@ aux prepare_devs 5
vgcreate --shared $vg "$dev1" "$dev2" "$dev3" "$dev4" "$dev5"
#
# pvscan autoactivation ignore shared PVs
#
RUNDIR="/run"
test -d "$RUNDIR" || RUNDIR="/var/run"
PVID1=`pvs $dev1 --noheading -o uuid | tr -d - | awk '{print $1}'`
pvscan --cache -aay "$dev1"
not ls "$RUNDIR/lvm/pvs_online/$PVID1"
pvscan --cache -aay
not ls "$RUNDIR/lvm/pvs_online/$PVID1"
not ls "$RUNDIR/lvm/vgs_online/$vg"
#
# thin pool, thin lv, thin snap
#

View File

@ -27,7 +27,7 @@ _clear_online_files() {
. lib/inittest
aux prepare_pvs 2
aux prepare_pvs 3
vgcreate $vg1 "$dev1" "$dev2"
lvcreate -n $lv1 -l 4 -a n $vg1
@ -153,3 +153,38 @@ check lv_field $vg1/$lv1 lv_active ""
pvscan --cache -aay "$dev2"
check lv_field $vg1/$lv1 lv_active "active"
lvchange -an $vg1
# pvscan cache ignores pv that's not used
pvcreate "$dev3"
PVID3=`pvs $dev3 --noheading -o uuid | tr -d - | awk '{print $1}'`
echo $PVID3
not ls "$RUNDIR/lvm/pvs_online/$PVID3"
pvscan --cache -aay "$dev3"
ls "$RUNDIR/lvm/pvs_online"
not ls "$RUNDIR/lvm/pvs_online/$PVID3"
# pvscan cache ignores pv in a foreign vg
aux lvmconf "global/system_id_source = uname"
vgcreate $vg2 "$dev3"
lvcreate -an -n $lv1 -l1 $vg2
pvscan --cache -aay "$dev3"
ls "$RUNDIR/lvm/pvs_online/$PVID3"
check lv_field $vg2/$lv1 lv_active "active"
lvchange -an $vg2
rm "$RUNDIR/lvm/pvs_online/$PVID3"
vgchange -y --systemid "asdf" "$vg2"
pvscan --cache -aay "$dev3"
not ls "$RUNDIR/lvm/pvs_online/$PVID3"
check lv_field $vg2/$lv1 lv_active "" --foreign