Skip to contentSkip to conversation

add one mdadm test case

PATCH In review Xiao Ni 2 participants 3 messages Oct 10, 2017 MD RAID

lore
Share & tools
lore

Xiao Ni

author
#0 lore raw

cover add one mdadm test case

Hi all

Sorry for forgeting this patch. It adds one test case for raid5 reshape. Please review.

Xiao Ni (1):
mdadm/test: Add one test case for raid5 reshape

 test           |  7 +++++++
 tests/02r5grow | 17 +++++++++++++++++
 2 files changed, 24 insertions(+)
Signature · 1 line
2.7.4
author
#1 lore raw

PATCH 1/1 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.

Suggested-by:  Jes Sorensen <[email protected]>
Suggested-by:  Zhilong Liu <[email protected]>
Suggested-by:  Paul Menzel <[email protected]>
---
 test           |  7 +++++++
 tests/02r5grow | 17 +++++++++++++++++
 2 files changed, 24 insertions(+)
test +7 -0
index 25268a0..e74bbe5 100755
@@ -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"
 		;;
tests/02r5grow +17 -0
index 386e82e..bb9bd6d 100644
@@ -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
Signature · 1 line
2.7.4
#2 lore raw

Re: [MDADM PATCH -v5 1/1] mdadm/test: Add one test case for raid5 reshape

Quoted 4 lines · Xiao Ni

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.

Quoted 8 lines
Suggested-by:  Jes Sorensen <[email protected]>
Suggested-by:  Zhilong Liu <[email protected]>
Suggested-by:  Paul Menzel <[email protected]>
---
  test           |  7 +++++++
  tests/02r5grow | 17 +++++++++++++++++
  2 files changed, 24 insertions(+)

I find the choice of 1.1 metadata kinda odd for these tests, but otherwise I think it's fine, so I applied it.

Jes