]> git.ipfire.org Git - thirdparty/mdadm.git/blame - tests/07testreshape5
Remove lots of unnecessary white space.
[thirdparty/mdadm.git] / tests / 07testreshape5
CommitLineData
e86c9dd6
NB
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.
6set -x
7layouts=(la ra ls rs)
249887eb
N
8for level in 5 6
9do
e86c9dd6
NB
10for chunk in 4 8 16 32 64 128
11do
12 devs="$dev1"
13 for disks in 2 3 4 5 6
14 do
15 eval devs=\"$devs \$dev$disks\"
249887eb
N
16 if [ " $level $disks" = " 6 3" -o " $level $disks" = " 6 2" ]
17 then continue
18 fi
e86c9dd6
NB
19 for nlayout in 0 1 2 3
20 do
21 layout=${layouts[$nlayout]}
22
249887eb 23 size=$[chunk*(disks-(level-4))*disks]
e86c9dd6
NB
24
25 # test restore: make a raid5 from a file, then do a compare
26 dd if=/dev/urandom of=/tmp/RandFile bs=1024 count=$size
249887eb 27 $dir/test_stripe restore /tmp/RandFile $disks $[chunk*1024] $level $nlayout 0 $[size*1024] $devs
7d5c3964 28 mdadm -CR -e 1.0 $md0 -amd -l$level -n$disks --assume-clean -c $chunk -p $layout $devs
e86c9dd6
NB
29 cmp -s -n $[size*1024] $md0 /tmp/RandFile || { echo cmp failed ; exit 2; }
30
31 # FIXME check parity
32
33 # test save
34 dd if=/dev/urandom of=$md0 bs=1024 count=$size
249887eb 35 blockdev --flushbufs $md0 $devs; sync
e86c9dd6 36 > /tmp/NewRand
249887eb 37 $dir/test_stripe save /tmp/NewRand $disks $[chunk*1024] $level $nlayout 0 $[size*1024] $devs
e86c9dd6 38 cmp -s -n $[size*1024] $md0 /tmp/NewRand || { echo cmp failed ; exit 2; }
bfd8831d 39 mdadm -S $md0
249887eb 40 udevadm settle
e86c9dd6
NB
41 done
42 done
43done
249887eb 44done
e86c9dd6 45exit 0