]> git.ipfire.org Git - thirdparty/mdadm.git/blob - tests/07testreshape5
Initial reshape support
[thirdparty/mdadm.git] / tests / 07testreshape5
1
2 #
3 # test the reshape code by using test_reshape and the
4 # kernel md code to move data into and out of variously
5 # shaped md arrays.
6 set -x
7 layouts=(la ra ls rs)
8 for chunk in 4 8 16 32 64 128
9 do
10 devs="$dev1"
11 for disks in 2 3 4 5 6
12 do
13 eval devs=\"$devs \$dev$disks\"
14 for nlayout in 0 1 2 3
15 do
16 layout=${layouts[$nlayout]}
17
18 size=$[chunk*(disks-1)*disks]
19
20 # test restore: make a raid5 from a file, then do a compare
21 dd if=/dev/urandom of=/tmp/RandFile bs=1024 count=$size
22 $dir/test_stripe restore /tmp/RandFile $disks $[chunk*1024] 5 $nlayout 0 $[size*1024] $devs
23 $mdadm -CR $md0 -amd -l5 -n$disks --assume-clean -c $chunk -p $layout $devs
24 cmp -s -n $[size*1024] $md0 /tmp/RandFile || { echo cmp failed ; exit 2; }
25
26 # FIXME check parity
27
28 # test save
29 dd if=/dev/urandom of=$md0 bs=1024 count=$size
30 > /tmp/NewRand
31 $dir/test_stripe save /tmp/NewRand $disks $[chunk*1024] 5 $nlayout 0 $[size*1024] $devs
32 cmp -s -n $[size*1024] $md0 /tmp/NewRand || { echo cmp failed ; exit 2; }
33 $mdadm -S $md0
34 done
35 done
36 done
37 exit 0
38