xref: /freebsd/tools/test/stress2/default.cfg (revision dd41de95a84d979615a2ef11df6850622bf6184e)
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 part=${part:-a}				# Partition to use on a md FS
62export newfs_flags=${newfs_flags:-"-U"}		# Default file system flags
63export stress2origin=${stress2origin:-`pwd`}
64export stress2tools=`dirname $stress2origin`/tools
65
66# fsck wrapper
67checkfs () {
68	local s
69
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"
74		cat /tmp/fsck.log
75		s=1
76	else
77		rm -f /tmp/fsck.log
78		s=0
79	fi
80	return $s
81}
82
83# Support for pre-build binaries for stress2/misc tests
84# Build modes:
85# 1	Build and copy binary to $STRESS2BIN
86# 2	Do not compile; use binary from $STRESS2BIN
87
88# Examples:
89# BMODE=1 ./all.sh -on `grep -lw mycc *.sh`
90# BMODE=2 STRESS2BIN=/home/pho/stress2/bin.i386.r276368 ./all.sh
91
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