Skip to contentSkip to conversation

master - lvconvert: add missed new test scripts for reshaping

PATCH Heinz Mauelshagen 1 participant 1 message Feb 24, 2017

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=76f60cc4306deda481c45de7ebcde02a40668d85
Commit:        76f60cc4306deda481c45de7ebcde02a40668d85
Parent:        2574d3257ad41cad8dcbad3332774172e86f05da
Author:        Heinz Mauelshagen <[email protected]>
AuthorDate:    Fri Feb 24 05:16:21 2017 +0100
Committer:     Heinz Mauelshagen <[email protected]>
CommitterDate: Fri Feb 24 05:20:59 2017 +0100

lvconvert: add missed new test scripts for reshaping

Add aforementioned but forgotten new test scripts
lvconvert-raid-reshape-linear_to_striped.sh,
lvconvert-raid-reshape-striped_to_linear.sh and
lvconvert-raid-reshape.sh

Those presume dm-raid target version 1.10.2
provided by a following kernel patch.

Related: rhbz834579
Related: rhbz1191935
Related: rhbz1191978

---
 .../lvconvert-raid-reshape-linear_to_striped.sh    |   64 +++++++
 .../lvconvert-raid-reshape-striped_to_linear.sh    |   84 ++++++++
 test/shell/lvconvert-raid-reshape.sh               |  199 ++++++++++++++++++++
 3 files changed, 347 insertions(+), 0 deletions(-)
test/shell/lvconvert-raid-reshape-linear_to_striped.sh new file +64 -0
new file mode 100644
index 0000000..3b6120c
@@ -0,0 +1,64 @@
+#!/bin/sh
+# Copyright (C) 2017 Red Hat, Inc. All rights reserved.
+#
+# This copyrighted material is made available to anyone wishing to use,
+# modify, copy, or redistribute it subject to the terms and conditions
+# of the GNU General Public License v.2.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA2110-1301 USA
+
+SKIP_WITH_LVMLOCKD=1
+SKIP_WITH_LVMPOLLD=1
+
+. lib/inittest
+
+which mkfs.ext4 || skip
+aux have_raid 1 10 2 || skip
+
+aux prepare_vg 5
+
+#
+# Test single step linear -> striped conversion
+#
+
+# Create linear LV
+lvcreate -aey -L 16M -n $lv1 $vg
+check lv_field $vg/$lv1 segtype "linear"
+check lv_field $vg/$lv1 stripes 1
+echo y|mkfs -t ext4 $DM_DEV_DIR/$vg/$lv1
+fsck -fn $DM_DEV_DIR/$vg/$lv1
+
+# Convert linear -> raid1
+lvconvert -y -m 1 $vg/$lv1
+fsck -fn $DM_DEV_DIR/$vg/$lv1
+check lv_field $vg/$lv1 segtype "raid1"
+check lv_field $vg/$lv1 stripes 2
+check lv_field $vg/$lv1 regionsize "512.00k"
+aux wait_for_sync $vg $lv1
+fsck -fn $DM_DEV_DIR/$vg/$lv1
+
+# Convert raid1 -> raid5_n
+lvconvert -y --ty raid5_n $vg/$lv1
+fsck -fn $DM_DEV_DIR/$vg/$lv1
+check lv_field $vg/$lv1 segtype "raid5_n"
+check lv_field $vg/$lv1 stripes 2
+check lv_field $vg/$lv1 stripesize "64.00k"
+check lv_field $vg/$lv1 regionsize "512.00k"
+
+# Convert raid5_n adding stripes
+lvconvert -y --stripes 4 $vg/$lv1
+fsck -fn $DM_DEV_DIR/$vg/$lv1
+check lv_first_seg_field $vg/$lv1 segtype "raid5_n"
+check lv_first_seg_field $vg/$lv1 stripes 5
+check lv_first_seg_field $vg/$lv1 stripesize "64.00k"
+check lv_first_seg_field $vg/$lv1 regionsize "512.00k"
+aux wait_for_sync $vg $lv1
+fsck -fn $DM_DEV_DIR/$vg/$lv1
+
+# Convert raid5_n -> striped
+lvconvert -y --type striped $vg/$lv1
+fsck -fn $DM_DEV_DIR/$vg/$lv1
+
+vgremove -ff $vg
test/shell/lvconvert-raid-reshape-striped_to_linear.sh new file +84 -0

84 lines not on this page · raw message

test/shell/lvconvert-raid-reshape.sh new file +199 -0

199 lines not on this page · raw message