2002-10-20 11:16:13 +00:00
|
|
|
#!/bin/sh
|
|
|
|
# $FreeBSD$
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
MD=99
|
2003-10-07 09:31:51 +00:00
|
|
|
mdconfig -d -u $MD > /dev/null 2>&1 || true
|
2002-10-20 11:16:13 +00:00
|
|
|
|
|
|
|
mdconfig -a -t malloc -s 1m -u $MD
|
|
|
|
|
|
|
|
D=/dev/md$MD
|
|
|
|
|
|
|
|
./gbde init $D -P foo -L /tmp/_l1
|
|
|
|
./gbde setkey $D -p foo -l /tmp/_l1 -P bar -L /tmp/_l1
|
|
|
|
./gbde setkey $D -p bar -l /tmp/_l1 -P foo -L /tmp/_l1
|
|
|
|
|
|
|
|
./gbde setkey $D -p foo -l /tmp/_l1 -n 2 -P foo2 -L /tmp/_l2
|
|
|
|
./gbde setkey $D -p foo2 -l /tmp/_l2 -n 3 -P foo3 -L /tmp/_l3
|
|
|
|
./gbde setkey $D -p foo3 -l /tmp/_l3 -n 4 -P foo4 -L /tmp/_l4
|
|
|
|
./gbde setkey $D -p foo4 -l /tmp/_l4 -n 1 -P foo1 -L /tmp/_l1
|
|
|
|
|
|
|
|
./gbde nuke $D -p foo1 -l /tmp/_l1 -n 4
|
|
|
|
if ./gbde nuke $D -p foo4 -l /tmp/_l4 -n 3 ; then false ; fi
|
|
|
|
./gbde destroy $D -p foo2 -l /tmp/_l2
|
|
|
|
if ./gbde destroy $D -p foo2 -l /tmp/_l2 ; then false ; fi
|
|
|
|
|
|
|
|
./gbde nuke $D -p foo1 -l /tmp/_l1 -n -1
|
|
|
|
if ./gbde nuke $D -p foo1 -l /tmp/_l1 -n -1 ; then false ; fi
|
|
|
|
if ./gbde nuke $D -p foo2 -l /tmp/_l2 -n -1 ; then false ; fi
|
|
|
|
if ./gbde nuke $D -p foo3 -l /tmp/_l3 -n -1 ; then false ; fi
|
|
|
|
if ./gbde nuke $D -p foo4 -l /tmp/_l4 -n -1 ; then false ; fi
|
|
|
|
|
|
|
|
./gbde init $D -P foo
|
|
|
|
./gbde setkey $D -p foo -P bar
|
|
|
|
./gbde setkey $D -p bar -P foo
|
|
|
|
|
|
|
|
./gbde setkey $D -p foo -n 2 -P foo2
|
|
|
|
./gbde setkey $D -p foo2 -n 3 -P foo3
|
|
|
|
./gbde setkey $D -p foo3 -n 4 -P foo4
|
|
|
|
./gbde setkey $D -p foo4 -n 1 -P foo1
|
|
|
|
|
2003-10-07 09:31:51 +00:00
|
|
|
mdconfig -d -u $MD
|
|
|
|
|
|
|
|
mdconfig -a -t malloc -s 1m -u $MD
|
2003-10-17 19:52:07 +00:00
|
|
|
if [ -f image.uu ] ; then
|
|
|
|
uudecode -p image.uu | bzcat > $D
|
|
|
|
else
|
|
|
|
uudecode -p ${1}/image.uu | bzcat > $D
|
|
|
|
fi
|
2003-10-07 09:31:51 +00:00
|
|
|
gbde attach $D -p foo
|
|
|
|
fsck_ffs ${D}.bde
|
|
|
|
gbde detach $D
|
|
|
|
mdconfig -d -u $MD
|
|
|
|
|
|
|
|
|
2002-10-20 11:16:13 +00:00
|
|
|
echo "***********"
|
|
|
|
echo "Test passed"
|
|
|
|
echo "***********"
|
|
|
|
exit 0
|