- Delete non-TAP testcases
- Add a conf.sh file for executing common functions with geom_gate - Use attach_md for attaching md(4) devices - Don't hardcode /tmp for temporary files, which violates the kyua sandbox - Add/increase sleeps to try and improve synchronization - Add debug output for when checksums fail test-1.t: - Use pkill for killing ggated MFC after: 3 weeks Sponsored by: EMC / Isilon Storage Division
This commit is contained in:
parent
7cf0da249a
commit
0f0306933a
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=293621
@ -1,8 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
# $FreeBSD$
|
|
||||||
|
|
||||||
dir=`dirname $0`
|
|
||||||
|
|
||||||
for ts in `dirname $0`/test-*.sh; do
|
|
||||||
sh $ts
|
|
||||||
done
|
|
@ -1,36 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
# $FreeBSD$
|
|
||||||
|
|
||||||
base=`basename $0`
|
|
||||||
us=45
|
|
||||||
work="/dev/md${us}"
|
|
||||||
src="/dev/md`expr $us + 1`"
|
|
||||||
conf=`mktemp /tmp/$base.XXXXXX` || exit 1
|
|
||||||
|
|
||||||
mdconfig -a -t malloc -s 1M -u $us || exit 1
|
|
||||||
mdconfig -a -t malloc -s 1M -u `expr $us + 1` || exit 1
|
|
||||||
dd if=/dev/random of=$work bs=1m count=1 >/dev/null 2>&1
|
|
||||||
dd if=/dev/random of=$src bs=1m count=1 >/dev/null 2>&1
|
|
||||||
sum=`cat $src | md5 -q`
|
|
||||||
|
|
||||||
echo "127.0.0.1 RW $work" > $conf
|
|
||||||
ggated $conf
|
|
||||||
ggatec create -u $us 127.0.0.1 $work
|
|
||||||
|
|
||||||
dd if=${src} of=/dev/ggate${us} bs=1m count=1 >/dev/null 2>&1
|
|
||||||
|
|
||||||
if [ `cat $work | md5 -q` != $sum ]; then
|
|
||||||
echo "FAIL"
|
|
||||||
else
|
|
||||||
if [ `cat /dev/ggate${us} | md5 -q` != $sum ]; then
|
|
||||||
echo "FAIL"
|
|
||||||
else
|
|
||||||
echo "PASS"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
ggatec destroy -u $us
|
|
||||||
mdconfig -d -u $us
|
|
||||||
mdconfig -d -u `expr $us + 1`
|
|
||||||
pkill ggated $conf
|
|
||||||
rm -f $conf
|
|
@ -1,40 +1,62 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# $FreeBSD$
|
# $FreeBSD$
|
||||||
|
|
||||||
base=`basename $0`
|
. `dirname $0`/conf.sh
|
||||||
us=45
|
|
||||||
work="/dev/md${us}"
|
|
||||||
src="/dev/md`expr $us + 1`"
|
|
||||||
conf=`mktemp /tmp/$base.XXXXXX` || exit 1
|
|
||||||
|
|
||||||
mdconfig -a -t malloc -s 1M -u $us || exit 1
|
|
||||||
mdconfig -a -t malloc -s 1M -u `expr $us + 1` || exit 1
|
|
||||||
dd if=/dev/random of=$work bs=1m count=1 >/dev/null 2>&1
|
|
||||||
dd if=/dev/random of=$src bs=1m count=1 >/dev/null 2>&1
|
|
||||||
sum=`cat $src | md5 -q`
|
|
||||||
|
|
||||||
echo "127.0.0.1 RW $work" > $conf
|
|
||||||
ggated $conf
|
|
||||||
ggatec create -u $us 127.0.0.1 $work
|
|
||||||
|
|
||||||
dd if=${src} of=/dev/ggate${us} bs=1m count=1 >/dev/null 2>&1
|
|
||||||
|
|
||||||
echo '1..2'
|
echo '1..2'
|
||||||
|
|
||||||
if [ `cat $work | md5 -q` != $sum ]; then
|
base=`basename $0`
|
||||||
echo 'not ok 1 - md5 checksum'
|
us=0
|
||||||
|
while [ -c /dev/ggate${us} ]; do
|
||||||
|
: $(( us += 1 ))
|
||||||
|
done
|
||||||
|
conf=`mktemp $base.XXXXXX` || exit 1
|
||||||
|
pidfile=/var/run/ggated.pid
|
||||||
|
port=33080
|
||||||
|
|
||||||
|
work=$(attach_md -t malloc -s 1M)
|
||||||
|
src=$(attach_md -t malloc -s 1M)
|
||||||
|
|
||||||
|
test_cleanup()
|
||||||
|
{
|
||||||
|
ggatec destroy -f -u $us
|
||||||
|
pkill -F $pidfile
|
||||||
|
geom_test_cleanup
|
||||||
|
}
|
||||||
|
trap test_cleanup ABRT EXIT INT TERM
|
||||||
|
|
||||||
|
dd if=/dev/random of=/dev/$work bs=1m count=1 conv=sync
|
||||||
|
dd if=/dev/random of=/dev/$src bs=1m count=1 conv=sync
|
||||||
|
src_checksum=$(md5 -q /dev/$src)
|
||||||
|
|
||||||
|
echo "127.0.0.1 RW /dev/$work" > $conf
|
||||||
|
|
||||||
|
if ! ggated -p $port $conf; then
|
||||||
|
echo 'ggated failed to start'
|
||||||
|
echo 'Bail out!'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
sleep 1
|
||||||
|
if ! ggatec create -p $port -u $us 127.0.0.1 /dev/$work; then
|
||||||
|
echo 'ggatec create failed'
|
||||||
|
echo 'Bail out!'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
dd if=/dev/${src} of=/dev/ggate${us} bs=1m count=1
|
||||||
|
sleep 1
|
||||||
|
|
||||||
|
work_checksum=$(md5 -q /dev/$work)
|
||||||
|
if [ "$work_checksum" != "$src_checksum" ]; then
|
||||||
|
echo "not ok 1 - md5 checksums didn't match ($work_checksum != $src_checksum)"
|
||||||
|
echo "not ok 2 # SKIP"
|
||||||
else
|
else
|
||||||
echo 'ok 1 - md5 checksum'
|
echo 'ok 1 - md5 checksum'
|
||||||
|
|
||||||
if [ `cat /dev/ggate${us} | md5 -q` != $sum ]; then
|
ggate_checksum=$(md5 -q /dev/ggate${us})
|
||||||
echo 'not ok 2 - md5 checksum'
|
if [ "$ggate_checksum" != "$src_checksum" ]; then
|
||||||
|
echo "not ok 2 - md5 checksums didn't match ($ggate_checksum != $src_checksum)"
|
||||||
else
|
else
|
||||||
echo 'ok 2 - md5 checksum'
|
echo 'ok 2 - md5 checksum'
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ggatec destroy -u $us
|
|
||||||
mdconfig -d -u $us
|
|
||||||
mdconfig -d -u `expr $us + 1`
|
|
||||||
pkill ggated $conf
|
|
||||||
rm -f $conf
|
|
||||||
|
@ -1,28 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
# $FreeBSD$
|
|
||||||
|
|
||||||
base=`basename $0`
|
|
||||||
us=45
|
|
||||||
work=`mktemp /tmp/$base.XXXXXX` || exit 1
|
|
||||||
src=`mktemp /tmp/$base.XXXXXX` || exit 1
|
|
||||||
|
|
||||||
dd if=/dev/random of=$work bs=1m count=1 >/dev/null 2>&1
|
|
||||||
dd if=/dev/random of=$src bs=1m count=1 >/dev/null 2>&1
|
|
||||||
sum=`md5 -q $src`
|
|
||||||
|
|
||||||
ggatel create -u $us $work
|
|
||||||
|
|
||||||
dd if=${src} of=/dev/ggate${us} bs=1m count=1 >/dev/null 2>&1
|
|
||||||
|
|
||||||
if [ `md5 -q $work` != $sum ]; then
|
|
||||||
echo "FAIL"
|
|
||||||
else
|
|
||||||
if [ `cat /dev/ggate${us} | md5 -q` != $sum ]; then
|
|
||||||
echo "FAIL"
|
|
||||||
else
|
|
||||||
echo "PASS"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
ggatel destroy -u $us
|
|
||||||
rm -f $work $src
|
|
@ -1,31 +1,48 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# $FreeBSD$
|
# $FreeBSD$
|
||||||
|
|
||||||
|
. `dirname $0`/conf.sh
|
||||||
|
|
||||||
base=`basename $0`
|
base=`basename $0`
|
||||||
us=45
|
us=46
|
||||||
work=`mktemp /tmp/$base.XXXXXX` || exit 1
|
work=`mktemp -u $base.XXXXXX` || exit 1
|
||||||
src=`mktemp /tmp/$base.XXXXXX` || exit 1
|
src=`mktemp -u $base.XXXXXX` || exit 1
|
||||||
|
|
||||||
dd if=/dev/random of=$work bs=1m count=1 >/dev/null 2>&1
|
test_cleanup()
|
||||||
dd if=/dev/random of=$src bs=1m count=1 >/dev/null 2>&1
|
{
|
||||||
sum=`md5 -q $src`
|
ggatel destroy -f -u $us
|
||||||
|
rm -f $work $src
|
||||||
|
|
||||||
ggatel create -u $us $work
|
geom_test_cleanup
|
||||||
|
}
|
||||||
|
trap test_cleanup ABRT EXIT INT TERM
|
||||||
|
|
||||||
dd if=${src} of=/dev/ggate${us} bs=1m count=1 >/dev/null 2>&1
|
dd if=/dev/random of=$work bs=1m count=1 conv=sync
|
||||||
|
dd if=/dev/random of=$src bs=1m count=1 conv=sync
|
||||||
|
|
||||||
|
if ! ggatel create -u $us $work; then
|
||||||
|
echo 'ggatel create failed'
|
||||||
|
echo 'Bail out!'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
dd if=${src} of=/dev/ggate${us} bs=1m count=1
|
||||||
|
sleep 1
|
||||||
|
|
||||||
echo '1..2'
|
echo '1..2'
|
||||||
|
|
||||||
if [ `md5 -q $work` != $sum ]; then
|
src_checksum=$(md5 -q $src)
|
||||||
echo 'not ok 1 - md5 checksum'
|
work_checksum=$(md5 -q $work)
|
||||||
|
if [ "$work_checksum" != "$src_checksum" ]; then
|
||||||
|
echo "not ok 1 - md5 checksums didn't match ($work_checksum != $src_checksum) # TODO: bug 204616"
|
||||||
|
echo 'not ok 2 # SKIP'
|
||||||
else
|
else
|
||||||
echo 'ok 1 - md5 checksum'
|
echo 'ok 1 - md5 checksum'
|
||||||
if [ `cat /dev/ggate${us} | md5 -q` != $sum ]; then
|
|
||||||
echo 'not ok 2 - md5 checksum'
|
ggate_checksum=$(md5 -q /dev/ggate${us})
|
||||||
|
if [ "$ggate_checksum" != "$src_checksum" ]; then
|
||||||
|
echo "not ok 2 - md5 checksums didn't match ($ggate_checksum != $src_checksum)"
|
||||||
else
|
else
|
||||||
echo 'ok 2 - md5 checksum'
|
echo 'ok 2 - md5 checksum'
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ggatel destroy -u $us
|
|
||||||
rm -f $work $src
|
|
||||||
|
@ -1,31 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
# $FreeBSD$
|
|
||||||
|
|
||||||
base=`basename $0`
|
|
||||||
us=45
|
|
||||||
work="/dev/md${us}"
|
|
||||||
src="/dev/md`expr $us + 1`"
|
|
||||||
|
|
||||||
mdconfig -a -t malloc -s 1M -u $us || exit 1
|
|
||||||
mdconfig -a -t malloc -s 1M -u `expr $us + 1` || exit 1
|
|
||||||
dd if=/dev/random of=$work bs=1m count=1 >/dev/null 2>&1
|
|
||||||
dd if=/dev/random of=$src bs=1m count=1 >/dev/null 2>&1
|
|
||||||
sum=`cat $src | md5 -q`
|
|
||||||
|
|
||||||
ggatel create -u $us $work
|
|
||||||
|
|
||||||
dd if=${src} of=/dev/ggate${us} bs=1m count=1 >/dev/null 2>&1
|
|
||||||
|
|
||||||
if [ `cat $work | md5 -q` != $sum ]; then
|
|
||||||
echo "FAIL"
|
|
||||||
else
|
|
||||||
if [ `cat /dev/ggate${us} | md5 -q` != $sum ]; then
|
|
||||||
echo "FAIL"
|
|
||||||
else
|
|
||||||
echo "PASS"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
ggatel destroy -u $us
|
|
||||||
mdconfig -d -u $us
|
|
||||||
mdconfig -d -u `expr $us + 1`
|
|
@ -1,34 +1,48 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# $FreeBSD$
|
# $FreeBSD$
|
||||||
|
|
||||||
|
. `dirname $0`/conf.sh
|
||||||
|
|
||||||
base=`basename $0`
|
base=`basename $0`
|
||||||
us=45
|
us=47
|
||||||
work="/dev/md${us}"
|
|
||||||
src="/dev/md`expr $us + 1`"
|
|
||||||
|
|
||||||
mdconfig -a -t malloc -s 1M -u $us || exit 1
|
test_cleanup()
|
||||||
mdconfig -a -t malloc -s 1M -u `expr $us + 1` || exit 1
|
{
|
||||||
dd if=/dev/random of=$work bs=1m count=1 >/dev/null 2>&1
|
ggatel destroy -f -u $us
|
||||||
dd if=/dev/random of=$src bs=1m count=1 >/dev/null 2>&1
|
|
||||||
sum=`cat $src | md5 -q`
|
|
||||||
|
|
||||||
ggatel create -u $us $work
|
geom_test_cleanup
|
||||||
|
}
|
||||||
|
trap test_cleanup ABRT EXIT INT TERM
|
||||||
|
|
||||||
dd if=${src} of=/dev/ggate${us} bs=1m count=1 >/dev/null 2>&1
|
work=$(attach_md -t malloc -s 1M)
|
||||||
|
src=$(attach_md -t malloc -s 1M)
|
||||||
|
|
||||||
|
dd if=/dev/random of=/dev/$work bs=1m count=1 conv=sync
|
||||||
|
dd if=/dev/random of=/dev/$src bs=1m count=1 conv=sync
|
||||||
|
src_checksum=$(md5 -q /dev/$src)
|
||||||
|
|
||||||
|
if ! ggatel create -u $us /dev/$work; then
|
||||||
|
echo 'ggatel create failed'
|
||||||
|
echo 'Bail out!'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
dd if=/dev/${src} of=/dev/ggate${us} bs=1m count=1 conv=sync
|
||||||
|
sleep 1
|
||||||
|
|
||||||
echo '1..2'
|
echo '1..2'
|
||||||
|
|
||||||
if [ `cat $work | md5 -q` != $sum ]; then
|
work_checksum=$(md5 -q /dev/$work)
|
||||||
echo 'not ok 1 - md5 checksum'
|
if [ "$work_checksum" != "$src_checksum" ]; then
|
||||||
|
echo "not ok 1 - md5 checksums didn't match ($work_checksum != $src_checksum)"
|
||||||
|
echo 'not ok 2 # SKIP'
|
||||||
else
|
else
|
||||||
echo 'ok 1 - md5 checksum'
|
echo 'ok 1 - md5 checksum'
|
||||||
if [ `cat /dev/ggate${us} | md5 -q` != $sum ]; then
|
|
||||||
echo 'not ok 2 - md5 checksum'
|
ggate_checksum=$(md5 -q /dev/ggate${us})
|
||||||
|
if [ "$ggate_checksum" != "$src_checksum" ]; then
|
||||||
|
echo "not ok 2 - md5 checksums didn't match ($ggate_checksum != $src_checksum)"
|
||||||
else
|
else
|
||||||
echo 'ok 2 - md5 checksum'
|
echo 'ok 2 - md5 checksum'
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ggatel destroy -u $us
|
|
||||||
mdconfig -d -u $us
|
|
||||||
mdconfig -d -u `expr $us + 1`
|
|
||||||
|
Loading…
Reference in New Issue
Block a user