]> git.ipfire.org Git - thirdparty/mdadm.git/blob - tests/07testreshape5
Create: support --readonly flag.
[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 level in 5 6
9 do
10 for chunk in 4 8 16 32 64 128
11 do
12 devs="$dev1"
13 for disks in 2 3 4 5 6
14 do
15 eval devs=\"$devs \$dev$disks\"
16 if [ " $level $disks" = " 6 3" -o " $level $disks" = " 6 2" ]
17 then continue
18 fi
19 for nlayout in 0 1 2 3
20 do
21 layout=${layouts[$nlayout]}
22
23 size=$[chunk*(disks-(level-4))*disks]
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
27 $dir/test_stripe restore /tmp/RandFile $disks $[chunk*1024] $level $nlayout 0 $[size*1024] $devs
28 mdadm -CR -e 1.0 $md0 -amd -l$level -n$disks --assume-clean -c $chunk -p $layout $devs
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
35 blockdev --flushbufs $md0 $devs; sync
36 > /tmp/NewRand
37 $dir/test_stripe save /tmp/NewRand $disks $[chunk*1024] $level $nlayout 0 $[size*1024] $devs
38 cmp -s -n $[size*1024] $md0 /tmp/NewRand || { echo cmp failed ; exit 2; }
39 mdadm -S $md0
40 udevadm settle
41 done
42 done
43 done
44 done
45 exit 0
46