PERFORCE change 123427 for review

Ulf Lilleengen lulf at FreeBSD.org
Fri Jul 13 08:29:14 UTC 2007


http://perforce.freebsd.org/chv.cgi?CH=123427

Change 123427 by lulf at lulf_carrot on 2007/07/13 08:28:46

	- Finish first testscript

Affected files ...

.. //depot/projects/soc2007/lulf/testscripts/test_raid5.sh#2 edit

Differences ...

==== //depot/projects/soc2007/lulf/testscripts/test_raid5.sh#2 (text+ko) ====

@@ -14,9 +14,9 @@
 	echo "drive d3 device ${DEV3}" >> ${TMPFILE};
 	echo "volume test" >> ${TMPFILE};
 	echo "plex org raid5 493k" >> ${TMPFILE};
-	echo "sd drive d1 len 2m" >> ${TMPFILE};
-	echo "sd drive d2 len 2m" >> ${TMPFILE};
-	echo "sd drive d3 len 2m" >> ${TMPFILE};
+	echo "sd drive d1 len 8m" >> ${TMPFILE};
+	echo "sd drive d2 len 8m" >> ${TMPFILE};
+	echo "sd drive d3 len 8m" >> ${TMPFILE};
 	echo "Creating configuration...";
 	gvinum create $TMPFILE;
 	echo "... Done:";
@@ -25,18 +25,18 @@
 function raid5_init {
 	echo "Initializing volume..."
 	gvinum start test
-	sleep 4
+	sleep 8
 	echo "... Done"
 }
 
 echo "1. Data initialization"
 create_raid5_config
 raid5_init
-`dd if=/dev/zero of=zerofile bs=512 count=4196 > /dev/null 2> /dev/null`
+`dd if=/dev/zero of=zerofile bs=512 count=8192 > /dev/null 2> /dev/null`
 
 # XXX: Bit of a hack, but we don't have any way to tell that it's up.
 echo "Reading volume..."
-`dd if=/dev/gvinum/test of=testfile bs=512 count=4196 > /dev/null 2> /dev/null`
+`dd if=/dev/gvinum/test of=testfile bs=512 count=8192 > /dev/null 2> /dev/null`
 echo "... Done"
 echo "Comparing with correct initalized data"
 RESULT=`diff testfile zerofile`
@@ -50,19 +50,20 @@
 echo "Done"
 gvinum resetconfig
 ## XXX: Input NO FUTURE
+sleep 2
 
 
 # Test 2 Data consistency
 echo "2. Data consistency"
 echo "Generating testdata"
-dd if=/dev/random of=testdata bs=512 count=4196 > /dev/null &> /dev/null
+dd if=/dev/random of=testdata bs=512 count=8192 > /dev/null &> /dev/null
 create_raid5_config
 raid5_init
 gvinum setstate -f stale test.p0.s0
 echo "Writing testdata to degraded volume"
-dd if=testdata of=/dev/gvinum/test bs=512 count=4196 > /dev/null &> /dev/null
+dd if=testdata of=/dev/gvinum/test bs=512 count=8192 > /dev/null &> /dev/null
 echo "Reading back data from degraded volume"
-dd if=/dev/gvinum/test of=testout1 bs=512 count=4196 > /dev/null &> /dev/null
+dd if=/dev/gvinum/test of=testout1 bs=512 count=8192 > /dev/null &> /dev/null
 echo "Comparing"
 RESULT=`diff testdata testout1`
 if [ "$RESULT" == "" ]; then
@@ -74,9 +75,9 @@
 
 echo "Starting rebuild"
 gvinum start test
-sleep 10
+sleep 15
 echo "Reading back data from rebuilt volume"
-dd if=/dev/gvinum/test of=testout2 bs=512 count=4196 > /dev/null &> /dev/null
+dd if=/dev/gvinum/test of=testout2 bs=512 count=8192 > /dev/null &> /dev/null
 echo "Comparing"
 RESULT=`diff testdata testout2`
 if [ "$RESULT" == "" ]; then
@@ -88,7 +89,7 @@
 echo "Setting another subdisk stale" 
 gvinum setstate -f stale test.p0.s1
 echo "Reading back data from degraded volume"
-dd if=/dev/gvinum/test of=testout3 bs=512 count=4196 > /dev/null &> /dev/null
+dd if=/dev/gvinum/test of=testout3 bs=512 count=8192 > /dev/null &> /dev/null
 echo "Comparing"
 RESULT=`diff testdata testout3`
 if [ "$RESULT" == "" ]; then
@@ -97,6 +98,35 @@
 	echo "Fail: degraded read is not correct!"
 	((NUMFAILED += 1))
 fi
+gvinum resetconfig
+sleep 2
+
+# Test online RAID-5 rebuild.
+echo "3. Online RAID-5 rebuild"
+echo "Generating testdata"
+dd if=/dev/random of=testdata bs=512 count=8192 > /dev/null &> /dev/null
+create_raid5_config
+raid5_init
+gvinum setstate -f stale test.p0.s0
+echo "Start writing testdata to degraded volume"
+dd if=testdata of=/dev/gvinum/test bs=512 count=8192 > /dev/null &> /dev/null &
+sleep 1
+echo "Start rebuild of volume"
+gvinum start test
+echo "Wait for 20 seconds"
+sleep 20
+echo "Reading back data from rebuilt volume"
+dd if=/dev/gvinum/test of=testout4 bs=512 count=8192 > /dev/null &> /dev/null
+echo "Comparing"
+RESULT=`diff testdata testout4`
+if [ "$RESULT" == "" ]; then
+	echo "Pass: online-written data is consistent!"
+else
+	echo "Fail: online-written data is inconsistent!"
+	echo $RESULT
+	((NUMFAILED += 1))
+fi
+gvinum resetconfig
 
 echo "Cleaning up"
 rm zerofile


More information about the p4-projects mailing list