test-5.t revision 153187
1231200Smm#!/bin/sh
2231200Smm# $FreeBSD: head/tools/regression/geom_raid3/test-5.t 153187 2005-12-07 01:28:59Z pjd $
3231200Smm
4231200Smm. `dirname $0`/conf.sh
5231200Smm
6231200Smmecho "1..1"
7231200Smm
8231200Smmus0=45
9231200Smmus1=`expr $us0 + 1`
10231200Smmus2=`expr $us0 + 2`
11231200Smmddbs=2048
12231200Smmnblocks1=1024
13231200Smmnblocks2=`expr $nblocks1 / \( $ddbs / 512 \)`
14231200Smmsrc=`mktemp /tmp/$base.XXXXXX` || exit 1
15231200Smmdst=`mktemp /tmp/$base.XXXXXX` || exit 1
16231200Smm
17231200Smmdd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1
18231200Smm
19231200Smmmdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1
20231200Smmmdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1
21231200Smmmdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1
22231200Smm
23231200Smmgraid3 label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1
24231200Smmdevwait
25231200Smm
26231200Smm#
27231200Smm# Writing without PARITY component.
28231200Smm#
29231200Smmgraid3 remove -n 2 $name
30231200Smmdd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1
31231200Smm
32231200Smmdd if=/dev/raid3/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1
33231200Smmif [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then
34231200Smm	echo "not ok 1"
35231200Smmelse
36231200Smm	echo "ok 1"
37231200Smmfi
38231200Smm
39231200Smmgraid3 stop $name
40231200Smmmdconfig -d -u $us0
41231200Smmmdconfig -d -u $us1
42231200Smmmdconfig -d -u $us2
43231200Smmrm -f ${src} ${dst}
44231200Smm