1 # Stress Test Suite Configuration.
3 # Changes should be added to a `hostname` file in this directory.
4 # As a minimum you must updated "testuser".
7 : ${allconfig:=/tmp/stress2.d/`hostname`}
8 [ -f "$allconfig" ] && . $allconfig # Source in local configuration
11 export RUNDIR=${RUNDIR:-/tmp/stressX}
12 export RUNTIME=${RUNTIME:-2m}
13 export VERBOSE=${VERBOSE:-1}
14 export LOAD=${LOAD:-20}
16 # The INCARNATIONS variable may be set to match the number of CPUs and
17 # the amount of RAM in the test box.
18 export INCARNATIONS=${INCARNATIONS:-20}
20 export 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
24 export runRUNTIME=${runRUNTIME:-3d} # Run tests for three days
25 export runINCARNATIONS=1
28 export swapINCARNATIONS=${swapINCARNATIONS:-$((2 * INCARNATIONS))}
29 export swapLOAD=${swapLOAD:-80}
32 export swapKILL=1 # May takes a long time to stop
34 export rwLOAD=${rwLOAD:-70}
35 export mkdirLOAD=${mkdirLOAD:-80}
36 export creatLOAD=${creatLOAD:-80}
38 export symlinkLOAD=${symlinkLOAD:-20}
41 export shmINCARNATIONS=${shmINCARNATIONS:-5}
43 [ -z "$TESTPROGS" ] && export TESTPROGS="
54 # Defaults for ./misc tests
57 export diskimage=${diskimage:-/tmp/diskimage} # Location of 1G disk image
58 export mntpoint=${mntpoint:-/mnt} # Disk image mount point
59 export testuser=${testuser:-TBD} # Name of non root test user
60 export mdstart=${mdstart:-10} # Start of free md units
61 export part=${part:-a} # Partition to use on a md FS
62 export newfs_flags=${newfs_flags:-"-U"} # Default file system flags
63 export stress2origin=${stress2origin:-`pwd`}
64 export stress2tools=`dirname $stress2origin`/tools
70 fsck -t ufs -fy $1 > /tmp/fsck.log 2>&1
71 if grep -v "IS CLEAN" /tmp/fsck.log | \
72 LANG=C egrep -q "[A-Z][A-Z]"; then
73 echo "fsck -t ufs -fy $1"
83 # Support for pre-build binaries for stress2/misc tests
85 # 1 Build and copy binary to $STRESS2BIN
86 # 2 Do not compile; use binary from $STRESS2BIN
89 # BMODE=1 ./all.sh -on `grep -lw mycc *.sh`
90 # BMODE=2 STRESS2BIN=/home/pho/stress2/bin.i386.r276368 ./all.sh
93 top=`dirname $(pwd)` # cwd for the all.sh script
94 STRESS2BIN=${STRESS2BIN:-$top/bin}
95 mycc () { # "-o" must be first argument
98 [ "$1" = "-o" ] && file=`basename $2`
99 if [ "$BMODE" = "1" ]; then
101 [ -z "$file" ] && return # "-c"
102 [ -d $STRESS2BIN ] || mkdir $STRESS2BIN
103 [ -x $STRESS2BIN/$file ] &&
104 echo "Overwriting $STRESS2BIN/$file"
105 echo "cp $2 $STRESS2BIN"
107 exit 0 # Build but do not run the test
108 elif [ "$BMODE" = "2" ]; then
109 [ -z "$file" ] && return
110 if [ ! -x $STRESS2BIN/$file ]; then
111 echo "$STRESS2BIN/$file not found"
114 echo "Using binary $STRESS2BIN/$file"
115 cp $STRESS2BIN/$file /tmp
117 $CC $@ # default "build and run" mode
121 id $testuser > /dev/null 2>&1 ||
122 { echo "Non-root \$testuser \"$testuser\" not found."; exit 1; }