]> git.ipfire.org Git - thirdparty/mdadm.git/blob - tests/01raid6integ
Remove lots of unnecessary white space.
[thirdparty/mdadm.git] / tests / 01raid6integ
1
2 # Check integrity of raid6 in degraded modes
3 # Create a 5 disk raid6, dump some data to it, then
4 # sha1sum it with different pairs of devices failed
5
6 if [ "$INTEGRITY" != "yes" ]; then
7 echo -ne 'skipping... '
8 exit 0
9 fi
10
11 layouts='ls rs la ra'
12 lv=`uname -r`
13 if expr $lv '>=' 2.6.30 > /dev/null
14 then
15 layouts="$layouts parity-first ddf-zero-restart ddf-N-restart ddf-N-continue \
16 left-asymmetric-6 right-asymmetric-6 left-symmetric-6 right-symmetric-6 parity-first-6"
17 fi
18
19 for layout in $layouts
20 do
21 mdadm -CR $md0 -l6 --layout $layout -n5 $dev0 $dev1 $dev2 $dev3 $dev4
22 check wait
23 tar cf - /etc > $md0
24 sum=`sha1sum $md0`
25
26 totest=
27 for second in $dev0 $dev1 $dev2 $dev3 $dev4
28 do
29 mdadm $md0 -f $second
30 mdadm $md0 -r $second
31 blockdev --flushbufs $md0
32 sum1=`sha1sum $md0`
33 if [ "$sum" != "$sum1" ]
34 then
35 echo $sum does not match $sum1 with $second missing
36 exit 1
37 fi
38 for first in $totest
39 do
40 mdadm $md0 -f $first
41 mdadm $md0 -r $first
42 blockdev --flushbufs $md0
43 sum1=`sha1sum $md0`
44 if [ "$sum" != "$sum1" ]
45 then
46 echo $sum does not match $sum1 with $first and $second missing
47 exit 1
48 fi
49 mdadm $md0 -a $first
50 check wait
51 done
52 mdadm $md0 -a $second
53 check wait
54 totest="$totest $second"
55 done
56 mdadm -S $md0
57 done