5_test.sh revision 153187
1209662Slstewart#!/bin/sh 2209662Slstewart# $FreeBSD: head/tools/regression/geom_raid3/test-5.t 153187 2005-12-07 01:28:59Z pjd $ 3209662Slstewart 4209662Slstewart. `dirname $0`/conf.sh 5209662Slstewart 6209662Slstewartecho "1..1" 7209662Slstewart 8209662Slstewartus0=45 9209662Slstewartus1=`expr $us0 + 1` 10209662Slstewartus2=`expr $us0 + 2` 11209662Slstewartddbs=2048 12209662Slstewartnblocks1=1024 13209662Slstewartnblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` 14209662Slstewartsrc=`mktemp /tmp/$base.XXXXXX` || exit 1 15209662Slstewartdst=`mktemp /tmp/$base.XXXXXX` || exit 1 16209662Slstewart 17209662Slstewartdd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 18209662Slstewart 19209662Slstewartmdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 20209662Slstewartmdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 21209662Slstewartmdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 22209662Slstewart 23209662Slstewartgraid3 label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 24209662Slstewartdevwait 25209662Slstewart 26209662Slstewart# 27209662Slstewart# Writing without PARITY component. 28209662Slstewart# 29209662Slstewartgraid3 remove -n 2 $name 30209662Slstewartdd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 31209662Slstewart 32209662Slstewartdd if=/dev/raid3/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 33280233Shirenif [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then 34209662Slstewart echo "not ok 1" 35209662Slstewartelse 36209662Slstewart echo "ok 1" 37209662Slstewartfi 38209662Slstewart 39209662Slstewartgraid3 stop $name 40209662Slstewartmdconfig -d -u $us0 41235450Sjoelmdconfig -d -u $us1 42209662Slstewartmdconfig -d -u $us2 43209662Slstewartrm -f ${src} ${dst} 44209662Slstewart