Index: user/pho/stress2/default.cfg =================================================================== --- user/pho/stress2/default.cfg (revision 292865) +++ user/pho/stress2/default.cfg (revision 292866) @@ -1,127 +1,128 @@ # $FreeBSD$ # Stress Test Suite Configuration # Default values export RUNDIR=${RUNDIR:-/tmp/stressX} export RUNTIME=${RUNTIME:-2m} export VERBOSE=${VERBOSE:-1} export LOAD=20 # The INCARNATIONS variable should be set to match the number of CPUs and # the amount of RAM in the test box. # 10 for a 1,8 GHz Celeron with 256 Mb of RAM # 100 for a dual Xeon 1,8 GHz with 1024 Gb of RAM 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 export runINCARNATIONS=1 export runLOAD=100 export swapINCARNATIONS=${swapINCARNATIONS:-$((2 * INCARNATIONS))} export swapLOAD=80 export syscallKILL=1 export swapKILL=1 # May takes a long time to stop export rwLOAD=70 export mkdirLOAD=80 export creatLOAD=80 export symlinkLOAD=20 export tcpKILL=1 #export shmKILL=1 export shmINCARNATIONS=5 export TESTPROGS=" testcases/rw/rw testcases/swap/swap testcases/creat/creat testcases/mkdir/mkdir testcases/thr1/thr1 testcases/udp/udp testcases/tcp/tcp " # # Defaults for ./misc tests # diskimage=/var/tmp/diskimage # Location of 1G disk image mntpoint=/mnt # Disk image mount point testuser=pho # Name of non root test user mdstart=5 # Start of free md units part=a # partition to use on a md FS newfs_flags="-U" # default file system flags +export stress2origin=${stress2origin:-`pwd`} # Wrapper for dd dede () { # file, blocksize, count local log=/tmp/$0.$$ dd if=/dev/zero of=$1 bs=$2 count=$3 > $log 2>&1 local status=$? egrep -v "records in|records out|bytes transferred" $log rm -f $log return $status } # fsck and dumpfs comparison checkfs () { dumpfs $1 | sed '/UFS2/s/..:..:../xx:xx:xx/' > /tmp/dumpfs.1 sleep 1 fsck -t ufs -y $1 > /tmp/fsck.log 2>&1 dumpfs $1 | sed '/UFS2/s/..:..:../xx:xx:xx/' > /tmp/dumpfs.2 if egrep -q "INCONSISTENCY|MODIFIED" /tmp/fsck.log || ! cmp -s /tmp/dumpfs.1 /tmp/dumpfs.2; then diff -c /tmp/dumpfs.1 /tmp/dumpfs.2 echo "fsck -t ufs -y $1" cat /tmp/fsck.log else rm -f /tmp/fsck.log /tmp/dumpfs.[12] fi } # Support for pre-build binaries for stress2/misc tests # Build modes: # 1 Build and copy binary to $STRESS2BIN # 2 Do not compile; use binary from $STRESS2BIN # Examples: # BMODE=1 ./all.sh -on `grep -lw mycc *.sh` # BMODE=2 STRESS2BIN=/home/pho/stress2/bin.i386.r276368 ./all.sh CC=${CC:-cc} top=`dirname $(pwd)` # cwd for the all.sh script STRESS2BIN=${STRESS2BIN:-$top/bin} mycc () { # "-o" must be first argument [ "$1" = "-o" ] && file=`basename $2` if [ "$BMODE" = "1" ]; then $CC $@ || return [ -z "$file" ] && return # "-c" [ -d $STRESS2BIN ] || mkdir $STRESS2BIN [ -x $STRESS2BIN/$file ] && echo "Overwriting $STRESS2BIN/$file" echo "cp $2 $STRESS2BIN" cp $2 $STRESS2BIN elif [ "$BMODE" = "2" ]; then [ -z "$file" ] && return if [ ! -x $STRESS2BIN/$file ]; then echo "$STRESS2BIN/$file not found" exit 1 fi echo "Using binary $STRESS2BIN/$file" cp $STRESS2BIN/$file /tmp else $CC $@ # default "build and run" mode fi } [ -f "./`hostname`" ] && . "./`hostname`" # source in local configuration [ -f "../`hostname`" ] && . "../`hostname`" # source in local configuration Index: user/pho/stress2/run.sh =================================================================== --- user/pho/stress2/run.sh (revision 292865) +++ user/pho/stress2/run.sh (revision 292866) @@ -1,81 +1,82 @@ #!/bin/sh # # Copyright (c) 2008 Peter Holm # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # # $FreeBSD$ # # Run 1) with no argument: the default test cases # 2) with the "-a" arguments all the *.cfg test variations # 3) with one argument: that specific test case while getopts a name; do case $name in a) aflag=1;; ?) printf "Usage: %s: [-a] [arg]\n" $0 exit 2;; esac done shift $(($OPTIND - 1)) -pgrep -fq all.sh || - echo "Note: all.sh in stress2/misc is the preferred test to run." +[ `basename ${stress2origin:-X}` != misc ] && + echo "Note: all.sh in stress2/misc is the preferred test to run." \ + 1>&2 if [ ! -z "$aflag" ]; then . ./default.cfg export runRUNTIME=5m t1=`date '+%s'` while true;do for i in `ls *.cfg | grep -v default`; do t2=`date '+%s'` e=` date -u -j -f '%s' '+%T' $((t2 - t1))` echo "`date '+%Y%m%d %T'` $i, elapsed $e" echo "`date '+%Y%m%d %T'` $i, elapsed $e" >> /tmp/all.log logger "Starting test $i" [ -w /dev/console ] && printf "`date '+%Y%m%d %T'` run $i\r\n" > /dev/console $0 $i done done else CONFIG=./default.cfg if [ $# -eq 1 ]; then [ ! -r $1 ] && echo "$0: $1 not found!" && exit 1 CONFIG=$1 fi . $CONFIG [ -z "$RUNDIR" ] && echo "$0: RUNDIR is unset!" && exit 1 [ `basename $RUNDIR` != stressX ] && \ echo "$0: Basename of RUNDIR must be stressX!" && exit 2 [ -d "$RUNDIR" ] && (cd $RUNDIR && find . -delete) [ -z "$EXCLUDETESTS" ] && EXCLUDETESTS=DuMmY [ -z "$TESTPROGS" ] && \ TESTPROGS=`find testcases/ -perm -1 -type f | egrep -v "/run/|$EXCLUDETESTS"` #LD_PRELOAD=/usr/local/lib/libefence.so.0 ./testcases/run/run $TESTPROGS ./testcases/run/run $TESTPROGS fi