11_test.sh revision 303975
1260847Sbryanv#!/bin/sh 2260847Sbryanv# $FreeBSD: releng/11.0/tests/sys/geom/class/raid3/11_test.sh 293821 2016-01-13 09:14:27Z ngie $ 3260847Sbryanv 4260847Sbryanv. `dirname $0`/conf.sh 5260847Sbryanv 6260847Sbryanvecho "1..1" 7260847Sbryanv 8260847Sbryanvddbs=2048 9260847Sbryanvnblocks1=1024 10260847Sbryanvnblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` 11260847Sbryanvsrc=`mktemp $base.XXXXXX` || exit 1 12260847Sbryanvdst=`mktemp $base.XXXXXX` || exit 1 13260847Sbryanv 14260847Sbryanvus0=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 15260847Sbryanvus1=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 16260847Sbryanvus2=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 17260847Sbryanv 18260847Sbryanvdd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 19260847Sbryanv 20260847Sbryanvgraid3 label -w $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 21260847Sbryanvdevwait 22260847Sbryanv 23260847Sbryanvdd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 24260847Sbryanv 25260847Sbryanvdd if=/dev/raid3/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 26260847Sbryanvif [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then 27260847Sbryanv echo "not ok 1" 28260847Sbryanvelse 29260847Sbryanv echo "ok 1" 30260847Sbryanvfi 31260847Sbryanv 32260847Sbryanvrm -f ${src} ${dst} 33260847Sbryanv