4 # create a raid1 with a bitmap file
8 mdadm --create --run $md0 --level=1 -n2 --delay=1 --bitmap $bmf $dev1 $dev2
10 testdev $md0 1 $mdsize0 1
13 mdadm --assemble $md0 --bitmap=$bmf $dev1 $dev2
14 testdev $md0 1 $mdsize0 1
15 dirty1=`mdadm -X $bmf | sed -n -e 's/.*Bitmap.* \([0-9]*\) dirty.*/\1/p'`
17 dirty2=`mdadm -X $bmf | sed -n -e 's/.*Bitmap.* \([0-9]*\) dirty.*/\1/p'`
19 if [ $dirty1 -lt 400 -o $dirty2 -ne 0 ]
20 then echo >&2 "ERROR bad 'dirty' counts: $dirty1 and $dirty2"
24 testdev $md0 1 $mdsize0 1
26 dirty3=`mdadm -X $bmf | sed -n -e 's/.*Bitmap.* \([0-9]*\) dirty.*/\1/p'`
27 if [ $dirty3 -lt 400 ]
29 echo >&2 "ERROR dirty count $dirty3 is too small"
35 mdadm --assemble -R $md0 --bitmap=$bmf $dev2
36 mdadm $md0 --add $dev1
39 dirty4=`mdadm -X $bmf | sed -n -e 's/.*Bitmap.* \([0-9]*\) dirty.*/\1/p'`
42 dirty5=`mdadm -X $bmf | sed -n -e 's/.*Bitmap.* \([0-9]*\) dirty.*/\1/p'`
44 if [ $dirty4 -lt 400 -o $dirty5 -ne 0 ]
45 then echo echo >&2 "ERROR bad 'dirty' counts at end: $dirty4 $dirty5"