diff options
author | Neil Brown <neilb@suse.de> | 2005-09-12 07:24:10 +0200 |
---|---|---|
committer | Neil Brown <neilb@suse.de> | 2005-09-12 07:24:10 +0200 |
commit | f6d75de8e0106a3789ed1a3aada306d197531e47 (patch) | |
tree | 9c6941767308f8fcb13f179f99eafbb38be73cf4 /tests | |
parent | Fix assembling of array with spares when verion-1 superblock is used. (diff) | |
download | mdadm-f6d75de8e0106a3789ed1a3aada306d197531e47.tar.xz mdadm-f6d75de8e0106a3789ed1a3aada306d197531e47.zip |
Fix remaining problems with hot-add bitmap to version-1 superblock
Also some more tests - r5 and r6 bitmaps
Signed-off-by: Neil Brown <neilb@suse.de>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/00linear | 2 | ||||
-rw-r--r-- | tests/00raid0 | 4 | ||||
-rw-r--r-- | tests/00raid1 | 2 | ||||
-rw-r--r-- | tests/00raid4 | 2 | ||||
-rw-r--r-- | tests/00raid5 | 4 | ||||
-rw-r--r-- | tests/00raid6 | 2 | ||||
-rw-r--r-- | tests/05r5-bitmapfile | 48 | ||||
-rw-r--r-- | tests/05r5-internalbitmap | 46 | ||||
-rw-r--r-- | tests/05r6-bitmapfile | 48 |
9 files changed, 150 insertions, 8 deletions
diff --git a/tests/00linear b/tests/00linear index 6f08ba0c..ec6a1667 100644 --- a/tests/00linear +++ b/tests/00linear @@ -6,7 +6,7 @@ check linear testdev $md0 3 $mdsize0 64 mdadm -S $md0 -# now with verion-1 superblock +# now with version-1 superblock mdadm -CR $md0 -e1 --level=linear -n4 $dev0 $dev1 $dev2 $dev3 check linear testdev $md0 4 $mdsize1 64 diff --git a/tests/00raid0 b/tests/00raid0 index 07437c08..f5122ec6 100644 --- a/tests/00raid0 +++ b/tests/00raid0 @@ -6,7 +6,7 @@ check raid0 testdev $md0 3 $mdsize0 64 mdadm -S $md0 -# now with verion-1 superblock +# now with version-1 superblock mdadm -CR $md0 -e1 -l0 -n4 $dev0 $dev1 $dev2 $dev3 check raid0 testdev $md0 4 $mdsize1 64 @@ -27,7 +27,7 @@ do testdev $md0 3 $mdsize0 $chunk mdadm -S $md0 - # now with verion-1 superblock + # now with version-1 superblock mdadm -CR $md0 -e1 -l0 -c $chunk -n4 $dev0 $dev1 $dev2 $dev3 check raid0 testdev $md0 4 $mdsize1 $chunk diff --git a/tests/00raid1 b/tests/00raid1 index af40da4c..b0dfa6a9 100644 --- a/tests/00raid1 +++ b/tests/00raid1 @@ -9,7 +9,7 @@ check raid1 testdev $md0 1 $mdsize0 1 mdadm -S $md0 -# now with verion-1 superblock, spare +# now with version-1 superblock, spare mdadm -CR $md0 -e1 --level=raid1 -n3 -x2 $dev0 missing missing $dev1 $dev2 check recovery check raid1 diff --git a/tests/00raid4 b/tests/00raid4 index a45668ab..46383873 100644 --- a/tests/00raid4 +++ b/tests/00raid4 @@ -6,7 +6,7 @@ check resync ; check raid5 testdev $md0 2 $mdsize0 64 mdadm -S $md0 -# now with verion-1 superblock +# now with version-1 superblock mdadm -CR $md0 -e1 --level=raid4 -n4 $dev0 $dev1 $dev2 $dev3 check resync; check raid5 testdev $md0 3 $mdsize1 64 diff --git a/tests/00raid5 b/tests/00raid5 index 7192ac53..71f36545 100644 --- a/tests/00raid5 +++ b/tests/00raid5 @@ -6,7 +6,7 @@ check resync testdev $md0 2 $mdsize0 64 mdadm -S $md0 -# now with verion-1 superblock +# now with version-1 superblock mdadm -CR $md0 -e1 --level=raid5 -n4 $dev0 $dev1 $dev2 $dev3 check recovery testdev $md0 3 $mdsize1 64 @@ -22,7 +22,7 @@ do testdev $md0 2 $mdsize0 64 mdadm -S $md0 - # now with verion-1 superblock + # now with version-1 superblock mdadm -CR $md0 -e1 --level=raid5 --layout $lo -n4 $dev0 $dev1 $dev2 $dev3 check recovery ; check raid5 testdev $md0 3 $mdsize1 64 diff --git a/tests/00raid6 b/tests/00raid6 index ba8c61cf..81834aae 100644 --- a/tests/00raid6 +++ b/tests/00raid6 @@ -6,7 +6,7 @@ check resync ; check raid6 testdev $md0 2 $mdsize0 64 mdadm -S $md0 -# now with verion-1 superblock +# now with version-1 superblock mdadm -CR $md0 -e1 --level=raid6 -n5 $dev0 $dev1 $dev2 $dev3 $dev4 check resync ; check raid6 testdev $md0 3 $mdsize1 64 diff --git a/tests/05r5-bitmapfile b/tests/05r5-bitmapfile new file mode 100644 index 00000000..25c12287 --- /dev/null +++ b/tests/05r5-bitmapfile @@ -0,0 +1,48 @@ + +# +# create a raid1 with a bitmap file +# +bmf=$targetdir/bitmap +rm -f $bmf +mdadm --create --run $md0 --level=5 -n3 --delay=1 --bitmap $bmf $dev1 $dev2 $dev3 +check wait +testdev $md0 2 $mdsize0 1 +mdadm -S $md0 + +mdadm --assemble $md0 --bitmap=$bmf $dev1 $dev2 $dev3 +testdev $md0 2 $mdsize0 1 +dirty1=`mdadm -X $bmf | sed -n -e 's/.*Bitmap.* \([0-9]*\) dirty.*/\1/p'` +sleep 4 +dirty2=`mdadm -X $bmf | sed -n -e 's/.*Bitmap.* \([0-9]*\) dirty.*/\1/p'` + +if [ $dirty1 -lt 400 -o $dirty2 -ne 0 ] +then echo >&2 "ERROR bad 'dirty' counts: $dirty1 and $dirty2" + exit 1 +fi +mdadm $md0 -f $dev1 +testdev $md0 2 $mdsize0 1 +sleep 4 +dirty3=`mdadm -X $bmf | sed -n -e 's/.*Bitmap.* \([0-9]*\) dirty.*/\1/p'` +if [ $dirty3 -lt 400 ] +then + echo >&2 "ERROR dirty count $dirty3 is too small" + exit 2 +fi + +mdadm -S $md0 + +mdadm --assemble -R $md0 --bitmap=$bmf $dev2 $dev3 +mdadm $md0 --add $dev1 +check recovery + +dirty4=`mdadm -X $bmf | sed -n -e 's/.*Bitmap.* \([0-9]*\) dirty.*/\1/p'` +check wait +sleep 4 +dirty5=`mdadm -X $bmf | sed -n -e 's/.*Bitmap.* \([0-9]*\) dirty.*/\1/p'` + +if [ $dirty4 -lt 400 -o $dirty5 -ne 0 ] +then echo echo >&2 "ERROR bad 'dirty' counts at end: $dirty4 $dirty5" + exit 1 +fi + +mdadm -S $md0 diff --git a/tests/05r5-internalbitmap b/tests/05r5-internalbitmap new file mode 100644 index 00000000..d79db909 --- /dev/null +++ b/tests/05r5-internalbitmap @@ -0,0 +1,46 @@ + +# +# create a raid1 with an internal bitmap +# +mdadm --create --run $md0 --level=5 -n3 --delay=1 --bitmap internal $dev1 $dev2 $dev3 +check wait +testdev $md0 2 $mdsize0 1 +mdadm -S $md0 + +mdadm --assemble $md0 $dev1 $dev2 $dev3 +testdev $md0 2 $mdsize0 1 +dirty1=`mdadm -X $dev2 | sed -n -e 's/.*Bitmap.* \([0-9]*\) dirty.*/\1/p'` +sleep 4 +dirty2=`mdadm -X $dev2 | sed -n -e 's/.*Bitmap.* \([0-9]*\) dirty.*/\1/p'` + +if [ $dirty1 -lt 400 -o $dirty2 -ne 0 ] +then echo >&2 "ERROR bad 'dirty' counts: $dirty1 and $dirty2" + exit 1 +fi +mdadm $md0 -f $dev1 +testdev $md0 2 $mdsize0 1 +sleep 4 +dirty3=`mdadm -X $dev2 | sed -n -e 's/.*Bitmap.* \([0-9]*\) dirty.*/\1/p'` +if [ $dirty3 -lt 400 ] +then + echo >&2 "ERROR dirty count $dirty3 is too small" + exit 2 +fi + +mdadm -S $md0 + +mdadm --assemble -R $md0 $dev2 $dev3 +mdadm $md0 --add $dev1 +check recovery + +dirty4=`mdadm -X $dev2 | sed -n -e 's/.*Bitmap.* \([0-9]*\) dirty.*/\1/p'` +check wait +sleep 4 +dirty5=`mdadm -X $dev2 | sed -n -e 's/.*Bitmap.* \([0-9]*\) dirty.*/\1/p'` + +if [ $dirty4 -lt 400 -o $dirty5 -ne 0 ] +then echo echo >&2 "ERROR bad 'dirty' counts at end: $dirty4 $dirty5" + exit 1 +fi + +mdadm -S $md0 diff --git a/tests/05r6-bitmapfile b/tests/05r6-bitmapfile new file mode 100644 index 00000000..865cedbb --- /dev/null +++ b/tests/05r6-bitmapfile @@ -0,0 +1,48 @@ + +# +# create a raid1 with a bitmap file +# +bmf=$targetdir/bitmap +rm -f $bmf +mdadm --create --run $md0 --level=6 -n4 --delay=1 --bitmap $bmf $dev1 $dev2 $dev3 $dev4 +check wait +testdev $md0 2 $mdsize0 1 +mdadm -S $md0 + +mdadm --assemble $md0 --bitmap=$bmf $dev1 $dev2 $dev3 $dev4 +testdev $md0 2 $mdsize0 1 +dirty1=`mdadm -X $bmf | sed -n -e 's/.*Bitmap.* \([0-9]*\) dirty.*/\1/p'` +sleep 4 +dirty2=`mdadm -X $bmf | sed -n -e 's/.*Bitmap.* \([0-9]*\) dirty.*/\1/p'` + +if [ $dirty1 -lt 400 -o $dirty2 -ne 0 ] +then echo >&2 "ERROR bad 'dirty' counts: $dirty1 and $dirty2" + exit 1 +fi +mdadm $md0 -f $dev3 +testdev $md0 2 $mdsize0 1 +sleep 4 +dirty3=`mdadm -X $bmf | sed -n -e 's/.*Bitmap.* \([0-9]*\) dirty.*/\1/p'` +if [ $dirty3 -lt 400 ] +then + echo >&2 "ERROR dirty count $dirty3 is too small" + exit 2 +fi + +mdadm -S $md0 + +mdadm --assemble -R $md0 --bitmap=$bmf $dev1 $dev2 $dev4 +mdadm $md0 --add $dev3 +check recovery + +dirty4=`mdadm -X $bmf | sed -n -e 's/.*Bitmap.* \([0-9]*\) dirty.*/\1/p'` +check wait +sleep 4 +dirty5=`mdadm -X $bmf | sed -n -e 's/.*Bitmap.* \([0-9]*\) dirty.*/\1/p'` + +if [ $dirty4 -lt 400 -o $dirty5 -ne 0 ] +then echo echo >&2 "ERROR bad 'dirty' counts at end: $dirty4 $dirty5" + exit 1 +fi + +mdadm -S $md0 |