summaryrefslogtreecommitdiffstats
path: root/tools/regression
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2005-12-07 01:28:59 +0000
committerpjd <pjd@FreeBSD.org>2005-12-07 01:28:59 +0000
commitef0831aea70602babedaa00fedcd6cfb669b307f (patch)
tree83f3adcca4a8b284481a6fb69ff62b202791f9a7 /tools/regression
parent970cb6f33aae948b2c2990bead31ab20c87991ce (diff)
downloadFreeBSD-src-ef0831aea70602babedaa00fedcd6cfb669b307f.zip
FreeBSD-src-ef0831aea70602babedaa00fedcd6cfb669b307f.tar.gz
Convert graid3(8) regression tests to the new framework.
Diffstat (limited to 'tools/regression')
-rw-r--r--tools/regression/geom_raid3/Makefile8
-rw-r--r--tools/regression/geom_raid3/conf.sh8
-rw-r--r--tools/regression/geom_raid3/runtests.sh10
-rw-r--r--tools/regression/geom_raid3/test-1.t (renamed from tools/regression/geom_raid3/test-1.sh)17
-rw-r--r--tools/regression/geom_raid3/test-10.t (renamed from tools/regression/geom_raid3/test-10.sh)11
-rw-r--r--tools/regression/geom_raid3/test-11.t (renamed from tools/regression/geom_raid3/test-11.sh)11
-rw-r--r--tools/regression/geom_raid3/test-12.t (renamed from tools/regression/geom_raid3/test-12.sh)11
-rw-r--r--tools/regression/geom_raid3/test-2.t (renamed from tools/regression/geom_raid3/test-2.sh)11
-rw-r--r--tools/regression/geom_raid3/test-3.t (renamed from tools/regression/geom_raid3/test-3.sh)11
-rw-r--r--tools/regression/geom_raid3/test-4.t (renamed from tools/regression/geom_raid3/test-4.sh)11
-rw-r--r--tools/regression/geom_raid3/test-5.t (renamed from tools/regression/geom_raid3/test-5.sh)11
-rw-r--r--tools/regression/geom_raid3/test-6.t (renamed from tools/regression/geom_raid3/test-6.sh)11
-rw-r--r--tools/regression/geom_raid3/test-7.t (renamed from tools/regression/geom_raid3/test-7.sh)11
-rw-r--r--tools/regression/geom_raid3/test-8.t (renamed from tools/regression/geom_raid3/test-8.sh)11
-rw-r--r--tools/regression/geom_raid3/test-9.t (renamed from tools/regression/geom_raid3/test-9.sh)11
15 files changed, 95 insertions, 69 deletions
diff --git a/tools/regression/geom_raid3/Makefile b/tools/regression/geom_raid3/Makefile
deleted file mode 100644
index 9eb76c6..0000000
--- 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 0000000..93e7dea
--- /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 b22c1ff..0000000
--- 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
index 1de5420..9202967 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
index 2265aa6..1320120 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
index c91ae73..3382214 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
index e9530ef..3dec406 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
index 49a7de0..88daf78 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
index d676590..d2c1a5f 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
index 19eed35..d437ec0 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
index 5de2196..ffd85f6 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
index 778f38f..97b5503 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
index b39de20..3d89873 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
index ea31968..b9621f4 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
index eeb5429..0695011 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
OpenPOWER on IntegriCloud