xref: /freebsd/tools/test/stress2/default.cfg (revision 2e3507c25e42292b45a5482e116d278f5515d04d)
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
91BMODE=${BMODE:-0}
92CC=${CC:-cc}
93top=`dirname $(pwd)`	# cwd for the all.sh script
94STRESS2BIN=${STRESS2BIN:-$top/bin}
95mycc () {	# "-o" must be first argument
96	local file
97
98	[ "$1" = "-o" ] && file=`basename $2`
99	if [ "$BMODE" = "1" ]; then
100		$CC $@ || return
101		[ -z "$file" ] && return	# "-c"
102		[ -d $STRESS2BIN ] || mkdir $STRESS2BIN
103		[ -x $STRESS2BIN/$file ] &&
104		    echo "Overwriting $STRESS2BIN/$file"
105		echo "cp $2 $STRESS2BIN"
106		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"
112			exit 1
113		fi
114		echo "Using binary $STRESS2BIN/$file"
115		cp $STRESS2BIN/$file /tmp
116	else
117		$CC $@	# default "build and run" mode
118	fi
119}
120
121id $testuser > /dev/null 2>&1 ||
122    { echo "Non-root \$testuser \"$testuser\" not found."; exit 1; }
123