2004-05-22 10:58:53 +00:00
|
|
|
#!/bin/sh
|
|
|
|
# $FreeBSD$
|
|
|
|
|
2005-12-07 01:30:44 +00:00
|
|
|
. `dirname $0`/conf.sh
|
|
|
|
|
|
|
|
echo "1..1"
|
|
|
|
|
2004-05-22 10:58:53 +00:00
|
|
|
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
|
2005-12-07 01:30:44 +00:00
|
|
|
devwait
|
2004-05-22 10:58:53 +00:00
|
|
|
|
2004-07-26 16:10:27 +00:00
|
|
|
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
|
2004-05-22 10:58:53 +00:00
|
|
|
|
|
|
|
if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then
|
2005-12-07 01:30:44 +00:00
|
|
|
echo "not ok 1"
|
2004-05-22 10:58:53 +00:00
|
|
|
else
|
2005-12-07 01:30:44 +00:00
|
|
|
echo "ok 1"
|
2004-05-22 10:58:53 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
gstripe destroy $name
|
|
|
|
mdconfig -d -u $us
|
|
|
|
mdconfig -d -u `expr $us + 1`
|
|
|
|
mdconfig -d -u `expr $us + 2`
|
|
|
|
rm -f ${src} ${dst}
|