From owner-svn-src-user@freebsd.org Wed May 31 10:29:47 2017 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 056F7AFC6E9 for ; Wed, 31 May 2017 10:29:47 +0000 (UTC) (envelope-from pho@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 C81D372849; Wed, 31 May 2017 10:29:46 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4VATjbZ065928; Wed, 31 May 2017 10:29:45 GMT (envelope-from pho@FreeBSD.org) Received: (from pho@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4VATjUI065927; Wed, 31 May 2017 10:29:45 GMT (envelope-from pho@FreeBSD.org) Message-Id: <201705311029.v4VATjUI065927@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pho set sender to pho@FreeBSD.org using -f From: Peter Holm Date: Wed, 31 May 2017 10:29:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r319314 - user/pho/stress2/misc 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.23 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, 31 May 2017 10:29:47 -0000 Author: pho Date: Wed May 31 10:29:45 2017 New Revision: 319314 URL: https://svnweb.freebsd.org/changeset/base/319314 Log: Do not hard code the working directory and check available disk space. Sponsored by: Dell EMC Isilon Modified: user/pho/stress2/misc/nbufkv.sh Modified: user/pho/stress2/misc/nbufkv.sh ============================================================================== --- user/pho/stress2/misc/nbufkv.sh Wed May 31 10:27:14 2017 (r319313) +++ user/pho/stress2/misc/nbufkv.sh Wed May 31 10:29:45 2017 (r319314) @@ -37,6 +37,11 @@ . ../default.cfg +dir=`dirname $diskimage` +[ `df -k $dir | tail -1 | awk '{print $4'}` -lt \ + $((40 * 1024 * 1024)) ] && + echo "Not enough disk space on $dir." && exit 0 + odir=`pwd` cd /tmp @@ -47,25 +52,28 @@ cd $odir u1=$mdstart u2=$((u1 + 1)) -d1=/tmp/diskimage1 -d2=/tmp/diskimage2 +d1=$dir/diskimage1 +d2=$dir/diskimage2 mp1=$mntpoint mp2=${mntpoint}2 [ -d $mp1 ] || mkdir $mp1 [ -d $mp2 ] || mkdir $mp2 -truncate -s 20g $d1 -truncate -s 20g $d2 +rm -f $d1 $d2 +( + dd if=/dev/zero of=$d1 bs=1m count=20k || exit 1 +) 2>&1 | egrep -v 'records|transferred' +cp $d1 $d2 || exit 1 mount | grep -q /dev/md${u2}$part && umount -f /dev/md${u2}$part mount | grep -q /dev/md${u1}$part && umount -f /dev/md${u1}$part -mdconfig -l | grep -q md$u2 && mdconfig -d -u $u2 -mdconfig -l | grep -q md$u1 && mdconfig -d -u $u1 +[ -c /dev/md$u2 ] && mdconfig -d -u $u2 +[ -c /dev/md$u1 ] && mdconfig -d -u $u1 -mdconfig -a -t vnode -f $d1 -u $u1 +mdconfig -a -t vnode -f $d1 -u $u1 || exit 1 bsdlabel -w md$u1 auto newfs -b 65536 -f 65536 -O2 md${u1}$part > /dev/null -mdconfig -a -t vnode -f $d2 -u $u2 +mdconfig -a -t vnode -f $d2 -u $u2 || exit 1 bsdlabel -w md$u2 auto newfs -b 65536 -f 65536 -O2 md${u2}$part > /dev/null