Index: stable/9/tools/regression/geom_stripe/conf.sh =================================================================== --- stable/9/tools/regression/geom_stripe/conf.sh (revision 296794) +++ stable/9/tools/regression/geom_stripe/conf.sh (revision 296795) @@ -1,8 +1,15 @@ #!/bin/sh # $FreeBSD$ name="$(mktemp -u stripe.XXXXXX)" class="stripe" base=`basename $0` +gstripe_test_cleanup() +{ + [ -c /dev/$class/$name ] && gstripe destroy $name + geom_test_cleanup +} +trap gstripe_test_cleanup ABRT EXIT INT TERM + . `dirname $0`/../geom_subr.sh Index: stable/9/tools/regression/geom_stripe/test-1.t =================================================================== --- stable/9/tools/regression/geom_stripe/test-1.t (revision 296794) +++ stable/9/tools/regression/geom_stripe/test-1.t (revision 296795) @@ -1,30 +1,23 @@ #!/bin/sh # $FreeBSD$ . `dirname $0`/conf.sh echo "1..1" -us=45 +us0=$(attach_md -t malloc -s 1M) || exit 1 +us1=$(attach_md -t malloc -s 2M) || exit 1 +us2=$(attach_md -t malloc -s 3M) || exit 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 16384 $name /dev/md${us} /dev/md`expr $us + 1` /dev/md`expr $us + 2` || exit 1 +gstripe create -s 16384 $name /dev/$us0 /dev/$us1 /dev/$us2 || 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 "ok 1" else echo "not ok 1" fi - -gstripe destroy $name -mdconfig -d -u $us -mdconfig -d -u `expr $us + 1` -mdconfig -d -u `expr $us + 2` Index: stable/9/tools/regression/geom_stripe/test-2.t =================================================================== --- stable/9/tools/regression/geom_stripe/test-2.t (revision 296794) +++ stable/9/tools/regression/geom_stripe/test-2.t (revision 296795) @@ -1,35 +1,30 @@ #!/bin/sh # $FreeBSD$ . `dirname $0`/conf.sh echo "1..1" -us=45 tsize=3 -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $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 +us0=$(attach_md -t malloc -s 1M) || exit 1 +us1=$(attach_md -t malloc -s 2M) || exit 1 +us2=$(attach_md -t malloc -s 3M) || exit 1 -gstripe create -s 8192 $name /dev/md${us} /dev/md`expr $us + 1` /dev/md`expr $us + 2` || exit 1 +gstripe create -s 8192 $name /dev/$us0 /dev/$us1 /dev/$us2 || 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 "not ok 1" else echo "ok 1" fi -gstripe destroy $name -mdconfig -d -u $us -mdconfig -d -u `expr $us + 1` -mdconfig -d -u `expr $us + 2` rm -f ${src} ${dst} Index: stable/9/tools/regression =================================================================== --- stable/9/tools/regression (revision 296794) +++ stable/9/tools/regression (revision 296795) Property changes on: stable/9/tools/regression ___________________________________________________________________ Modified: svn:mergeinfo ## -0,0 +0,1 ## Merged /stable/10/tools/regression:r296786 Index: stable/9/tools =================================================================== --- stable/9/tools (revision 296794) +++ stable/9/tools (revision 296795) Property changes on: stable/9/tools ___________________________________________________________________ Modified: svn:mergeinfo ## -0,0 +0,1 ## Merged /stable/10/tools:r296786 Index: stable/9 =================================================================== --- stable/9 (revision 296794) +++ stable/9 (revision 296795) Property changes on: stable/9 ___________________________________________________________________ Modified: svn:mergeinfo ## -0,0 +0,2 ## Merged /head:r293442 Merged /stable/10:r296786