master - test: add convcenience conversion tests linear <-> striped
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=3810fd8d0d9cfcc519355f995d9cc70dca2811fd Commit: 3810fd8d0d9cfcc519355f995d9cc70dca2811fd Parent: bd7cdd0b09ba123b064937fddde08daacbed7dab Author: Heinz Mauelshagen <[email protected]> AuthorDate: Wed May 30 12:50:34 2018 +0200 Committer: Heinz Mauelshagen <[email protected]> CommitterDate: Tue Jun 5 16:23:18 2018 +0200
test: add convcenience conversion tests linear <-> striped
Add tests for linear <-> striped|raid* conversions.
Add region_size config to reshape tests to avoid test failures in case of it being defined unexpectedly in lvm.conf.
Related: rhbz1439925
Related: rhbz1447809
--- test/shell/lvchange-rebuild-raid.sh | 2 +- ...ert-raid-reshape-linear_to_raid6-single-type.sh | 102 ++++++++++++++++++++ ...t-raid-reshape-linear_to_striped-single-type.sh | 80 +++++++++++++++ .../lvconvert-raid-reshape-linear_to_striped.sh | 2 + ...t-raid-reshape-striped_to_linear-single-type.sh | 89 +++++++++++++++++ .../lvconvert-raid-reshape-striped_to_linear.sh | 9 ++- .../lvconvert-raid-reshape-stripes-load-fail.sh | 9 +- test/shell/lvconvert-raid-restripe-linear.sh | 76 +++++++++++++++ 8 files changed, 363 insertions(+), 6 deletions(-)
test/shell/lvchange-rebuild-raid.sh +1 -1
@@ -17,7 +17,7 @@ SKIP_WITH_LVMPOLLD=1 aux have_raid 1 3 2 || skip v1_9_0=0 -aux have_raid 1 9 && v1_9_0=1 +aux have_raid 1 9 0 && v1_9_0=1 aux prepare_vg 8 get_devs
test/shell/lvconvert-raid-reshape-linear_to_raid6-single-type.sh new file +102 -0
102 lines not on this page · raw message
test/shell/lvconvert-raid-reshape-linear_to_striped-single-type.sh new file +80 -0
80 lines not on this page · raw message
test/shell/lvconvert-raid-reshape-linear_to_striped.sh +2 -0
@@ -14,6 +14,8 @@ SKIP_WITH_LVMPOLLD=1 . lib/inittest +aux lvmconf 'activation/raid_region_size = 512' + which mkfs.ext4 || skip aux have_raid 1 12 0 || skip
test/shell/lvconvert-raid-reshape-striped_to_linear-single-type.sh new file +89 -0
89 lines not on this page · raw message
test/shell/lvconvert-raid-reshape-striped_to_linear.sh +8 -1
@@ -15,6 +15,8 @@ SKIP_WITH_LVMPOLLD=1 . lib/inittest +aux lvmconf 'activation/raid_region_size = 512' + which mkfs.ext4 || skip aux have_raid 1 12 0 || skip
@@ -51,7 +53,9 @@ aux wait_for_sync $vg $lv1 fsck -fn $DM_DEV_DIR/$vg/$lv1 # Extend raid5_n LV by factor 4 to keep size once linear -lvresize -y -L 64 $vg/$lv1 +lvresize -y -L 64M $vg/$lv1 +aux wait_for_sync $vg $lv1 + check lv_field $vg/$lv1 segtype "raid5_n" check lv_field $vg/$lv1 data_stripes 4 check lv_field $vg/$lv1 stripes 5
@@ -87,6 +91,7 @@ check lv_first_seg_field $vg/$lv1 stripes 2 check lv_first_seg_field $vg/$lv1 stripesize "32.00k" check lv_first_seg_field $vg/$lv1 regionsize "1.00m" check lv_first_seg_field $vg/$lv1 reshape_len_le 4 +fsck -fn $DM_DEV_DIR/$vg/$lv1 # Convert raid5_n to raid1 lvconvert -y --type raid1 $vg/$lv1
@@ -97,6 +102,7 @@ check lv_first_seg_field $vg/$lv1 stripes 2 check lv_first_seg_field $vg/$lv1 stripesize "0" check lv_first_seg_field $vg/$lv1 regionsize "1.00m" check lv_first_seg_field $vg/$lv1 reshape_len_le "" +fsck -fn $DM_DEV_DIR/$vg/$lv1 # Convert raid1 -> linear lvconvert -y --type linear $vg/$lv1
@@ -107,5 +113,6 @@ check lv_first_seg_field $vg/$lv1 stripes 1 check lv_first_seg_field $vg/$lv1 stripesize "0" check lv_first_seg_field $vg/$lv1 regionsize "0" check lv_first_seg_field $vg/$lv1 reshape_len_le "" +fsck -fn $DM_DEV_DIR/$vg/$lv1 vgremove -ff $vg
test/shell/lvconvert-raid-reshape-stripes-load-fail.sh +5 -4
@@ -46,6 +46,7 @@ check lv_first_seg_field $vg/$lv1 stripesize "64.00k" check lv_first_seg_field $vg/$lv1 data_stripes 10 check lv_first_seg_field $vg/$lv1 stripes 11 echo y|mkfs -t ext4 /dev/$vg/$lv1 +fsck -fn /dev/$vg/$lv1 mkdir -p $mount_dir mount "$DM_DEV_DIR/$vg/$lv1" $mount_dir
@@ -53,8 +54,8 @@ mkdir -p $mount_dir/1 $mount_dir/2 echo 3 >/proc/sys/vm/drop_caches -cp -r /usr/bin $mount_dir/1 >/dev/null 2>/dev/null & -cp -r /usr/bin $mount_dir/2 >/dev/null 2>/dev/null & +cp -r /usr/bin $mount_dir/1 &>/dev/null & +cp -r /usr/bin $mount_dir/2 &>/dev/null & sync & aux wait_for_sync $vg $lv1
@@ -69,11 +70,11 @@ check lv_first_seg_field $vg/$lv1 stripesize "64.00k" check lv_first_seg_field $vg/$lv1 data_stripes 15 check lv_first_seg_field $vg/$lv1 stripes 16 -rm -fr $mount_dir/2 -sync kill -9 %% wait +rm -fr $mount_dir/[12] +sync umount $mount_dir fsck -fn "$DM_DEV_DIR/$vg/$lv1"
test/shell/lvconvert-raid-restripe-linear.sh new file +76 -0
76 lines not on this page · raw message