From 221d8ff2a420a4104826907de9d71100dc208834 Mon Sep 17 00:00:00 2001 From: David Teigland Date: Thu, 3 Nov 2016 11:43:08 -0500 Subject: [PATCH] tests: check that pvscan cannot activate exported VG --- test/shell/lvmetad-pvscan-cache.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/test/shell/lvmetad-pvscan-cache.sh b/test/shell/lvmetad-pvscan-cache.sh index 501eec510..8b1e8c25a 100644 --- a/test/shell/lvmetad-pvscan-cache.sh +++ b/test/shell/lvmetad-pvscan-cache.sh @@ -24,6 +24,28 @@ pvscan --cache vgs | grep $vg1 +# Check that an LV cannot be activated by lvchange while VG is exported +lvcreate -n $lv1 -l 4 -a n $vg1 +check lv_exists $vg1 +vgexport $vg1 +fail lvs $vg1 +fail lvchange -ay $vg1/$lv1 +vgimport $vg1 +check lv_exists $vg1 +check lv_field $vg/$lv1 lv_active "" + +# Check that an LV cannot be activated by pvscan while VG is exported +vgexport $vg1 +pvscan --cache -aay "$dev1" +pvscan --cache -aay "$dev2" +vgimport $vg1 +check lv_exists $vg1 +check lv_field $vg1/$lv1 lv_active "" +pvscan --cache -aay "$dev1" +pvscan --cache -aay "$dev2" +check lv_field $vg1/$lv1 lv_active "active" +lvchange -an $vg1/$lv1 + # When MDA is ignored on PV, do not read any VG # metadata from such PV as it may contain old # metadata which hasn't been updated for some