]> git.ipfire.org Git - thirdparty/mdadm.git/blame_incremental - tests/05r1-n3-bitmapfile
Initial reshape support
[thirdparty/mdadm.git] / tests / 05r1-n3-bitmapfile
... / ...
CommitLineData
1
2#
3# create a raid1 with 3 devices and a bitmap file
4# make sure resync does right thing.
5#
6#
7bmf=$targetdir/bitmap
8rm -f $bmf
9mdadm --create --run $md0 --level=1 -n3 --delay=1 --bitmap $bmf $dev1 $dev2 $dev3
10check wait
11testdev $md0 1 $mdsize0 1
12mdadm -S $md0
13
14mdadm --assemble $md0 --bitmap=$bmf $dev1 $dev2 $dev3
15testdev $md0 1 $mdsize0 1
16dirty1=`mdadm -X $bmf | sed -n -e 's/.*Bitmap.* \([0-9]*\) dirty.*/\1/p'`
17sleep 4
18dirty2=`mdadm -X $bmf | sed -n -e 's/.*Bitmap.* \([0-9]*\) dirty.*/\1/p'`
19
20if [ $dirty1 -lt 400 -o $dirty2 -ne 0 ]
21then echo >&2 "ERROR bad 'dirty' counts: $dirty1 and $dirty2"
22 exit 1
23fi
24mdadm $md0 -f $dev2
25testdev $md0 1 $mdsize0 1
26sleep 4
27dirty3=`mdadm -X $bmf | sed -n -e 's/.*Bitmap.* \([0-9]*\) dirty.*/\1/p'`
28if [ $dirty3 -lt 400 ]
29then
30 echo >&2 "ERROR dirty count $dirty3 is too small"
31 exit 2
32fi
33
34mdadm -S $md0
35
36mdadm --assemble -R $md0 --bitmap=$bmf $dev1 $dev3
37check nosync
38mdadm $md0 --add $dev2
39check recovery
40
41dirty4=`mdadm -X $bmf | sed -n -e 's/.*Bitmap.* \([0-9]*\) dirty.*/\1/p'`
42check wait
43sleep 4
44dirty5=`mdadm -X $bmf | sed -n -e 's/.*Bitmap.* \([0-9]*\) dirty.*/\1/p'`
45
46if [ $dirty4 -lt 400 -o $dirty5 -ne 0 ]
47then echo echo >&2 "ERROR bad 'dirty' counts at end: $dirty4 $dirty5"
48 exit 1
49fi
50
51mdadm -S $md0
52exit 0