Convert gstripe(8) regression tests to the new framework.
This commit is contained in:
parent
54cd653136
commit
5612eab744
@ -1,8 +0,0 @@
|
||||
#
|
||||
# $FreeBSD$
|
||||
#
|
||||
# Regression test for geom_stripe.
|
||||
#
|
||||
|
||||
test:
|
||||
@sh runtests.sh
|
8
tools/regression/geom_stripe/conf.sh
Normal file
8
tools/regression/geom_stripe/conf.sh
Normal file
@ -0,0 +1,8 @@
|
||||
#!/bin/sh
|
||||
# $FreeBSD$
|
||||
|
||||
name="test"
|
||||
class="stripe"
|
||||
base=`basename $0`
|
||||
|
||||
. `dirname $0`/../geom_subr.sh
|
@ -1,8 +0,0 @@
|
||||
#!/bin/sh
|
||||
# $FreeBSD$
|
||||
|
||||
dir=`dirname $0`
|
||||
|
||||
for ts in `dirname $0`/test-*.sh; do
|
||||
sh $ts
|
||||
done
|
@ -1,8 +1,10 @@
|
||||
#!/bin/sh
|
||||
# $FreeBSD$
|
||||
|
||||
name="test"
|
||||
base=`basename $0`
|
||||
. `dirname $0`/conf.sh
|
||||
|
||||
echo "1..1"
|
||||
|
||||
us=45
|
||||
|
||||
mdconfig -a -t malloc -s 1M -u $us || exit 1
|
||||
@ -10,15 +12,16 @@ mdconfig -a -t malloc -s 2M -u `expr $us + 1` || exit 1
|
||||
mdconfig -a -t malloc -s 3M -u `expr $us + 2` || exit 1
|
||||
|
||||
gstripe create -s 16384 $name /dev/md${us} /dev/md`expr $us + 1` /dev/md`expr $us + 2` || exit 1
|
||||
devwait
|
||||
|
||||
# Size of created device should be 1MB * 3.
|
||||
|
||||
size=`diskinfo /dev/stripe/${name} | awk '{print $3}'`
|
||||
|
||||
if [ $size -eq 3145728 ]; then
|
||||
echo "PASS"
|
||||
echo "ok 1"
|
||||
else
|
||||
echo "FAIL"
|
||||
echo "not ok 1"
|
||||
fi
|
||||
|
||||
gstripe destroy $name
|
@ -1,8 +1,10 @@
|
||||
#!/bin/sh
|
||||
# $FreeBSD$
|
||||
|
||||
name="test"
|
||||
base=`basename $0`
|
||||
. `dirname $0`/conf.sh
|
||||
|
||||
echo "1..1"
|
||||
|
||||
us=45
|
||||
tsize=3
|
||||
src=`mktemp /tmp/$base.XXXXXX` || exit 1
|
||||
@ -15,14 +17,15 @@ mdconfig -a -t malloc -s 2M -u `expr $us + 1` || exit 1
|
||||
mdconfig -a -t malloc -s 3M -u `expr $us + 2` || exit 1
|
||||
|
||||
gstripe create -s 8192 $name /dev/md${us} /dev/md`expr $us + 1` /dev/md`expr $us + 2` || exit 1
|
||||
devwait
|
||||
|
||||
dd if=${src} of=/dev/stripe/${name} bs=1m count=$tsize >/dev/null 2>&1
|
||||
dd if=/dev/stripe/${name} of=${dst} bs=1m count=$tsize >/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
|
||||
|
||||
gstripe destroy $name
|
Loading…
x
Reference in New Issue
Block a user