- Make use of geom_subr.sh to improve regression tests.
- Keep class-specific data in conf.sh file.
This commit is contained in:
parent
db5f9b8b22
commit
b0f4c56e21
8
tools/regression/geom_mirror/conf.sh
Normal file
8
tools/regression/geom_mirror/conf.sh
Normal file
@ -0,0 +1,8 @@
|
||||
#!/bin/sh
|
||||
# $FreeBSD$
|
||||
|
||||
name="test"
|
||||
class="mirror"
|
||||
base=`basename $0`
|
||||
|
||||
. `dirname $0`/../geom_subr.sh
|
@ -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.
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
7
tools/regression/geom_nop/conf.sh
Normal file
7
tools/regression/geom_nop/conf.sh
Normal file
@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
# $FreeBSD$
|
||||
|
||||
class="nop"
|
||||
base=`basename $0`
|
||||
|
||||
. `dirname $0`/../geom_subr.sh
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user