Add regression tests for geom_stripe and geom_nop.
Supported by: Wheel - Open Technologies - http://www.wheel.pl
This commit is contained in:
parent
a22dd9cfec
commit
c4db6df027
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=129578
8
tools/regression/geom_nop/Makefile
Normal file
8
tools/regression/geom_nop/Makefile
Normal file
@ -0,0 +1,8 @@
|
||||
#
|
||||
# $FreeBSD$
|
||||
#
|
||||
# Regression test for geom_nop.
|
||||
#
|
||||
|
||||
test:
|
||||
@sh runtests.sh
|
8
tools/regression/geom_nop/runtests.sh
Normal file
8
tools/regression/geom_nop/runtests.sh
Normal file
@ -0,0 +1,8 @@
|
||||
#!/bin/sh
|
||||
# $FreeBSD$
|
||||
|
||||
dir=`dirname $0`
|
||||
|
||||
for ts in `dirname $0`/test-*.sh; do
|
||||
sh $ts
|
||||
done
|
23
tools/regression/geom_nop/test-1.sh
Normal file
23
tools/regression/geom_nop/test-1.sh
Normal file
@ -0,0 +1,23 @@
|
||||
#!/bin/sh
|
||||
# $FreeBSD$
|
||||
|
||||
name="test"
|
||||
base=`basename $0`
|
||||
us=45
|
||||
|
||||
mdconfig -a -t malloc -s 1M -u $us || exit 1
|
||||
|
||||
gnop create /dev/md${us} || exit 1
|
||||
|
||||
# Size of created device should be 1MB.
|
||||
|
||||
size=`diskinfo /dev/md${us}.nop | awk '{print $3}'`
|
||||
|
||||
if [ $size -eq 1048576 ]; then
|
||||
echo "PASS"
|
||||
else
|
||||
echo "FAIL"
|
||||
fi
|
||||
|
||||
gnop destroy md${us}.nop
|
||||
mdconfig -d -u $us
|
27
tools/regression/geom_nop/test-2.sh
Normal file
27
tools/regression/geom_nop/test-2.sh
Normal file
@ -0,0 +1,27 @@
|
||||
#!/bin/sh
|
||||
# $FreeBSD$
|
||||
|
||||
name="test"
|
||||
base=`basename $0`
|
||||
us=45
|
||||
src=`mktemp /tmp/$base.XXXXXX` || exit 1
|
||||
dst=`mktemp /tmp/$base.XXXXXX` || exit 1
|
||||
|
||||
dd if=/dev/random of=${src} bs=1m count=1 >/dev/null 2>&1
|
||||
|
||||
mdconfig -a -t malloc -s 1M -u $us || exit 1
|
||||
|
||||
gnop create /dev/md${us} || exit 1
|
||||
|
||||
dd if=${src} of=/dev/md${us}.nop bs=1m count=1 >/dev/null 2>&1
|
||||
dd if=/dev/md${us}.nop of=${dst} bs=1m count=1 >/dev/null 2>&1
|
||||
|
||||
if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then
|
||||
echo "FAIL"
|
||||
else
|
||||
echo "PASS"
|
||||
fi
|
||||
|
||||
gnop destroy md${us}.nop
|
||||
mdconfig -d -u $us
|
||||
rm -f ${src} ${dst}
|
8
tools/regression/geom_stripe/Makefile
Normal file
8
tools/regression/geom_stripe/Makefile
Normal file
@ -0,0 +1,8 @@
|
||||
#
|
||||
# $FreeBSD$
|
||||
#
|
||||
# Regression test for geom_stripe.
|
||||
#
|
||||
|
||||
test:
|
||||
@sh runtests.sh
|
8
tools/regression/geom_stripe/runtests.sh
Normal file
8
tools/regression/geom_stripe/runtests.sh
Normal file
@ -0,0 +1,8 @@
|
||||
#!/bin/sh
|
||||
# $FreeBSD$
|
||||
|
||||
dir=`dirname $0`
|
||||
|
||||
for ts in `dirname $0`/test-*.sh; do
|
||||
sh $ts
|
||||
done
|
27
tools/regression/geom_stripe/test-1.sh
Normal file
27
tools/regression/geom_stripe/test-1.sh
Normal file
@ -0,0 +1,27 @@
|
||||
#!/bin/sh
|
||||
# $FreeBSD$
|
||||
|
||||
name="test"
|
||||
base=`basename $0`
|
||||
us=45
|
||||
|
||||
mdconfig -a -t malloc -s 1M -u $us || exit 1
|
||||
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
|
||||
|
||||
# Size of created device should be 1MB * 3.
|
||||
|
||||
size=`diskinfo /dev/${name}.stripe | awk '{print $3}'`
|
||||
|
||||
if [ $size -eq 3145728 ]; then
|
||||
echo "PASS"
|
||||
else
|
||||
echo "FAIL"
|
||||
fi
|
||||
|
||||
gstripe destroy $name
|
||||
mdconfig -d -u $us
|
||||
mdconfig -d -u `expr $us + 1`
|
||||
mdconfig -d -u `expr $us + 2`
|
32
tools/regression/geom_stripe/test-2.sh
Normal file
32
tools/regression/geom_stripe/test-2.sh
Normal file
@ -0,0 +1,32 @@
|
||||
#!/bin/sh
|
||||
# $FreeBSD$
|
||||
|
||||
name="test"
|
||||
base=`basename $0`
|
||||
us=45
|
||||
tsize=3
|
||||
src=`mktemp /tmp/$base.XXXXXX` || exit 1
|
||||
dst=`mktemp /tmp/$base.XXXXXX` || exit 1
|
||||
|
||||
dd if=/dev/random of=${src} bs=1m count=$tsize >/dev/null 2>&1
|
||||
|
||||
mdconfig -a -t malloc -s 1M -u $us || exit 1
|
||||
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
|
||||
|
||||
dd if=${src} of=/dev/${name}.stripe bs=1m count=$tsize >/dev/null 2>&1
|
||||
dd if=/dev/${name}.stripe of=${dst} bs=1m count=$tsize >/dev/null 2>&1
|
||||
|
||||
if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then
|
||||
echo "FAIL"
|
||||
else
|
||||
echo "PASS"
|
||||
fi
|
||||
|
||||
gstripe destroy $name
|
||||
mdconfig -d -u $us
|
||||
mdconfig -d -u `expr $us + 1`
|
||||
mdconfig -d -u `expr $us + 2`
|
||||
rm -f ${src} ${dst}
|
Loading…
Reference in New Issue
Block a user