]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - tools/test/stress2/default.cfg
zfs: merge openzfs/zfs@4a1195ca5 (master) into main
[FreeBSD/FreeBSD.git] / tools / test / stress2 / default.cfg
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
6 export SHELL=/bin/sh
7 : ${allconfig:=/tmp/stress2.d/`hostname`}
8 [ -f  "$allconfig" ] && .  $allconfig   # Source in local configuration
9
10 # Default values
11 export RUNDIR=${RUNDIR:-/tmp/stressX}
12 export RUNTIME=${RUNTIME:-2m}
13 export VERBOSE=${VERBOSE:-1}
14 export 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.
18 export INCARNATIONS=${INCARNATIONS:-20}
19
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
22
23 # Run all test cases:
24 export runRUNTIME=${runRUNTIME:-3d}     # Run tests for three days
25 export runINCARNATIONS=1
26 export runLOAD=100
27
28 export swapINCARNATIONS=${swapINCARNATIONS:-$((2 * INCARNATIONS))}
29 export swapLOAD=${swapLOAD:-80}
30
31 export syscallKILL=1
32 export swapKILL=1                       # May takes a long time to stop
33
34 export rwLOAD=${rwLOAD:-70}
35 export mkdirLOAD=${mkdirLOAD:-80}
36 export creatLOAD=${creatLOAD:-80}
37
38 export symlinkLOAD=${symlinkLOAD:-20}
39
40 export tcpKILL=1
41 export shmINCARNATIONS=${shmINCARNATIONS:-5}
42
43 [ -z "$TESTPROGS" ] && export TESTPROGS="
44 testcases/rw/rw
45 testcases/swap/swap
46 testcases/creat/creat
47 testcases/mkdir/mkdir
48 testcases/thr1/thr1
49 testcases/udp/udp
50 testcases/tcp/tcp
51 "
52
53 #
54 # Defaults for ./misc tests
55 #
56
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
65
66 # fsck wrapper
67 checkfs () {
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
92 CC=${CC:-cc}
93 top=`dirname $(pwd)`    # cwd for the all.sh script
94 STRESS2BIN=${STRESS2BIN:-$top/bin}
95 mycc () {       # "-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
121 id $testuser > /dev/null 2>&1 ||
122     { echo "Non-root \$testuser \"$testuser\" not found."; exit 1; }