Blame SOURCES/lvm2-2_03_13-test.patch

ffcdab
 test/shell/vgsplit-cache.sh | 47 +++++++++++++++++++++++++++++++++++++++++++++
ffcdab
 1 file changed, 47 insertions(+)
ffcdab
ffcdab
diff --git a/test/shell/vgsplit-cache.sh b/test/shell/vgsplit-cache.sh
ffcdab
index eba85be..202e4b5 100644
ffcdab
--- a/test/shell/vgsplit-cache.sh
ffcdab
+++ b/test/shell/vgsplit-cache.sh
ffcdab
@@ -75,6 +75,53 @@ lvremove -y $vg
ffcdab
 vgremove -ff $vg
ffcdab
 vgremove -ff $vg1
ffcdab
 
ffcdab
+#
ffcdab
+# Check we handle pmspare for splitted VGs
ffcdab
+#
ffcdab
+aux prepare_vg 7
ffcdab
+
ffcdab
+# Create cache-pool and pmspare on single PV1
ffcdab
+lvcreate -L10 --type cache-pool $vg/cpool "$dev1"
ffcdab
+# Move spare to separate PV3
ffcdab
+pvmove -n $vg/lvol0_pmspare "$dev1" "$dev3"
ffcdab
+# Create origin on PV2
ffcdab
+lvcreate -L10 -n orig $vg  "$dev2"
ffcdab
+lvconvert -H -y --cachepool $vg/cpool $vg/orig
ffcdab
+
ffcdab
+vgchange -an $vg
ffcdab
+
ffcdab
+# Check we do not create new _pmspare
ffcdab
+vgsplit --poolmetadataspare n  $vg $vg1 "$dev2" "$dev1"
ffcdab
+
ffcdab
+check lv_exists $vg/lvol0_pmspare
ffcdab
+check lv_not_exists $vg1/lvol0_pmspare
ffcdab
+
ffcdab
+vgremove $vg
ffcdab
+vgremove -f $vg1
ffcdab
+
ffcdab
+
ffcdab
+aux prepare_vg 7
ffcdab
+
ffcdab
+# Again - now with handling _pmspare by vgsplit
ffcdab
+lvcreate -L10 --type cache-pool $vg/cpool "$dev1"
ffcdab
+# Move spare to separate PV3
ffcdab
+pvmove -n $vg/lvol0_pmspare "$dev1" "$dev3"
ffcdab
+# Create origin on PV2
ffcdab
+lvcreate -L10 -n orig $vg  "$dev2"
ffcdab
+lvconvert -H -y --cachepool $vg/cpool $vg/orig
ffcdab
+
ffcdab
+vgchange -an $vg
ffcdab
+
ffcdab
+# Handle _pmspare  (default)
ffcdab
+vgsplit --poolmetadataspare y  $vg $vg1 "$dev2" "$dev1"
ffcdab
+
ffcdab
+check lv_not_exists $vg/lvol0_pmspare
ffcdab
+check lv_exists $vg1/lvol0_pmspare
ffcdab
+
ffcdab
+vgremove $vg
ffcdab
+vgremove -f $vg1
ffcdab
+
ffcdab
+
ffcdab
 vgcreate $vg "$dev1" "$dev2" "$dev3" "$dev4"
ffcdab
 
ffcdab
 lvcreate -L6 -n $lv1 -an $vg "$dev2"