config root man

Current Path : /usr/src/tools/regression/geom_concat/

FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64
Upload File :
Current File : //usr/src/tools/regression/geom_concat/test-2.t

#!/bin/sh
# $FreeBSD: release/9.1.0/tools/regression/geom_concat/test-2.t 153185 2005-12-07 01:24:25Z pjd $

. `dirname $0`/conf.sh

echo '1..1'

us=45
tsize=6
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

gconcat create $name /dev/md${us} /dev/md`expr $us + 1` /dev/md`expr $us + 2` || exit 1
devwait

dd if=${src} of=/dev/concat/${name} bs=1m count=$tsize >/dev/null 2>&1
dd if=/dev/concat/${name} of=${dst} bs=1m count=$tsize >/dev/null 2>&1

if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then
	echo "not ok - md5 checksum comparison"
else
	echo "ok - md5 checksum comparison"
fi

gconcat destroy $name
mdconfig -d -u $us
mdconfig -d -u `expr $us + 1`
mdconfig -d -u `expr $us + 2`
rm -f ${src} ${dst}

Man Man