From: Xiao Ni Date: Tue, 10 Oct 2017 11:32:52 +0000 (+0800) Subject: mdadm/test: Add one test case for raid5 reshape X-Git-Tag: mdadm-4.1-rc1~60 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=62e2991ff90ec4b1ab4972218bc55489067cba8c;p=thirdparty%2Fmdadm.git mdadm/test: Add one test case for raid5 reshape This case tries to allow raid5 reshape to use backwards direction. It changes chunksize after reshape and stops the raid. Then starts the raid again. Signed-off-by: Xiao Ni Suggested-by: Jes Sorensen Suggested-by: Zhilong Liu Suggested-by: Paul Menzel Signed-off-by: Jes Sorensen --- diff --git a/test b/test index 25268a0f..e74bbe57 100755 --- a/test +++ b/test @@ -320,6 +320,13 @@ check() { grep -sq "inactive" /proc/mdstat || die "array is not inactive!" ;; + # It only can be used when there is only one raid + chunk ) + chunk_size=`awk -F',' '/chunk/{print $2}' /proc/mdstat | awk -F'[a-z]' '{print $1}'` + if [ "$chunk_size" -ne "$2" ] ; then + die "chunksize should be $2, but it's $chunk_size" + fi + ;; * ) die "unknown check $1" ;; diff --git a/tests/02r5grow b/tests/02r5grow index 386e82ee..bb9bd6da 100644 --- a/tests/02r5grow +++ b/tests/02r5grow @@ -34,3 +34,20 @@ check nosync sh tests/testdev $md0 3 $[size/2] 128 mdadm -S $md0 + +# create a raid5 array and change the chunk +mdadm -CR $md0 --level raid5 --metadata=1.1 --chunk=32 --raid-disks 3 --size $[size/2] $dev1 $dev2 $dev3 +check wait +check state UUU +check chunk 32 + +mdadm $md0 --grow --chunk=64 +check reshape +check wait +check chunk 64 + +mdadm -S $md0 +mdadm -A $md0 $dev1 $dev2 $dev3 +check state UUU +check chunk 64 +mdadm -S $md0