Date: Tue, 6 Jan 2015 07:41:31 +0000 (UTC) From: Peter Holm <pho@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r276740 - in user/pho/stress2: . misc Message-ID: <201501060741.t067fVSs043568@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: pho Date: Tue Jan 6 07:41:30 2015 New Revision: 276740 URL: https://svnweb.freebsd.org/changeset/base/276740 Log: Change NFS tests from using a loopback mount to using a remote host for a more realistic test scenario. Sponsored by: EMC / Isilon storage division Modified: user/pho/stress2/default.cfg user/pho/stress2/misc/crossmp2.sh user/pho/stress2/misc/lockf.sh user/pho/stress2/misc/mountu.sh user/pho/stress2/misc/nfs.sh user/pho/stress2/misc/nfs12.sh user/pho/stress2/misc/nfs3.sh user/pho/stress2/misc/nfs4.sh user/pho/stress2/misc/nfs7.sh user/pho/stress2/misc/nfs8.sh user/pho/stress2/misc/nfs9.sh user/pho/stress2/misc/nfsrename.sh user/pho/stress2/misc/readdir.sh Modified: user/pho/stress2/default.cfg ============================================================================== --- user/pho/stress2/default.cfg Tue Jan 6 07:37:33 2015 (r276739) +++ user/pho/stress2/default.cfg Tue Jan 6 07:41:30 2015 (r276740) @@ -18,7 +18,7 @@ export INCARNATIONS=${INCARNATIONS:-20} # Change hostname! #export BLASTHOST=192.168.1.2 # host with udp discard enabled in inetd.conf export BLASTHOST=192.168.1.3 # host with udp discard enabled in inetd.conf - +#export nfs_export=somehost:mount # Used by nfs tests # Run all test cases: export runRUNTIME=${runRUNTIME:-3d} # Run tests for three days @@ -51,7 +51,7 @@ testcases/udp/udp testcases/tcp/tcp " -# +# # Defaults for ./misc tests # @@ -69,7 +69,7 @@ dede () { # file, blocksize, coun local status=$? egrep -v "records in|records out|bytes transferred" $log rm -f $log - return $status + return $status } # fsck and dumpfs comparison Modified: user/pho/stress2/misc/crossmp2.sh ============================================================================== --- user/pho/stress2/misc/crossmp2.sh Tue Jan 6 07:37:33 2015 (r276739) +++ user/pho/stress2/misc/crossmp2.sh Tue Jan 6 07:41:30 2015 (r276740) @@ -28,19 +28,23 @@ # $FreeBSD$ # -# Panic in getdirentries+0x21a -# Run with stress: disk.cfg +# NFS test [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 . ../default.cfg +[ -z "$nfs_export" ] && exit 0 +ping -c 2 `echo $nfs_export | sed 's/:.*//'` > /dev/null 2>&1 || + exit 0 + mounts=10 # Number of parallel scripts if [ $# -eq 0 ]; then for i in `jot $mounts`; do - [ ! -d ${mntpoint}$i ] && mkdir ${mntpoint}$i - mount | grep -qw "${mntpoint}$i" && umount ${mntpoint}$i + mp=${mntpoint}$i + [ ! -d $mp ] && mkdir $mp + mount | grep -qw "$mp" && umount $mp done # start the parallel tests @@ -48,28 +52,28 @@ if [ $# -eq 0 ]; then ./$0 $i & ./$0 find & done - - for i in `jot $mounts`; do - wait; wait - done + wait else if [ $1 = find ]; then for i in `jot 128`; do - find ${mntpoint}* -maxdepth 1 -type f > /dev/null 2>&1 + find ${mntpoint}* -maxdepth 1 -type f > \ + /dev/null 2>&1 done else # The test: Parallel mount and unmounts for i in `jot 128`; do m=$1 - mount -t nfs -o tcp -o nfsv3 -o retrycnt=3 -o intr -o soft -o rw 127.0.0.1:/tmp ${mntpoint}$m + mount -t nfs -o tcp -o nfsv3 -o retrycnt=3 -o intr \ + -o soft -o rw $nfs_export ${mntpoint}$m sleep .5 opt=`[ $(( m % 2 )) -eq 0 ] && echo -f` n=0 while mount | grep -qw ${mntpoint}$m; do umount $opt ${mntpoint}$m > /dev/null 2>&1 n=$((n + 1)) - [ $n -gt 99 ] && umount -f ${mntpoint}$m > /dev/null 2>&1 + [ $n -gt 99 ] && umount -f ${mntpoint}$m > \ + /dev/null 2>&1 [ $n -gt 100 ] && exit done done Modified: user/pho/stress2/misc/lockf.sh ============================================================================== --- user/pho/stress2/misc/lockf.sh Tue Jan 6 07:37:33 2015 (r276739) +++ user/pho/stress2/misc/lockf.sh Tue Jan 6 07:41:30 2015 (r276740) @@ -28,27 +28,32 @@ # $FreeBSD$ # -# Page fault in nfs_advlock +# Page fault seen: +# http://people.freebsd.org/~pho/stress/log/lockf.txt [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 . ../default.cfg +[ -z "$nfs_export" ] && exit 0 +ping -c 2 `echo $nfs_export | sed 's/:.*//'` > /dev/null 2>&1 || + exit 0 + +pgrep -q lockd || { echo "lockd not running"; exit 0; } + trap "rm -f /tmp/$0.$$.*" 0 mount | grep "$mntpoint" | grep nfs > /dev/null && umount $mntpoint for i in `jot 100`; do - mount -t nfs -o tcp -o retrycnt=3 -o intr -o soft -o rw 127.0.0.1:/tmp $mntpoint + mount -t nfs -o tcp -o retrycnt=3 -o intr -o soft -o rw $nfs_export $mntpoint + sleep 1 for j in `jot 50`; do -# sh -c "lockf -t 10 $mntpoint/$0.$$.$j sleep 3" & lockf -t 10 $mntpoint/$0.$$.$j sleep 3 & done while mount | grep -q ${mntpoint}; do umount -f $mntpoint > /dev/null 2>&1 done - for j in `jot 50`; do - wait - done + wait done Modified: user/pho/stress2/misc/mountu.sh ============================================================================== --- user/pho/stress2/misc/mountu.sh Tue Jan 6 07:37:33 2015 (r276739) +++ user/pho/stress2/misc/mountu.sh Tue Jan 6 07:41:30 2015 (r276740) @@ -68,22 +68,25 @@ done mdconfig -d -u $mdstart -mount -t nfs -o tcp -o retrycnt=3 -o intr -o soft -o rw 127.0.0.1:/tmp $mntpoint -rm -f /tmp/file -/tmp/mountu $mntpoint/file & -sleep 1 +if ping -c 2 `echo $nfs_export | sed 's/:.*//'` > /dev/null 2>&1; then + mount -t nfs -o tcp -o retrycnt=3 -o intr -o soft -o rw $nfs_export \ + $mntpoint + rm -f /tmp/file + /tmp/mountu $mntpoint/file & + sleep 1 -if ! mount -u -o ro $mntpoint 2>&1 | grep -q "Device busy"; then - echo "NFS FAILED" + if ! mount -u -o ro $mntpoint 2>&1 | grep -q "Device busy"; then + echo "NFS FAILED" + fi + wait + umount $mntpoint fi -wait -umount $mntpoint if [ -x /sbin/mount_msdosfs ]; then mdconfig -a -t swap -s 100m -u $mdstart bsdlabel -w md${mdstart} auto - newfs_msdos -F 16 -b 8192 /dev/md${mdstart}a > /dev/null 2>&1 - mount_msdosfs -m 777 /dev/md${mdstart}a $mntpoint + newfs_msdos -F 16 -b 8192 /dev/md${mdstart}$part > /dev/null 2>&1 + mount_msdosfs -m 777 /dev/md${mdstart}$part $mntpoint /tmp/mountu $mntpoint/file & sleep 1 @@ -149,7 +152,6 @@ main(int argc __unused, char **argv) } err(1, "mmap(1)"); } -// fprintf(stderr, "%s mapped to %p\n", path, p); c = p; ps = getpagesize(); Modified: user/pho/stress2/misc/nfs.sh ============================================================================== --- user/pho/stress2/misc/nfs.sh Tue Jan 6 07:37:33 2015 (r276739) +++ user/pho/stress2/misc/nfs.sh Tue Jan 6 07:41:30 2015 (r276740) @@ -34,8 +34,12 @@ . ../default.cfg +[ -z "$nfs_export" ] && exit 0 +ping -c 2 `echo $nfs_export | sed 's/:.*//'` > /dev/null 2>&1 || + exit 0 + mount | grep "$mntpoint" | grep -q nfs && umount $mntpoint -mount -t nfs -o tcp -o retrycnt=3 -o intr -o soft -o rw 127.0.0.1:/tmp $mntpoint +mount -t nfs -o tcp -o retrycnt=3 -o intr -o soft -o rw $nfs_export $mntpoint export RUNDIR=$mntpoint/stressX export runRUNTIME=10m # Run tests for 10 minutes Modified: user/pho/stress2/misc/nfs12.sh ============================================================================== --- user/pho/stress2/misc/nfs12.sh Tue Jan 6 07:37:33 2015 (r276739) +++ user/pho/stress2/misc/nfs12.sh Tue Jan 6 07:41:30 2015 (r276740) @@ -36,7 +36,9 @@ . ../default.cfg -grep -q $mntpoint /etc/exports || { echo "$mntpoint missing from /etc/exports"; exit 0; } +[ -z "$nfs_export" ] && exit 0 +ping -c 2 `echo $nfs_export | sed 's/:.*//'` > /dev/null 2>&1 || + exit 0 here=`pwd` cd /tmp @@ -49,7 +51,8 @@ mount | grep "on $mntpoint " | grep nfs version="-o nfsv3" # The default [ $# -eq 1 ] && [ "$1" -eq 4 ] && version="-o nfsv4" for i in `jot 10`; do - mount -t nfs $version -o tcp -o retrycnt=3 -o intr -o soft -o rw 127.0.0.1:/tmp $mntpoint + mount -t nfs $version -o tcp -o retrycnt=3 -o intr -o soft -o rw \ + $nfs_export $mntpoint sleep 2 (cd $mntpoint; /tmp/nfs12 > /dev/null 2>&1) & @@ -144,7 +147,7 @@ main(void) int i; for (i = 0; i < PARALLEL; i++) { - if (fork() == 0) + if (fork() == 0) tmmap(); } Modified: user/pho/stress2/misc/nfs3.sh ============================================================================== --- user/pho/stress2/misc/nfs3.sh Tue Jan 6 07:37:33 2015 (r276739) +++ user/pho/stress2/misc/nfs3.sh Tue Jan 6 07:41:30 2015 (r276740) @@ -34,9 +34,14 @@ . ../default.cfg +[ -z "$nfs_export" ] && exit 0 +ping -c 2 `echo $nfs_export | sed 's/:.*//'` > /dev/null 2>&1 || + exit 0 + [ ! -d $mntpoint ] && mkdir $mntpoint mount | grep "$mntpoint" | grep nfs > /dev/null && umount $mntpoint -mount -t nfs -o tcp -o retrycnt=3 -o intr -o soft -o rw 127.0.0.1:/tmp $mntpoint +mount -t nfs -o tcp -o retrycnt=3 -o intr -o soft -o rw $nfs_export $mntpoint +sleep 1 rm -rf $mntpoint/stressX/* rm -rf /tmp/stressX.control @@ -45,11 +50,11 @@ export RUNDIR=$mntpoint/nfs/stressX export runRUNTIME=1m rm -rf /tmp/stressX.control/* -su $testuser -c "(cd ..; ./run.sh -a > /dev/null 2>&1)" & +su $testuser -c "(cd ..; ./run.sh io.cfg > /dev/null 2>&1)" & sleep 50 -while mount | grep -q $mntpoint; do - umount -f $mntpoint > /dev/null 2>&1 +while mount | grep -q "on $mntpoint "; do + umount -f $mntpoint || sleep 1 done kill -9 $! ../tools/killall.sh Modified: user/pho/stress2/misc/nfs4.sh ============================================================================== --- user/pho/stress2/misc/nfs4.sh Tue Jan 6 07:37:33 2015 (r276739) +++ user/pho/stress2/misc/nfs4.sh Tue Jan 6 07:41:30 2015 (r276740) @@ -34,9 +34,13 @@ . ../default.cfg +[ -z "$nfs_export" ] && exit 0 +ping -c 2 `echo $nfs_export | sed 's/:.*//'` > /dev/null 2>&1 || + exit 0 + [ ! -d $mntpoint ] && mkdir $mntpoint mount | grep "$mntpoint" | grep nfs > /dev/null && umount $mntpoint -mount -t nfs -o tcp -o retrycnt=3 -o intr -o soft -o rw 127.0.0.1:/tmp $mntpoint +mount -t nfs -o tcp -o retrycnt=3 -o intr -o soft -o rw $nfs_export $mntpoint rm -rf $mntpoint/stressX/* rm -rf /tmp/stressX.control Modified: user/pho/stress2/misc/nfs7.sh ============================================================================== --- user/pho/stress2/misc/nfs7.sh Tue Jan 6 07:37:33 2015 (r276739) +++ user/pho/stress2/misc/nfs7.sh Tue Jan 6 07:41:30 2015 (r276740) @@ -34,9 +34,13 @@ . ../default.cfg +[ -z "$nfs_export" ] && exit 0 +ping -c 2 `echo $nfs_export | sed 's/:.*//'` > /dev/null 2>&1 || + exit 0 + [ ! -d $mntpoint ] && mkdir $mntpoint mount | grep "$mntpoint" | grep nfs > /dev/null && umount $mntpoint -mount -t nfs -o nfsv3,tcp,nolockd -o retrycnt=3 -o intr -o soft -o rw 127.0.0.1:/tmp $mntpoint +mount -t nfs -o nfsv3,tcp,nolockd -o retrycnt=3 -o intr -o soft -o rw $nfs_export $mntpoint rm -rf /tmp/stressX.control export RUNDIR=$mntpoint/nfs/stressX Modified: user/pho/stress2/misc/nfs8.sh ============================================================================== --- user/pho/stress2/misc/nfs8.sh Tue Jan 6 07:37:33 2015 (r276739) +++ user/pho/stress2/misc/nfs8.sh Tue Jan 6 07:41:30 2015 (r276740) @@ -35,9 +35,13 @@ . ../default.cfg +[ -z "$nfs_export" ] && exit 0 +ping -c 2 `echo $nfs_export | sed 's/:.*//'` > /dev/null 2>&1 || + exit 0 + [ ! -d $mntpoint ] && mkdir $mntpoint mount | grep "$mntpoint" | grep nfs > /dev/null && umount $mntpoint -mount -t nfs -o nfsv3,tcp,nolockd -o retrycnt=3 -o intr -o soft -o rw 127.0.0.1:/tmp $mntpoint +mount -t nfs -o nfsv3,tcp,nolockd -o retrycnt=3 -o intr -o soft -o rw $nfs_export $mntpoint pids="" for i in `jot 10`; do Modified: user/pho/stress2/misc/nfs9.sh ============================================================================== --- user/pho/stress2/misc/nfs9.sh Tue Jan 6 07:37:33 2015 (r276739) +++ user/pho/stress2/misc/nfs9.sh Tue Jan 6 07:41:30 2015 (r276740) @@ -39,11 +39,15 @@ . ../default.cfg +[ -z "$nfs_export" ] && exit 0 +ping -c 2 `echo $nfs_export | sed 's/:.*//'` > /dev/null 2>&1 || + exit 0 + [ ! -d $mntpoint ] && mkdir $mntpoint for i in `jot 10`; do mount | grep "on $mntpoint " | grep -q nfs && umount $mntpoint mount -t nfs -o tcp -o retrycnt=3 -o intr -o soft \ - -o rw 127.0.0.1:/tmp $mntpoint + -o rw $nfs_export $mntpoint sleep .5 export RUNDIR=$mntpoint/nfs9/stressX Modified: user/pho/stress2/misc/nfsrename.sh ============================================================================== --- user/pho/stress2/misc/nfsrename.sh Tue Jan 6 07:37:33 2015 (r276739) +++ user/pho/stress2/misc/nfsrename.sh Tue Jan 6 07:41:30 2015 (r276740) @@ -35,6 +35,10 @@ # Test scenario by jhb@ +[ -z "$nfs_export" ] && exit 0 +ping -c 2 `echo $nfs_export | sed 's/:.*//'` > /dev/null 2>&1 || + exit 0 + odir=`pwd` cd /tmp sed '1,/^EOF/d' < $odir/$0 > nfsrename.c @@ -43,7 +47,7 @@ rm -f nfsrename.c cd $odir mount | grep "$mntpoint" | grep nfs > /dev/null && umount $mntpoint -mount -t nfs -o tcp -o retrycnt=3 -o intr -o soft -o rw 127.0.0.1:/tmp $mntpoint +mount -t nfs -o tcp -o retrycnt=3 -o intr -o soft -o rw $nfs_export $mntpoint for i in `jot 10`; do /tmp/nfsrename $mntpoint/nfsrename.$i & Modified: user/pho/stress2/misc/readdir.sh ============================================================================== --- user/pho/stress2/misc/readdir.sh Tue Jan 6 07:37:33 2015 (r276739) +++ user/pho/stress2/misc/readdir.sh Tue Jan 6 07:41:30 2015 (r276740) @@ -63,10 +63,12 @@ mount -t procfs procfs $mntpoint /tmp/readdir $mntpoint umount $mntpoint -echo "Testing nfs" -mount -t nfs -o nfsv3,tcp,nolockd 127.0.0.1:/tmp $mntpoint -/tmp/readdir $mntpoint -umount $mntpoint +if ping -c 2 `echo $nfs_export | sed 's/:.*//'` > /dev/null 2>&1; then + echo "Testing nfs" + mount -t nfs -o nfsv3,tcp,nolockd $nfs_export $mntpoint + /tmp/readdir $mntpoint + umount $mntpoint +fi mdconfig -a -t swap -s 1g -u $mdstart || exit 1 bsdlabel -w md$mdstart auto
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201501060741.t067fVSs043568>