]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - tools/regression/geom_raid3/test-11.t
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / tools / regression / geom_raid3 / test-11.t
1 #!/bin/sh
2 # $FreeBSD$
3
4 . `dirname $0`/conf.sh
5
6 echo "1..1"
7
8 us0=45
9 us1=`expr $us0 + 1`
10 us2=`expr $us0 + 2`
11 ddbs=2048
12 nblocks1=1024
13 nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)`
14 src=`mktemp /tmp/$base.XXXXXX` || exit 1
15 dst=`mktemp /tmp/$base.XXXXXX` || exit 1
16
17 dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1
18
19 mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1
20 mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1
21 mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1
22
23 graid3 label -w $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1
24 devwait
25
26 dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1
27
28 dd if=/dev/raid3/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1
29 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then
30         echo "not ok 1"
31 else
32         echo "ok 1"
33 fi
34
35 graid3 stop $name
36 mdconfig -d -u $us0
37 mdconfig -d -u $us1
38 mdconfig -d -u $us2
39 rm -f ${src} ${dst}