From c3a9e28b2dad569fc39f36e90408a8a8f6357d5a Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Fri, 1 Dec 2017 11:58:38 +0100 Subject: [PATCH 24/25] tests: check pvmove is merging segments pvmove was imporoved to properly merge consqutive segments after pvmove so check it's working. (cherry picked from commit e16d309d5651d1697f5246855ae816302cd8516f) --- test/shell/pvmove-all-segtypes.sh | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/test/shell/pvmove-all-segtypes.sh b/test/shell/pvmove-all-segtypes.sh index e10586e..f672290 100644 --- a/test/shell/pvmove-all-segtypes.sh +++ b/test/shell/pvmove-all-segtypes.sh @@ -29,12 +29,22 @@ aux prepare_vg 5 20 # Testing pvmove of linear LV lvcreate -aey -l 2 -n ${lv1}_foo $vg "$dev1" lvcreate -aey -l 2 -n $lv1 $vg "$dev1" -check lv_tree_on $vg ${lv1}_foo "$dev1" -check lv_tree_on $vg $lv1 "$dev1" +lvextend -l+2 $vg/${lv1}_foo "$dev1" +lvextend -l+2 $vg/${lv1} "$dev1" +lvextend -l+2 $vg/${lv1}_foo "$dev2" +lvextend -l+2 $vg/${lv1} "$dev3" +check lv_tree_on $vg ${lv1}_foo "$dev1" "$dev2" +check lv_tree_on $vg $lv1 "$dev1" "$dev3" +check lv_field $vg/${lv1}_foo seg_count 3 +check lv_field $vg/$lv1 seg_count 3 aux mkdev_md5sum $vg $lv1 -pvmove "$dev1" "$dev5" -check lv_tree_on $vg ${lv1}_foo "$dev5" -check lv_tree_on $vg $lv1 "$dev5" +dmsetup table +pvmove --atomic "$dev1" "$dev5" +check lv_tree_on $vg ${lv1}_foo "$dev2" "$dev5" +check lv_tree_on $vg $lv1 "$dev3" "$dev5" +# Also check 2 segments from $dev1 were merged on $dev5 +check lv_field $vg/${lv1}_foo seg_count 2 +check lv_field $vg/$lv1 seg_count 2 check dev_md5sum $vg $lv1 pvmove -n $lv1 "$dev5" "$dev4" check lv_tree_on $vg $lv1 "$dev4" -- 1.8.3.1