[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[lvm-devel] [patch 3/3] Update vgsplit test to verify loosening of active LV restriction.



Signed-off-by: Dave Wysochanski <dwysocha redhat com>
---
 test/t-vgsplit-operation.sh |   53 +++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 53 insertions(+), 0 deletions(-)

diff --git a/test/t-vgsplit-operation.sh b/test/t-vgsplit-operation.sh
index 82094f2..f4d94f9 100755
--- a/test/t-vgsplit-operation.sh
+++ b/test/t-vgsplit-operation.sh
@@ -276,6 +276,59 @@ test_expect_success \
    status=$?; echo status=$status; test $status = 5 &&
    vgremove -ff $vg1'
 
+#
+# Verify vgsplit rejects active LVs only when active LVs involved in split
+#
+test_expect_success \
+  "vgsplit fails, active mirror involved in split" \
+  'vgcreate $vg1 $d1 $d2 $d3 $d4 &&
+   lvcreate -l 16 -n $lv1 -m1 $vg1 $d1 $d2 $d3 &&
+   lvcreate -l 16 -n $lv2 $vg1 $d4 &&
+   lvchange -an $vg1/$lv2 &&
+   vg_validate_pvlv_counts_ $vg1 4 5 0 &&
+   vgsplit -n $lv1 $vg1 $vg2;
+   status=$?; echo status=$status; test $status = 5 &&
+   vgremove -ff $vg1'
+
+test_expect_success \
+  "vgsplit succeeds, active mirror not involved in split" \
+  'vgcreate $vg1 $d1 $d2 $d3 $d4 &&
+   lvcreate -l 16 -n $lv1 -m1 $vg1 $d1 $d2 $d3 &&
+   lvcreate -l 16 -n $lv2 $vg1 $d4 &&
+   lvchange -an $vg1/$lv2 &&
+   vg_validate_pvlv_counts_ $vg1 4 5 0 &&
+   vgsplit -n $lv2 $vg1 $vg2 &&
+   vgremove -ff $vg1 &&
+   vgremove -ff $vg2'
+
+test_expect_success \
+  "vgsplit fails, active snapshot involved in split" \
+  'vgcreate $vg1 $d1 $d2 $d3 $d4 &&
+   lvcreate -l 64 -i 2 -n $lv1 $vg1 $d1 $d2 &&
+   lvcreate -l 4 -i 2 -s -n $lv2 $vg1/$lv1 &&
+   lvcreate -l 64 -i 2 -n $lv3 $vg1 $d3 $d4 &&
+   lvchange -an $vg1/$lv3 &&
+   vg_validate_pvlv_counts_ $vg1 4 2 1 &&
+   vgsplit -n $lv2 $vg1 $vg2;
+   status=$?; echo status=$status; test $status = 5 &&
+   lvremove -f $vg1/$lv2 &&
+   vgremove -ff $vg1'
+
+test_expect_success \
+  "vgsplit succeeds, active snapshot not involved in split" \
+  'vgcreate $vg1 $d1 $d2 $d3 &&
+   lvcreate -l 64 -i 2 -n $lv1 $vg1 $d1 $d2 &&
+   lvcreate -l 4 -s -n $lv2 $vg1/$lv1 &&
+   vgextend $vg1 $d4 &&
+   lvcreate -l 64 -n $lv3 $vg1 $d4 &&
+   lvchange -an $vg1/$lv3 &&
+   vg_validate_pvlv_counts_ $vg1 4 2 1 &&
+   vgsplit -n $lv3 $vg1 $vg2 &&
+   vgchange -an $vg1 &&
+   lvremove -f $vg1/$lv2 &&
+   vgremove -ff $vg1 &&
+   vgremove -ff $vg2'
+
 
 test_done
 
-- 
1.5.3.4

-- 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]