From owner-svn-src-user@freebsd.org Wed Nov 25 00:12:16 2015 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 499CCA36607 for ; Wed, 25 Nov 2015 00:12:16 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 138311EE0; Wed, 25 Nov 2015 00:12:16 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAP0CFhA063371; Wed, 25 Nov 2015 00:12:15 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAP0CEet063359; Wed, 25 Nov 2015 00:12:14 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511250012.tAP0CEet063359@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 25 Nov 2015 00:12:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r291271 - user/ngie/more-tests2/sbin/geom/class/tests/raid3 X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2015 00:12:16 -0000 Author: ngie Date: Wed Nov 25 00:12:13 2015 New Revision: 291271 URL: https://svnweb.freebsd.org/changeset/base/291271 Log: - Allocate random devices via attach_md - Replace hardcoded references to /tmp with $TMPDIR - Remove all manual mdconfig -d -u calls Modified: user/ngie/more-tests2/sbin/geom/class/tests/raid3/10_test.sh user/ngie/more-tests2/sbin/geom/class/tests/raid3/11_test.sh user/ngie/more-tests2/sbin/geom/class/tests/raid3/12_test.sh user/ngie/more-tests2/sbin/geom/class/tests/raid3/1_test.sh user/ngie/more-tests2/sbin/geom/class/tests/raid3/2_test.sh user/ngie/more-tests2/sbin/geom/class/tests/raid3/3_test.sh user/ngie/more-tests2/sbin/geom/class/tests/raid3/4_test.sh user/ngie/more-tests2/sbin/geom/class/tests/raid3/5_test.sh user/ngie/more-tests2/sbin/geom/class/tests/raid3/6_test.sh user/ngie/more-tests2/sbin/geom/class/tests/raid3/7_test.sh user/ngie/more-tests2/sbin/geom/class/tests/raid3/8_test.sh user/ngie/more-tests2/sbin/geom/class/tests/raid3/9_test.sh Modified: user/ngie/more-tests2/sbin/geom/class/tests/raid3/10_test.sh ============================================================================== --- user/ngie/more-tests2/sbin/geom/class/tests/raid3/10_test.sh Tue Nov 24 23:45:38 2015 (r291270) +++ user/ngie/more-tests2/sbin/geom/class/tests/raid3/10_test.sh Wed Nov 25 00:12:13 2015 (r291271) @@ -5,22 +5,19 @@ echo "1..1" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` ddbs=2048 nblocks1=1024 nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 +src=`mktemp $TMPDIR/$base.XXXXXX` || exit 1 +dst=`mktemp $TMPDIR/$base.XXXXXX` || exit 1 -dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +us0=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us1=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us2=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 +dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -graid3 label -r $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +graid3 label -r $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 devwait dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 @@ -33,7 +30,4 @@ else fi graid3 stop $name -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 rm -f ${src} ${dst} Modified: user/ngie/more-tests2/sbin/geom/class/tests/raid3/11_test.sh ============================================================================== --- user/ngie/more-tests2/sbin/geom/class/tests/raid3/11_test.sh Tue Nov 24 23:45:38 2015 (r291270) +++ user/ngie/more-tests2/sbin/geom/class/tests/raid3/11_test.sh Wed Nov 25 00:12:13 2015 (r291271) @@ -5,22 +5,19 @@ echo "1..1" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` ddbs=2048 nblocks1=1024 nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 +src=`mktemp $TMPDIR/$base.XXXXXX` || exit 1 +dst=`mktemp $TMPDIR/$base.XXXXXX` || exit 1 -dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +us0=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us1=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us2=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 +dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -graid3 label -w $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +graid3 label -w $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 devwait dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 @@ -33,7 +30,4 @@ else fi graid3 stop $name -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 rm -f ${src} ${dst} Modified: user/ngie/more-tests2/sbin/geom/class/tests/raid3/12_test.sh ============================================================================== --- user/ngie/more-tests2/sbin/geom/class/tests/raid3/12_test.sh Tue Nov 24 23:45:38 2015 (r291270) +++ user/ngie/more-tests2/sbin/geom/class/tests/raid3/12_test.sh Wed Nov 25 00:12:13 2015 (r291271) @@ -5,31 +5,28 @@ echo "1..1" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` nblocks1=9 nblocks2=`expr $nblocks1 - 1` nblocks3=`expr $nblocks2 / 2` -mdconfig -a -t malloc -s $nblocks1 -u $us0 || exit 1 -mdconfig -a -t malloc -s $nblocks1 -u $us1 || exit 1 -mdconfig -a -t malloc -s $nblocks1 -u $us2 || exit 1 - -dd if=/dev/random of=/dev/md${us0} count=$nblocks1 >/dev/null 2>&1 -dd if=/dev/random of=/dev/md${us1} count=$nblocks1 >/dev/null 2>&1 -dd if=/dev/random of=/dev/md${us2} count=$nblocks1 >/dev/null 2>&1 +us0=$(attach_md -t malloc -s $nblocks1) || exit 1 +us1=$(attach_md -t malloc -s $nblocks1) || exit 1 +us2=$(attach_md -t malloc -s $nblocks1) || exit 1 + +dd if=/dev/random of=/dev/${us0} count=$nblocks1 >/dev/null 2>&1 +dd if=/dev/random of=/dev/${us1} count=$nblocks1 >/dev/null 2>&1 +dd if=/dev/random of=/dev/${us2} count=$nblocks1 >/dev/null 2>&1 -graid3 label -w $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +graid3 label -w $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 devwait # Wait for synchronization. sleep 2 graid3 stop $name # Break one component. -dd if=/dev/random of=/dev/md${us1} count=$nblocks2 >/dev/null 2>&1 +dd if=/dev/random of=/dev/${us1} count=$nblocks2 >/dev/null 2>&1 # Provoke retaste of the rest components. -true > /dev/md${us0} -true > /dev/md${us2} +true > /dev/${us0} +true > /dev/${us2} sleep 1 dd if=/dev/raid3/${name} of=/dev/null bs=1k count=$nblocks3 >/dev/null 2>&1 @@ -41,6 +38,3 @@ else fi graid3 stop $name -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 Modified: user/ngie/more-tests2/sbin/geom/class/tests/raid3/1_test.sh ============================================================================== --- user/ngie/more-tests2/sbin/geom/class/tests/raid3/1_test.sh Tue Nov 24 23:45:38 2015 (r291270) +++ user/ngie/more-tests2/sbin/geom/class/tests/raid3/1_test.sh Wed Nov 25 00:12:13 2015 (r291271) @@ -5,15 +5,11 @@ echo "1..2" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` - -mdconfig -a -t malloc -s 1M -u $us0 || exit 1 -mdconfig -a -t malloc -s 2M -u $us1 || exit 1 -mdconfig -a -t malloc -s 3M -u $us2 || exit 1 +us0=$(attach_md -t malloc -s 1M) || exit 1 +us1=$(attach_md -t malloc -s 2M) || exit 1 +us2=$(attach_md -t malloc -s 3M) || exit 1 -graid3 label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} 2>/dev/null || exit 1 +graid3 label $name /dev/${us0} /dev/${us1} /dev/${us2} 2>/dev/null || exit 1 devwait # Size of created device should be 2MB - 1024B. @@ -32,6 +28,3 @@ else fi graid3 stop $name -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 Modified: user/ngie/more-tests2/sbin/geom/class/tests/raid3/2_test.sh ============================================================================== --- user/ngie/more-tests2/sbin/geom/class/tests/raid3/2_test.sh Tue Nov 24 23:45:38 2015 (r291270) +++ user/ngie/more-tests2/sbin/geom/class/tests/raid3/2_test.sh Wed Nov 25 00:12:13 2015 (r291271) @@ -5,22 +5,19 @@ echo "1..1" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` ddbs=2048 nblocks1=1024 nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 +src=`mktemp $TMPDIR/$base.XXXXXX` || exit 1 +dst=`mktemp $TMPDIR/$base.XXXXXX` || exit 1 -dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +us0=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us1=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us2=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 +dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -graid3 label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +graid3 label $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 devwait dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 @@ -33,7 +30,4 @@ else fi graid3 stop $name -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 rm -f ${src} ${dst} Modified: user/ngie/more-tests2/sbin/geom/class/tests/raid3/3_test.sh ============================================================================== --- user/ngie/more-tests2/sbin/geom/class/tests/raid3/3_test.sh Tue Nov 24 23:45:38 2015 (r291270) +++ user/ngie/more-tests2/sbin/geom/class/tests/raid3/3_test.sh Wed Nov 25 00:12:13 2015 (r291271) @@ -5,22 +5,19 @@ echo "1..1" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` ddbs=2048 nblocks1=1024 nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 +src=`mktemp $TMPDIR/$base.XXXXXX` || exit 1 +dst=`mktemp $TMPDIR/$base.XXXXXX` || exit 1 -dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +us0=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us1=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us2=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 +dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -graid3 label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +graid3 label $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 devwait dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 @@ -37,7 +34,4 @@ else fi graid3 stop $name -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 rm -f ${src} ${dst} Modified: user/ngie/more-tests2/sbin/geom/class/tests/raid3/4_test.sh ============================================================================== --- user/ngie/more-tests2/sbin/geom/class/tests/raid3/4_test.sh Tue Nov 24 23:45:38 2015 (r291270) +++ user/ngie/more-tests2/sbin/geom/class/tests/raid3/4_test.sh Wed Nov 25 00:12:13 2015 (r291271) @@ -5,22 +5,19 @@ echo "1..1" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` ddbs=2048 nblocks1=1024 nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 +src=`mktemp $TMPDIR/$base.XXXXXX` || exit 1 +dst=`mktemp $TMPDIR/$base.XXXXXX` || exit 1 -dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +us0=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us1=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us2=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 +dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -graid3 label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +graid3 label $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 devwait # @@ -37,7 +34,4 @@ else fi graid3 stop $name -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 rm -f ${src} ${dst} Modified: user/ngie/more-tests2/sbin/geom/class/tests/raid3/5_test.sh ============================================================================== --- user/ngie/more-tests2/sbin/geom/class/tests/raid3/5_test.sh Tue Nov 24 23:45:38 2015 (r291270) +++ user/ngie/more-tests2/sbin/geom/class/tests/raid3/5_test.sh Wed Nov 25 00:12:13 2015 (r291271) @@ -5,22 +5,19 @@ echo "1..1" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` ddbs=2048 nblocks1=1024 nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 +src=`mktemp $TMPDIR/$base.XXXXXX` || exit 1 +dst=`mktemp $TMPDIR/$base.XXXXXX` || exit 1 -dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +us0=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us1=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us2=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 +dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -graid3 label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +graid3 label $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 devwait # @@ -37,7 +34,4 @@ else fi graid3 stop $name -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 rm -f ${src} ${dst} Modified: user/ngie/more-tests2/sbin/geom/class/tests/raid3/6_test.sh ============================================================================== --- user/ngie/more-tests2/sbin/geom/class/tests/raid3/6_test.sh Tue Nov 24 23:45:38 2015 (r291270) +++ user/ngie/more-tests2/sbin/geom/class/tests/raid3/6_test.sh Wed Nov 25 00:12:13 2015 (r291271) @@ -5,22 +5,19 @@ echo "1..1" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` ddbs=2048 nblocks1=1024 nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 +src=`mktemp $TMPDIR/$base.XXXXXX` || exit 1 +dst=`mktemp $TMPDIR/$base.XXXXXX` || exit 1 -dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +us0=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us1=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us2=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 +dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -graid3 label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +graid3 label $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 devwait dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 @@ -29,7 +26,7 @@ dd if=${src} of=/dev/raid3/${name} bs=$d # Rebuild of DATA component. # graid3 remove -n 1 $name -dd if=/dev/zero of=/dev/md${us1} bs=512 count=`expr $nblocks1 + 1` >/dev/null 2>&1 +dd if=/dev/zero of=/dev/${us1} bs=512 count=`expr $nblocks1 + 1` >/dev/null 2>&1 graid3 insert -n 1 $name md${us1} sleep 1 @@ -41,7 +38,4 @@ else fi graid3 stop $name -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 rm -f ${src} ${dst} Modified: user/ngie/more-tests2/sbin/geom/class/tests/raid3/7_test.sh ============================================================================== --- user/ngie/more-tests2/sbin/geom/class/tests/raid3/7_test.sh Tue Nov 24 23:45:38 2015 (r291270) +++ user/ngie/more-tests2/sbin/geom/class/tests/raid3/7_test.sh Wed Nov 25 00:12:13 2015 (r291271) @@ -5,22 +5,19 @@ echo "1..1" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` ddbs=2048 nblocks1=1024 nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 +src=`mktemp $TMPDIR/$base.XXXXXX` || exit 1 +dst=`mktemp $TMPDIR/$base.XXXXXX` || exit 1 -dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +us0=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us1=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us2=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 +dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -graid3 label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +graid3 label $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 devwait dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 @@ -29,12 +26,12 @@ dd if=${src} of=/dev/raid3/${name} bs=$d # Rebuild of PARITY component. # graid3 remove -n 2 $name -dd if=/dev/zero of=/dev/md${us2} bs=512 count=`expr $nblocks1 + 1` >/dev/null 2>&1 +dd if=/dev/zero of=/dev/${us2} bs=512 count=`expr $nblocks1 + 1` >/dev/null 2>&1 graid3 insert -n 2 $name md${us2} sleep 1 # Remove DATA component, so PARITY component can be used while reading. graid3 remove -n 1 $name -dd if=/dev/zero of=/dev/md${us1} bs=512 count=`expr $nblocks1 + 1` >/dev/null 2>&1 +dd if=/dev/zero of=/dev/${us1} bs=512 count=`expr $nblocks1 + 1` >/dev/null 2>&1 dd if=/dev/raid3/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then @@ -44,7 +41,4 @@ else fi graid3 stop $name -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 rm -f ${src} ${dst} Modified: user/ngie/more-tests2/sbin/geom/class/tests/raid3/8_test.sh ============================================================================== --- user/ngie/more-tests2/sbin/geom/class/tests/raid3/8_test.sh Tue Nov 24 23:45:38 2015 (r291270) +++ user/ngie/more-tests2/sbin/geom/class/tests/raid3/8_test.sh Wed Nov 25 00:12:13 2015 (r291271) @@ -5,29 +5,26 @@ echo "1..1" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` ddbs=2048 nblocks1=1024 nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 +src=`mktemp $TMPDIR/$base.XXXXXX` || exit 1 +dst=`mktemp $TMPDIR/$base.XXXXXX` || exit 1 -dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +us0=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us1=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us2=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 +dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -graid3 label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +graid3 label $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 devwait # # Writing without DATA component and rebuild of DATA component. # graid3 remove -n 1 $name -dd if=/dev/zero of=/dev/md${us1} bs=512 count=`expr $nblocks1 + 1` >/dev/null 2>&1 +dd if=/dev/zero of=/dev/${us1} bs=512 count=`expr $nblocks1 + 1` >/dev/null 2>&1 dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 graid3 insert -n 1 $name md${us1} sleep 1 @@ -40,7 +37,4 @@ else fi graid3 stop $name -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 rm -f ${src} ${dst} Modified: user/ngie/more-tests2/sbin/geom/class/tests/raid3/9_test.sh ============================================================================== --- user/ngie/more-tests2/sbin/geom/class/tests/raid3/9_test.sh Tue Nov 24 23:45:38 2015 (r291270) +++ user/ngie/more-tests2/sbin/geom/class/tests/raid3/9_test.sh Wed Nov 25 00:12:13 2015 (r291271) @@ -5,35 +5,32 @@ echo "1..1" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` ddbs=2048 nblocks1=1024 nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 +src=`mktemp $TMPDIR/$base.XXXXXX` || exit 1 +dst=`mktemp $TMPDIR/$base.XXXXXX` || exit 1 -dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +us0=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us1=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us2=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 +dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -graid3 label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +graid3 label $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 devwait # # Writing without PARITY component and rebuild of PARITY component. # graid3 remove -n 2 $name -dd if=/dev/zero of=/dev/md${us2} bs=512 count=`expr $nblocks1 + 1` >/dev/null 2>&1 +dd if=/dev/zero of=/dev/${us2} bs=512 count=`expr $nblocks1 + 1` >/dev/null 2>&1 dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 graid3 insert -n 2 $name md${us2} sleep 1 # Remove DATA component, so PARITY component can be used while reading. graid3 remove -n 1 $name -dd if=/dev/zero of=/dev/md${us1} bs=512 count=`expr $nblocks1 + 1` >/dev/null 2>&1 +dd if=/dev/zero of=/dev/${us1} bs=512 count=`expr $nblocks1 + 1` >/dev/null 2>&1 dd if=/dev/raid3/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then @@ -43,7 +40,4 @@ else fi graid3 stop $name -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 rm -f ${src} ${dst}