summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorNeil Brown <neilb@suse.de>2006-03-13 05:51:32 +0000
committerNeil Brown <neilb@suse.de>2006-03-13 05:51:32 +0000
commite86c9dd6d847ec57ec400b118efaf2c1808f10bc (patch)
tree6cb0e2d0c2e48d102b08b99d41941ae7f215a90c /tests
parent8a4440794afbebe6bdc710eefd21c221c9046644 (diff)
downloadmdadm-e86c9dd6d847ec57ec400b118efaf2c1808f10bc.tar.gz
mdadm-e86c9dd6d847ec57ec400b118efaf2c1808f10bc.tar.xz
mdadm-e86c9dd6d847ec57ec400b118efaf2c1808f10bc.zip
Initial reshape support
Needs work for other levels etc. Signed-off-by: Neil Brown <neilb@suse.de>
Diffstat (limited to 'tests')
-rw-r--r--tests/07testreshape538
1 files changed, 38 insertions, 0 deletions
diff --git a/tests/07testreshape5 b/tests/07testreshape5
new file mode 100644
index 0000000..8f56a72
--- /dev/null
+++ b/tests/07testreshape5
@@ -0,0 +1,38 @@
+
+#
+# test the reshape code by using test_reshape and the
+# kernel md code to move data into and out of variously
+# shaped md arrays.
+set -x
+layouts=(la ra ls rs)
+for chunk in 4 8 16 32 64 128
+do
+ devs="$dev1"
+ for disks in 2 3 4 5 6
+ do
+ eval devs=\"$devs \$dev$disks\"
+ for nlayout in 0 1 2 3
+ do
+ layout=${layouts[$nlayout]}
+
+ size=$[chunk*(disks-1)*disks]
+
+ # test restore: make a raid5 from a file, then do a compare
+ dd if=/dev/urandom of=/tmp/RandFile bs=1024 count=$size
+ $dir/test_stripe restore /tmp/RandFile $disks $[chunk*1024] 5 $nlayout 0 $[size*1024] $devs
+ $mdadm -CR $md0 -amd -l5 -n$disks --assume-clean -c $chunk -p $layout $devs
+ cmp -s -n $[size*1024] $md0 /tmp/RandFile || { echo cmp failed ; exit 2; }
+
+ # FIXME check parity
+
+ # test save
+ dd if=/dev/urandom of=$md0 bs=1024 count=$size
+ > /tmp/NewRand
+ $dir/test_stripe save /tmp/NewRand $disks $[chunk*1024] 5 $nlayout 0 $[size*1024] $devs
+ cmp -s -n $[size*1024] $md0 /tmp/NewRand || { echo cmp failed ; exit 2; }
+ $mdadm -S $md0
+ done
+ done
+done
+exit 0
+