summaryrefslogtreecommitdiffstats
path: root/tests/07reshape5intr
diff options
context:
space:
mode:
authorNeil Brown <neilb@suse.de>2008-06-27 08:07:52 +0200
committerNeil Brown <neilb@suse.de>2008-06-27 08:07:52 +0200
commit0aa389dc6232370241d6efa811e7fbc59c0dd2a7 (patch)
tree583b14834b0e5b445908a2c291fcf80f0a65768d /tests/07reshape5intr
parentAdd "bitmap=" to "--detail --brief" output when relevant. (diff)
downloadmdadm-0aa389dc6232370241d6efa811e7fbc59c0dd2a7.tar.xz
mdadm-0aa389dc6232370241d6efa811e7fbc59c0dd2a7.zip
Add test for stoping and restarting a raid5 reshape.
There was a kernel bug with stopping and restarting raid5 recently. So add a test to check for it.
Diffstat (limited to 'tests/07reshape5intr')
-rw-r--r--tests/07reshape5intr33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/07reshape5intr b/tests/07reshape5intr
new file mode 100644
index 00000000..e2a3560c
--- /dev/null
+++ b/tests/07reshape5intr
@@ -0,0 +1,33 @@
+
+#
+# test interrupting and restartign raid5 reshape.
+set -x
+devs="$dev1"
+st=UU
+for disks in 2 3 4 5
+do
+ eval devs=\"$devs \$dev$disks\"
+ st=U$st
+ for d in $devs
+ do dd if=/dev/urandom of=$d bs=1024 || true
+ done
+
+ $mdadm -CR $md0 -amd -l5 -n$disks --assume-clean $devs
+ $mdadm $md0 --add $dev6
+ echo 20 > /proc/sys/dev/raid/speed_limit_max
+ $mdadm --grow $md0 -n $[disks+1]
+ check reshape
+ check state $st
+ $mdadm --stop $md0
+ $mdadm --assemble $md0 $devs $dev6
+ check reshape
+ echo 2000 > /proc/sys/dev/raid/speed_limit_max
+ check wait
+ echo check > /sys/block/md0/md/sync_action
+ check wait
+ mm=`cat /sys/block/md0/md/mismatch_cnt`
+ if [ $mm -gt 0 ]
+ then echo >&2 "ERROR mismatch_cnt non-zero : $mm" ; exit 1
+ fi
+ $mdadm -S $md0
+done