]> git.ipfire.org Git - thirdparty/mdadm.git/blame_incremental - tests/07layouts
ddf: implement remove_from_super
[thirdparty/mdadm.git] / tests / 07layouts
... / ...
CommitLineData
1
2# check that kernel an restripe interpret all the different layouts
3# the same
4# This involves changing the layout to each different possibility
5# while MDADM_GROW_VERIFY is set.
6
7testK=$[64*3*6]
8dd if=/dev/urandom of=/tmp/RandFile bs=1024 count=$testK
9export MDADM_GROW_VERITY=1
10
11
12dotest() {
13 sleep 0.5
14 check wait
15 testdev $md0 $1 $mdsize1 512 nd
16 blockdev --flushbufs $md0
17 cmp -s -n $[textK*1024] $md0 /tmp/RandFile || { echo cmp failed; exit 2; }
18 # write something new - shift chars 4 space
19 tr ' -~' '$-~ -#' < /tmp/RandFile > /tmp/RandFile2
20 mv /tmp/RandFile2 /tmp/RandFile
21 dd if=/tmp/RandFile of=$md0
22}
23
24checkgeo() {
25 # check the geometry of an array
26 # level raid_disks chunk_size layout
27 dev=$1
28 shift
29 sleep 0.5
30 check wait
31 for attr in level raid_disks chunk_size layout
32 do
33 if [ $# -gt 0 ] ; then
34 val=$1
35 shift
36 if [ " `sed 's/ .*//' /sys/block/$dev/md/$attr`" != " $val" ]
37 then echo "$attr doesn't match for $dev"
38 exit 1
39 fi
40 fi
41 done
42}
43
44
45bu=/tmp/md-test-backup
46rm -f $bu
47
48# first a degraded 5 device raid5
49mdadm -CR $md0 -l5 -n5 $dev0 $dev1 missing $dev2 $dev3
50dd if=/tmp/RandFile of=$md0
51dotest 4
52
53l5[0]=la
54l5[1]=ra
55l5[2]=ls
56l5[3]=rs
57l5[4]=parity-first
58l5[5]=parity-last
59for layout in 0 1 2 3 4 5 0
60do
61 mdadm -G $md0 --layout=${l5[$layout]} --backup-file $bu
62 checkgeo md0 raid5 5 $[512*1024] $layout
63 dotest 4
64done
65
66mdadm -S $md0
67# now a doubly degraded raid6
68mdadm -CR $md0 -l6 -n5 $dev0 missing $dev2 missing $dev4
69dd if=/tmp/RandFile of=$md0
70dotest 3
71
72l6[0]=la
73l6[1]=ra
74l6[2]=ls
75l6[3]=rs
76l6[4]=parity-first
77l6[5]=parity-last
78l6[8]=ddf-zero-restart
79l6[9]=ddf-N-restart
80l6[10]=ddf-N-continue
81l6[16]=left-asymmetric-6
82l6[17]=right-asymmetric-6
83l6[18]=left-symmetric-6
84l6[19]=right-symmetric-6
85l6[20]=parity-first-6
86for layout in 0 1 2 3 4 5 8 9 10 16 17 18 19 20 0
87do
88 mdadm -G $md0 --layout=${l6[$layout]} --backup-file $bu
89 checkgeo md0 raid6 5 $[512*1024] $layout
90 dotest 3
91done