diff --git a/tools/regression/geom_raid3/Makefile b/tools/regression/geom_raid3/Makefile deleted file mode 100644 index 9eb76c66ffaa..000000000000 --- a/tools/regression/geom_raid3/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -# -# $FreeBSD$ -# -# Regression tests for geom_raid3. -# - -test: - @sh runtests.sh diff --git a/tools/regression/geom_raid3/conf.sh b/tools/regression/geom_raid3/conf.sh new file mode 100644 index 000000000000..93e7deaf1c73 --- /dev/null +++ b/tools/regression/geom_raid3/conf.sh @@ -0,0 +1,8 @@ +#!/bin/sh +# $FreeBSD$ + +name="test" +class="raid3" +base=`basename $0` + +. `dirname $0`/../geom_subr.sh diff --git a/tools/regression/geom_raid3/runtests.sh b/tools/regression/geom_raid3/runtests.sh deleted file mode 100644 index b22c1ff924be..000000000000 --- a/tools/regression/geom_raid3/runtests.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -dir=`dirname $0` - -graid3 load >/dev/null 2>&1 -for ts in `dirname $0`/test-*.sh; do - sh $ts -done -graid3 unload diff --git a/tools/regression/geom_raid3/test-1.sh b/tools/regression/geom_raid3/test-1.t similarity index 74% rename from tools/regression/geom_raid3/test-1.sh rename to tools/regression/geom_raid3/test-1.t index 1de5420ac400..920296788474 100644 --- a/tools/regression/geom_raid3/test-1.sh +++ b/tools/regression/geom_raid3/test-1.t @@ -1,8 +1,10 @@ #!/bin/sh # $FreeBSD$ -name="test" -base=`basename $0` +. `dirname $0`/conf.sh + +echo "1..2" + us0=45 us1=`expr $us0 + 1` us2=`expr $us0 + 2` @@ -11,21 +13,22 @@ mdconfig -a -t malloc -s 1M -u $us0 || exit 1 mdconfig -a -t malloc -s 2M -u $us1 || exit 1 mdconfig -a -t malloc -s 3M -u $us2 || exit 1 -graid3 label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +graid3 label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} 2>/dev/null || exit 1 +devwait # Size of created device should be 2MB - 1024B. mediasize=`diskinfo /dev/raid3/${name} | awk '{print $3}'` if [ $mediasize -eq 2096128 ]; then - echo "PASS" + echo "ok 1" else - echo "FAIL" + echo "not ok 1" fi sectorsize=`diskinfo /dev/raid3/${name} | awk '{print $2}'` if [ $sectorsize -eq 1024 ]; then - echo "PASS" + echo "ok 2" else - echo "FAIL" + echo "not ok 2" fi graid3 stop $name diff --git a/tools/regression/geom_raid3/test-10.sh b/tools/regression/geom_raid3/test-10.t similarity index 92% rename from tools/regression/geom_raid3/test-10.sh rename to tools/regression/geom_raid3/test-10.t index 2265aa622781..132012000604 100644 --- a/tools/regression/geom_raid3/test-10.sh +++ b/tools/regression/geom_raid3/test-10.t @@ -1,8 +1,10 @@ #!/bin/sh # $FreeBSD$ -name="test" -base=`basename $0` +. `dirname $0`/conf.sh + +echo "1..1" + us0=45 us1=`expr $us0 + 1` us2=`expr $us0 + 2` @@ -19,14 +21,15 @@ mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 graid3 label -r $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +devwait dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 dd if=/dev/raid3/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "FAIL" + echo "not ok 1" else - echo "PASS" + echo "ok 1" fi graid3 stop $name diff --git a/tools/regression/geom_raid3/test-11.sh b/tools/regression/geom_raid3/test-11.t similarity index 92% rename from tools/regression/geom_raid3/test-11.sh rename to tools/regression/geom_raid3/test-11.t index c91ae73985ab..3382214b8e89 100644 --- a/tools/regression/geom_raid3/test-11.sh +++ b/tools/regression/geom_raid3/test-11.t @@ -1,8 +1,10 @@ #!/bin/sh # $FreeBSD$ -name="test" -base=`basename $0` +. `dirname $0`/conf.sh + +echo "1..1" + us0=45 us1=`expr $us0 + 1` us2=`expr $us0 + 2` @@ -19,14 +21,15 @@ mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 graid3 label -w $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +devwait dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 dd if=/dev/raid3/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "FAIL" + echo "not ok 1" else - echo "PASS" + echo "ok 1" fi graid3 stop $name diff --git a/tools/regression/geom_raid3/test-12.sh b/tools/regression/geom_raid3/test-12.t similarity index 93% rename from tools/regression/geom_raid3/test-12.sh rename to tools/regression/geom_raid3/test-12.t index e9530ef5a122..3dec406f8097 100644 --- a/tools/regression/geom_raid3/test-12.sh +++ b/tools/regression/geom_raid3/test-12.t @@ -1,8 +1,10 @@ #!/bin/sh # $FreeBSD$ -name="test" -base=`basename $0` +. `dirname $0`/conf.sh + +echo "1..1" + us0=45 us1=`expr $us0 + 1` us2=`expr $us0 + 2` @@ -19,6 +21,7 @@ dd if=/dev/random of=/dev/md${us1} count=$nblocks1 >/dev/null 2>&1 dd if=/dev/random of=/dev/md${us2} count=$nblocks1 >/dev/null 2>&1 graid3 label -w $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +devwait # Wait for synchronization. sleep 2 graid3 stop $name @@ -32,9 +35,9 @@ sleep 1 dd if=/dev/raid3/${name} of=/dev/null bs=1k count=$nblocks3 >/dev/null 2>&1 ec=$? if [ $ec -eq 0 ]; then - echo "FAIL" + echo "not ok 1" else - echo "PASS" + echo "ok 1" fi graid3 stop $name diff --git a/tools/regression/geom_raid3/test-2.sh b/tools/regression/geom_raid3/test-2.t similarity index 92% rename from tools/regression/geom_raid3/test-2.sh rename to tools/regression/geom_raid3/test-2.t index 49a7de006529..88daf782492c 100644 --- a/tools/regression/geom_raid3/test-2.sh +++ b/tools/regression/geom_raid3/test-2.t @@ -1,8 +1,10 @@ #!/bin/sh # $FreeBSD$ -name="test" -base=`basename $0` +. `dirname $0`/conf.sh + +echo "1..1" + us0=45 us1=`expr $us0 + 1` us2=`expr $us0 + 2` @@ -19,14 +21,15 @@ mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 graid3 label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +devwait dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 dd if=/dev/raid3/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "FAIL" + echo "not ok 1" else - echo "PASS" + echo "ok 1" fi graid3 stop $name diff --git a/tools/regression/geom_raid3/test-3.sh b/tools/regression/geom_raid3/test-3.t similarity index 92% rename from tools/regression/geom_raid3/test-3.sh rename to tools/regression/geom_raid3/test-3.t index d6765903b9d8..d2c1a5f006b1 100644 --- a/tools/regression/geom_raid3/test-3.sh +++ b/tools/regression/geom_raid3/test-3.t @@ -1,8 +1,10 @@ #!/bin/sh # $FreeBSD$ -name="test" -base=`basename $0` +. `dirname $0`/conf.sh + +echo "1..1" + us0=45 us1=`expr $us0 + 1` us2=`expr $us0 + 2` @@ -19,6 +21,7 @@ mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 graid3 label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +devwait dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 @@ -28,9 +31,9 @@ dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 graid3 remove -n 1 $name dd if=/dev/raid3/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "FAIL" + echo "not ok 1" else - echo "PASS" + echo "ok 1" fi graid3 stop $name diff --git a/tools/regression/geom_raid3/test-4.sh b/tools/regression/geom_raid3/test-4.t similarity index 92% rename from tools/regression/geom_raid3/test-4.sh rename to tools/regression/geom_raid3/test-4.t index 19eed35a7bae..d437ec05246a 100644 --- a/tools/regression/geom_raid3/test-4.sh +++ b/tools/regression/geom_raid3/test-4.t @@ -1,8 +1,10 @@ #!/bin/sh # $FreeBSD$ -name="test" -base=`basename $0` +. `dirname $0`/conf.sh + +echo "1..1" + us0=45 us1=`expr $us0 + 1` us2=`expr $us0 + 2` @@ -19,6 +21,7 @@ mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 graid3 label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +devwait # # Writing without one DATA component. @@ -28,9 +31,9 @@ dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 dd if=/dev/raid3/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "FAIL" + echo "not ok 1" else - echo "PASS" + echo "ok 1" fi graid3 stop $name diff --git a/tools/regression/geom_raid3/test-5.sh b/tools/regression/geom_raid3/test-5.t similarity index 92% rename from tools/regression/geom_raid3/test-5.sh rename to tools/regression/geom_raid3/test-5.t index 5de21960debe..ffd85f6f15ff 100644 --- a/tools/regression/geom_raid3/test-5.sh +++ b/tools/regression/geom_raid3/test-5.t @@ -1,8 +1,10 @@ #!/bin/sh # $FreeBSD$ -name="test" -base=`basename $0` +. `dirname $0`/conf.sh + +echo "1..1" + us0=45 us1=`expr $us0 + 1` us2=`expr $us0 + 2` @@ -19,6 +21,7 @@ mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 graid3 label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +devwait # # Writing without PARITY component. @@ -28,9 +31,9 @@ dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 dd if=/dev/raid3/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "FAIL" + echo "not ok 1" else - echo "PASS" + echo "ok 1" fi graid3 stop $name diff --git a/tools/regression/geom_raid3/test-6.sh b/tools/regression/geom_raid3/test-6.t similarity index 93% rename from tools/regression/geom_raid3/test-6.sh rename to tools/regression/geom_raid3/test-6.t index 778f38fd58a6..97b55036d73a 100644 --- a/tools/regression/geom_raid3/test-6.sh +++ b/tools/regression/geom_raid3/test-6.t @@ -1,8 +1,10 @@ #!/bin/sh # $FreeBSD$ -name="test" -base=`basename $0` +. `dirname $0`/conf.sh + +echo "1..1" + us0=45 us1=`expr $us0 + 1` us2=`expr $us0 + 2` @@ -19,6 +21,7 @@ mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 graid3 label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +devwait dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 @@ -32,9 +35,9 @@ sleep 1 dd if=/dev/raid3/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "FAIL" + echo "not ok 1" else - echo "PASS" + echo "ok 1" fi graid3 stop $name diff --git a/tools/regression/geom_raid3/test-7.sh b/tools/regression/geom_raid3/test-7.t similarity index 94% rename from tools/regression/geom_raid3/test-7.sh rename to tools/regression/geom_raid3/test-7.t index b39de20da437..3d89873f8e25 100644 --- a/tools/regression/geom_raid3/test-7.sh +++ b/tools/regression/geom_raid3/test-7.t @@ -1,8 +1,10 @@ #!/bin/sh # $FreeBSD$ -name="test" -base=`basename $0` +. `dirname $0`/conf.sh + +echo "1..1" + us0=45 us1=`expr $us0 + 1` us2=`expr $us0 + 2` @@ -19,6 +21,7 @@ mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 graid3 label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +devwait dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 @@ -35,9 +38,9 @@ dd if=/dev/zero of=/dev/md${us1} bs=512 count=`expr $nblocks1 + 1` >/dev/null 2> dd if=/dev/raid3/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "FAIL" + echo "not ok 1" else - echo "PASS" + echo "ok 1" fi graid3 stop $name diff --git a/tools/regression/geom_raid3/test-8.sh b/tools/regression/geom_raid3/test-8.t similarity index 93% rename from tools/regression/geom_raid3/test-8.sh rename to tools/regression/geom_raid3/test-8.t index ea319686418b..b9621f43ef90 100644 --- a/tools/regression/geom_raid3/test-8.sh +++ b/tools/regression/geom_raid3/test-8.t @@ -1,8 +1,10 @@ #!/bin/sh # $FreeBSD$ -name="test" -base=`basename $0` +. `dirname $0`/conf.sh + +echo "1..1" + us0=45 us1=`expr $us0 + 1` us2=`expr $us0 + 2` @@ -19,6 +21,7 @@ mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 graid3 label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +devwait # # Writing without DATA component and rebuild of DATA component. @@ -31,9 +34,9 @@ sleep 1 dd if=/dev/raid3/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "FAIL" + echo "not ok 1" else - echo "PASS" + echo "ok 1" fi graid3 stop $name diff --git a/tools/regression/geom_raid3/test-9.sh b/tools/regression/geom_raid3/test-9.t similarity index 94% rename from tools/regression/geom_raid3/test-9.sh rename to tools/regression/geom_raid3/test-9.t index eeb5429956ce..069501161dce 100644 --- a/tools/regression/geom_raid3/test-9.sh +++ b/tools/regression/geom_raid3/test-9.t @@ -1,8 +1,10 @@ #!/bin/sh # $FreeBSD$ -name="test" -base=`basename $0` +. `dirname $0`/conf.sh + +echo "1..1" + us0=45 us1=`expr $us0 + 1` us2=`expr $us0 + 2` @@ -19,6 +21,7 @@ mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 graid3 label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +devwait # # Writing without PARITY component and rebuild of PARITY component. @@ -34,9 +37,9 @@ dd if=/dev/zero of=/dev/md${us1} bs=512 count=`expr $nblocks1 + 1` >/dev/null 2> dd if=/dev/raid3/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then - echo "FAIL" + echo "not ok 1" else - echo "PASS" + echo "ok 1" fi graid3 stop $name