4_test.sh revision 153187
1153187Spjd#!/bin/sh 2153187Spjd# $FreeBSD: head/tools/regression/geom_raid3/test-4.t 153187 2005-12-07 01:28:59Z pjd $ 3153187Spjd 4153187Spjd. `dirname $0`/conf.sh 5153187Spjd 6153187Spjdecho "1..1" 7153187Spjd 8153187Spjdus0=45 9153187Spjdus1=`expr $us0 + 1` 10153187Spjdus2=`expr $us0 + 2` 11153187Spjdddbs=2048 12153187Spjdnblocks1=1024 13153187Spjdnblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` 14153187Spjdsrc=`mktemp /tmp/$base.XXXXXX` || exit 1 15153187Spjddst=`mktemp /tmp/$base.XXXXXX` || exit 1 16153187Spjd 17153187Spjddd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 18153187Spjd 19153187Spjdmdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 20153187Spjdmdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 21153187Spjdmdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 22153187Spjd 23153187Spjdgraid3 label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 24153187Spjddevwait 25153187Spjd 26153187Spjd# 27153187Spjd# Writing without one DATA component. 28153187Spjd# 29153187Spjdgraid3 remove -n 1 $name 30153187Spjddd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 31153187Spjd 32153187Spjddd if=/dev/raid3/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 33153187Spjdif [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then 34153187Spjd echo "not ok 1" 35153187Spjdelse 36153187Spjd echo "ok 1" 37153187Spjdfi 38153187Spjd 39153187Spjdgraid3 stop $name 40153187Spjdmdconfig -d -u $us0 41153187Spjdmdconfig -d -u $us1 42153187Spjdmdconfig -d -u $us2 43153187Spjdrm -f ${src} ${dst} 44