- Make use of geom_subr.sh to improve regression tests.

- Keep class-specific data in conf.sh file.
This commit is contained in:
Pawel Jakub Dawidek 2005-12-07 01:27:23 +00:00
parent db5f9b8b22
commit b0f4c56e21
11 changed files with 55 additions and 54 deletions

View File

@ -0,0 +1,8 @@
#!/bin/sh
# $FreeBSD$
name="test"
class="mirror"
base=`basename $0`
. `dirname $0`/../geom_subr.sh

View File

@ -1,22 +1,20 @@
#!/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`
echo "1..1"
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
kldstat -q -m g_mirror || gmirror load || exit 1
gmirror label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1
sleep 1
devwait
# Size of created device should be 1MB - 512b.

View File

@ -1,8 +1,10 @@
#!/bin/sh
# $FreeBSD$
name="test"
base=`basename $0`
. `dirname $0`/conf.sh
echo "1..4"
balance="round-robin"
us0=45
us1=`expr $us0 + 1`
@ -13,18 +15,14 @@ nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)`
src=`mktemp /tmp/$base.XXXXXX` || exit 1
dst=`mktemp /tmp/$base.XXXXXX` || exit 1
echo "1..4"
dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1
mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1
mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1
mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1
kldstat -q -m g_mirror || gmirror load || exit 1
gmirror label -b $balance $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1
sleep 1
devwait
dd if=${src} of=/dev/mirror/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1

View File

@ -1,8 +1,10 @@
#!/bin/sh
# $FreeBSD$
name="test"
base=`basename $0`
. `dirname $0`/conf.sh
echo "1..5"
balance="round-robin"
us0=45
us1=`expr $us0 + 1`
@ -13,18 +15,14 @@ nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)`
src=`mktemp /tmp/$base.XXXXXX` || exit 1
dst=`mktemp /tmp/$base.XXXXXX` || exit 1
echo "1..5"
dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1
mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1
mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1
mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1
kldstat -q -m g_mirror || gmirror load || exit 1
gmirror label -b $balance $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1
sleep 1
devwait
dd if=${src} of=/dev/mirror/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1

View File

@ -1,8 +1,10 @@
#!/bin/sh
# $FreeBSD$
name="test"
base=`basename $0`
. `dirname $0`/conf.sh
echo "1..5"
balance="load"
us0=45
us1=`expr $us0 + 1`
@ -13,18 +15,14 @@ nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)`
src=`mktemp /tmp/$base.XXXXXX` || exit 1
dst=`mktemp /tmp/$base.XXXXXX` || exit 1
echo "1..5"
dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1
mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1
mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1
mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1
kldstat -q -m g_mirror || gmirror load || exit 1
gmirror label -b $balance $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1
sleep 1
devwait
dd if=${src} of=/dev/mirror/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1

View File

@ -1,8 +1,10 @@
#!/bin/sh
# $FreeBSD$
name="test"
base=`basename $0`
. `dirname $0`/conf.sh
echo "1..5"
balance="split"
us0=45
us1=`expr $us0 + 1`
@ -13,18 +15,14 @@ nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)`
src=`mktemp /tmp/$base.XXXXXX` || exit 1
dst=`mktemp /tmp/$base.XXXXXX` || exit 1
echo "1..5"
dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1
mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1
mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1
mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1
kldstat -q -m g_mirror || gmirror load || exit 1
gmirror label -b $balance -s `expr $ddbs / 2` $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1
sleep 1
devwait
dd if=${src} of=/dev/mirror/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1

View File

@ -1,8 +1,10 @@
#!/bin/sh
# $FreeBSD$
name="test"
base=`basename $0`
. `dirname $0`/conf.sh
echo "1..2"
balance="split"
us0=45
us1=`expr $us0 + 1`
@ -13,18 +15,14 @@ nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)`
src=`mktemp /tmp/$base.XXXXXX` || exit 1
dst=`mktemp /tmp/$base.XXXXXX` || exit 1
echo "1..2"
dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1
mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1
mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1
mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1
kldstat -q -m g_mirror || gmirror load || exit 1
gmirror label -b $balance -s `expr $ddbs / 2` $name /dev/md${us0} /dev/md${us1} || exit 1
sleep 1
devwait
dd if=${src} of=/dev/mirror/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1
dd if=/dev/zero of=/dev/md${us2} bs=$ddbs count=$nblocks2 >/dev/null 2>&1

View File

@ -1,8 +1,10 @@
#!/bin/sh
# $FreeBSD$
name="test"
base=`basename $0`
. `dirname $0`/conf.sh
echo "1..5"
balance="prefer"
us0=45
us1=`expr $us0 + 1`
@ -13,18 +15,14 @@ nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)`
src=`mktemp /tmp/$base.XXXXXX` || exit 1
dst=`mktemp /tmp/$base.XXXXXX` || exit 1
echo "1..5"
dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1
mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1
mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1
mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1
kldstat -q -m g_mirror || gmirror load || exit 1
gmirror label -b $balance $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1
sleep 1
devwait
dd if=${src} of=/dev/mirror/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1

View File

@ -0,0 +1,7 @@
#!/bin/sh
# $FreeBSD$
class="nop"
base=`basename $0`
. `dirname $0`/../geom_subr.sh

View File

@ -1,12 +1,12 @@
#!/bin/sh
# $FreeBSD$
name="test"
base=`basename $0`
us=45
. `dirname $0`/conf.sh
echo "1..1"
us=45
mdconfig -a -t malloc -s 1M -u $us || exit 1
gnop create /dev/md${us} || exit 1

View File

@ -1,8 +1,8 @@
#!/bin/sh
# $FreeBSD$
name="test"
base=`basename $0`
. `dirname $0`/conf.sh
us=45
src=`mktemp /tmp/$base.XXXXXX` || exit 1
dst=`mktemp /tmp/$base.XXXXXX` || exit 1