]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/blob - tools/regression/geom_raid3/test-2.t
MFC r293438:
[FreeBSD/stable/10.git] / tools / regression / geom_raid3 / test-2.t
1 #!/bin/sh
2 # $FreeBSD$
3
4 . `dirname $0`/conf.sh
5
6 echo "1..1"
7
8 ddbs=2048
9 nblocks1=1024
10 nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)`
11 src=`mktemp $base.XXXXXX` || exit 1
12 dst=`mktemp $base.XXXXXX` || exit 1
13
14 us0=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1
15 us1=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1
16 us2=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1
17
18 dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1
19
20 graid3 label $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1
21 devwait
22
23 dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1
24
25 dd if=/dev/raid3/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1
26 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then
27         echo "not ok 1"
28 else
29         echo "ok 1"
30 fi
31
32 rm -f ${src} ${dst}