summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2021-07-20 22:37:54 +0200
committerZdenek Kabelac <zkabelac@redhat.com>2021-07-21 15:56:33 +0200
commitb70c341c9e9526cc21f590af73ccce2369755736 (patch)
tree6f7bf931cfc94ac09c5769dc0464670d0a6df55b
parent2132fdc11f7bc285638765e001bef6a3e595b286 (diff)
downloadlvm2-b70c341c9e9526cc21f590af73ccce2369755736.tar.gz
test
-rw-r--r--test/shell/vgsplit-cache.sh47
1 files changed, 47 insertions, 0 deletions
diff --git a/test/shell/vgsplit-cache.sh b/test/shell/vgsplit-cache.sh
index eba85befe..202e4b562 100644
--- a/test/shell/vgsplit-cache.sh
+++ b/test/shell/vgsplit-cache.sh
@@ -75,6 +75,53 @@ lvremove -y $vg
vgremove -ff $vg
vgremove -ff $vg1
+#
+# Check we handle pmspare for splitted VGs
+#
+aux prepare_vg 7
+
+# Create cache-pool and pmspare on single PV1
+lvcreate -L10 --type cache-pool $vg/cpool "$dev1"
+# Move spare to separate PV3
+pvmove -n $vg/lvol0_pmspare "$dev1" "$dev3"
+# Create origin on PV2
+lvcreate -L10 -n orig $vg "$dev2"
+lvconvert -H -y --cachepool $vg/cpool $vg/orig
+
+vgchange -an $vg
+
+# Check we do not create new _pmspare
+vgsplit --poolmetadataspare n $vg $vg1 "$dev2" "$dev1"
+
+check lv_exists $vg/lvol0_pmspare
+check lv_not_exists $vg1/lvol0_pmspare
+
+vgremove $vg
+vgremove -f $vg1
+
+
+aux prepare_vg 7
+
+# Again - now with handling _pmspare by vgsplit
+lvcreate -L10 --type cache-pool $vg/cpool "$dev1"
+# Move spare to separate PV3
+pvmove -n $vg/lvol0_pmspare "$dev1" "$dev3"
+# Create origin on PV2
+lvcreate -L10 -n orig $vg "$dev2"
+lvconvert -H -y --cachepool $vg/cpool $vg/orig
+
+vgchange -an $vg
+
+# Handle _pmspare (default)
+vgsplit --poolmetadataspare y $vg $vg1 "$dev2" "$dev1"
+
+check lv_not_exists $vg/lvol0_pmspare
+check lv_exists $vg1/lvol0_pmspare
+
+vgremove $vg
+vgremove -f $vg1
+
+
vgcreate $vg "$dev1" "$dev2" "$dev3" "$dev4"
lvcreate -L6 -n $lv1 -an $vg "$dev2"