summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2016-11-03 11:43:08 -0500
committerDavid Teigland <teigland@redhat.com>2016-11-03 11:43:37 -0500
commit221d8ff2a420a4104826907de9d71100dc208834 (patch)
tree6cd0db1dd77b3bc4985cd4351eacb1d5cf9ed971
parent28b210f4fa10ef5e9baf4e28a891460eb65eb602 (diff)
downloadlvm2-221d8ff2a420a4104826907de9d71100dc208834.tar.gz
tests: check that pvscan cannot activate exported VG
-rw-r--r--test/shell/lvmetad-pvscan-cache.sh22
1 files changed, 22 insertions, 0 deletions
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