1# Stress Test Suite Configuration. 2 3# Changes should be added to a `hostname` file in this directory. 4# As a minimum you must updated "testuser". 5 6export SHELL=/bin/sh 7: ${allconfig:=/tmp/stress2.d/`hostname`} 8[ -f "$allconfig" ] && . $allconfig # Source in local configuration 9 10# Default values 11export RUNDIR=${RUNDIR:-/tmp/stressX} 12export RUNTIME=${RUNTIME:-2m} 13export VERBOSE=${VERBOSE:-1} 14export LOAD=${LOAD:-20} 15 16# The INCARNATIONS variable may be set to match the number of CPUs and 17# the amount of RAM in the test box. 18export INCARNATIONS=${INCARNATIONS:-20} 19 20export BLASTHOST=${BLASTHOST:-192.168.1.1} # host with udp discard enabled in inetd.conf 21#export nfs_export=somehost:mount # Used by the NFS tests 22 23# Run all test cases: 24export runRUNTIME=${runRUNTIME:-3d} # Run tests for three days 25export runINCARNATIONS=1 26export runLOAD=100 27 28export swapINCARNATIONS=${swapINCARNATIONS:-$((2 * INCARNATIONS))} 29export swapLOAD=${swapLOAD:-80} 30 31export syscallKILL=1 32export swapKILL=1 # May takes a long time to stop 33 34export rwLOAD=${rwLOAD:-70} 35export mkdirLOAD=${mkdirLOAD:-80} 36export creatLOAD=${creatLOAD:-80} 37 38export symlinkLOAD=${symlinkLOAD:-20} 39 40export tcpKILL=1 41export shmINCARNATIONS=${shmINCARNATIONS:-5} 42 43[ -z "$TESTPROGS" ] && export TESTPROGS=" 44testcases/rw/rw 45testcases/swap/swap 46testcases/creat/creat 47testcases/mkdir/mkdir 48testcases/thr1/thr1 49testcases/udp/udp 50testcases/tcp/tcp 51" 52 53# 54# Defaults for ./misc tests 55# 56 57export diskimage=${diskimage:-/tmp/diskimage} # Location of 1G disk image 58export mntpoint=${mntpoint:-/mnt} # Disk image mount point 59export testuser=${testuser:-TBD} # Name of non root test user 60export mdstart=${mdstart:-10} # Start of free md units 61export newfs_flags=${newfs_flags:-"-U"} # Default file system flags 62export stress2origin=${stress2origin:-`pwd`} 63export stress2tools=`dirname $stress2origin`/tools 64 65# fsck wrapper 66checkfs () { 67 local s 68 69 fsck -t ufs -fy $1 > /tmp/fsck.log 2>&1 70 if grep -v "IS CLEAN" /tmp/fsck.log | \ 71 LANG=C egrep -q "[A-Z][A-Z]"; then 72 echo "fsck -t ufs -fy $1" 73 cat /tmp/fsck.log 74 s=1 75 else 76 rm -f /tmp/fsck.log 77 s=0 78 fi 79 return $s 80} 81 82# Support for pre-build binaries for stress2/misc tests 83# Build modes: 84# 1 Build and copy binary to $STRESS2BIN 85# 2 Do not compile; use binary from $STRESS2BIN 86 87# Examples: 88# BMODE=1 ./all.sh -on `grep -lw mycc *.sh` 89# BMODE=2 STRESS2BIN=/home/pho/stress2/bin.i386.r276368 ./all.sh 90 91CC=${CC:-cc} 92top=`dirname $(pwd)` # cwd for the all.sh script 93STRESS2BIN=${STRESS2BIN:-$top/bin} 94mycc () { # "-o" must be first argument 95 local file 96 97 [ "$1" = "-o" ] && file=`basename $2` 98 if [ "$BMODE" = "1" ]; then 99 $CC $@ || return 100 [ -z "$file" ] && return # "-c" 101 [ -d $STRESS2BIN ] || mkdir $STRESS2BIN 102 [ -x $STRESS2BIN/$file ] && 103 echo "Overwriting $STRESS2BIN/$file" 104 echo "cp $2 $STRESS2BIN" 105 cp $2 $STRESS2BIN 106 exit 0 # Build but do not run the test 107 elif [ "$BMODE" = "2" ]; then 108 [ -z "$file" ] && return 109 if [ ! -x $STRESS2BIN/$file ]; then 110 echo "$STRESS2BIN/$file not found" 111 exit 1 112 fi 113 echo "Using binary $STRESS2BIN/$file" 114 cp $STRESS2BIN/$file /tmp 115 else 116 $CC $@ # default "build and run" mode 117 fi 118} 119 120id $testuser > /dev/null 2>&1 || 121 { echo "Non-root \$testuser \"$testuser\" not found."; exit 1; } 122