diff options
author | ngie <ngie@FreeBSD.org> | 2015-11-25 01:29:46 +0000 |
---|---|---|
committer | ngie <ngie@FreeBSD.org> | 2015-11-25 01:29:46 +0000 |
commit | 235502889cefec1fd5c4c972d9a86c0a93ed072a (patch) | |
tree | 567e5b93d180acaa3cdfafe4a16c0a10853728ff | |
parent | da2e89dc44c0dd458438d1f572265d9dc9a8c1ed (diff) | |
download | FreeBSD-src-235502889cefec1fd5c4c972d9a86c0a93ed072a.zip FreeBSD-src-235502889cefec1fd5c4c972d9a86c0a93ed072a.tar.gz |
- Attach md devices with attach_md
- Remove unnecessary mdconfig -d -u and gstripe destroy calls at the end
of the scripts
-rwxr-xr-x | sbin/geom/class/tests/stripe/1_test.sh | 15 | ||||
-rwxr-xr-x | sbin/geom/class/tests/stripe/2_test.sh | 17 |
2 files changed, 10 insertions, 22 deletions
diff --git a/sbin/geom/class/tests/stripe/1_test.sh b/sbin/geom/class/tests/stripe/1_test.sh index 9b398f0..7923763 100755 --- a/sbin/geom/class/tests/stripe/1_test.sh +++ b/sbin/geom/class/tests/stripe/1_test.sh @@ -5,13 +5,11 @@ 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. @@ -23,8 +21,3 @@ if [ $size -eq 3145728 ]; then 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` diff --git a/sbin/geom/class/tests/stripe/2_test.sh b/sbin/geom/class/tests/stripe/2_test.sh index 73937f4..9101342 100755 --- a/sbin/geom/class/tests/stripe/2_test.sh +++ b/sbin/geom/class/tests/stripe/2_test.sh @@ -5,18 +5,17 @@ echo "1..1" -us=45 tsize=3 -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 +src=`mktemp $TMPDIR/$base.XXXXXX` || exit 1 +dst=`mktemp $TMPDIR/$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 @@ -28,8 +27,4 @@ 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} |