alaffin | 802d3e3 | 2000-08-23 20:04:23 +0000 | [diff] [blame] | 1 | #!/bin/sh |
iyermanoj | 1d9a963 | 2003-10-07 17:17:00 +0000 | [diff] [blame] | 2 | ################################################################################ |
| 3 | ## ## |
| 4 | ## Copyright (c) International Business Machines Corp., 2001 ## |
| 5 | ## ## |
| 6 | ## This program is free software; you can redistribute it and#or modify ## |
| 7 | ## it under the terms of the GNU General Public License as published by ## |
| 8 | ## the Free Software Foundation; either version 2 of the License, or ## |
| 9 | ## (at your option) any later version. ## |
| 10 | ## ## |
| 11 | ## This program is distributed in the hope that it will be useful, but ## |
| 12 | ## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## |
| 13 | ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ## |
| 14 | ## for more details. ## |
| 15 | ## ## |
| 16 | ## You should have received a copy of the GNU General Public License ## |
| 17 | ## along with this program; if not, write to the Free Software ## |
| 18 | ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ## |
| 19 | ## ## |
| 20 | ################################################################################ |
| 21 | # File: runalltests.sh |
| 22 | # |
iyermanoj | 7a30209 | 2003-10-31 07:28:14 +0000 | [diff] [blame] | 23 | # Description: This script can be used to run the testcase in the LTP suite, |
iyermanoj | 1d9a963 | 2003-10-07 17:17:00 +0000 | [diff] [blame] | 24 | # by default it does not run all the testcases like the name |
| 25 | # suggestes but all the tests can be run by using various |
| 26 | # options that the script provides. |
| 27 | # |
| 28 | # Authors: Manoj Iyer - manjo@mail.utexas.edu |
| 29 | # Robbe Williamson - robbiew@us.ibm.com |
| 30 | # |
| 31 | # History: Oct 07 2003 - Modified - Manoj Iyer |
| 32 | # - use functions |
| 33 | # - clean up on script exit |
| 34 | # - error checking etc. |
| 35 | # |
iyermanoj | 7a30209 | 2003-10-31 07:28:14 +0000 | [diff] [blame] | 36 | # Oct 08 2003 - Modified - Manoj Iyer |
| 37 | # - fixed bug in creating results directory |
| 38 | # - all checks should be enlclosed in " " to avoid bash error |
| 39 | # - exit with error if pan is not found in pan directory |
robbiew | 2379611 | 2003-02-05 16:28:37 +0000 | [diff] [blame] | 40 | |
alaffin | 802d3e3 | 2000-08-23 20:04:23 +0000 | [diff] [blame] | 41 | |
iyermanoj | 1d9a963 | 2003-10-07 17:17:00 +0000 | [diff] [blame] | 42 | setup() |
| 43 | { |
| 44 | cd `dirname $0` || \ |
| 45 | { |
| 46 | echo "FATAL: unable to change directory to $(dirname $0)" |
| 47 | exit 1 |
| 48 | } |
| 49 | export LTPROOT=${PWD} |
| 50 | export TMPBASE="/tmp" |
| 51 | export TMP="${TMPBASE}/runalltests-$$" |
| 52 | export PATH="${PATH}:${LTPROOT}/testcases/bin" |
martinjn | fef097c | 2002-07-10 14:08:24 +0000 | [diff] [blame] | 53 | |
iyermanoj | 7a30209 | 2003-10-31 07:28:14 +0000 | [diff] [blame] | 54 | [ -d $LTPROOT/testcases/bin ] || |
iyermanoj | 1d9a963 | 2003-10-07 17:17:00 +0000 | [diff] [blame] | 55 | { |
| 56 | echo "FATAL: Test suite not installed correctly" |
| 57 | echo "INFO: as root user type 'make ; make install'" |
| 58 | exit 1 |
| 59 | } |
iyermanoj | 7a30209 | 2003-10-31 07:28:14 +0000 | [diff] [blame] | 60 | |
| 61 | [ -e $LTPROOT/pan/pan ] || |
| 62 | { |
| 63 | echo "FATAL: Test suite driver 'pan' not found" |
| 64 | echo "INFO: as root user type 'make ; make install'" |
| 65 | exit 1 |
| 66 | } |
iyermanoj | 1d9a963 | 2003-10-07 17:17:00 +0000 | [diff] [blame] | 67 | } |
| 68 | |
alaffin | 802d3e3 | 2000-08-23 20:04:23 +0000 | [diff] [blame] | 69 | |
plars | d05638c | 2002-09-09 18:30:48 +0000 | [diff] [blame] | 70 | usage() |
| 71 | { |
iyermanoj | 1d9a963 | 2003-10-07 17:17:00 +0000 | [diff] [blame] | 72 | cat <<-EOF >&2 |
| 73 | |
| 74 | usage: ./${0##*/} -c [-d TMPDIR] [-f CMDFILE ] [-i # (in Mb)] |
| 75 | [ -l LOGFILE ] [ -o OUTPUTFILE ] [ -m # (in Mb)] -N -n -q |
| 76 | [ -r LTPROOT ] [ -t DURATION ] [ -x INSTANCES ] |
iyermanoj | 0ceb948 | 2002-12-15 22:49:34 +0000 | [diff] [blame] | 77 | |
robbiew | 797ab8c | 2003-02-04 21:04:14 +0000 | [diff] [blame] | 78 | -c Run LTP under additional background CPU load. |
iyermanoj | 1d9a963 | 2003-10-07 17:17:00 +0000 | [diff] [blame] | 79 | -d TMPDIR Directory where temporary files will be created. |
| 80 | -f CMDFILE Execute user defined list of testcases. |
iyermanoj | 99d5570 | 2003-01-29 22:36:21 +0000 | [diff] [blame] | 81 | -h Help. Prints all available options. |
iyermanoj | 1d9a963 | 2003-10-07 17:17:00 +0000 | [diff] [blame] | 82 | -i # (in Mb) Run LTP with a _min_ IO load of # Mb in background. |
| 83 | -l LOGFILE Log results of test in a logfile. |
| 84 | -m # (in Mb) Run LTP with a _min_ memory load of # Mb in background. |
robbiew | 2379611 | 2003-02-05 16:28:37 +0000 | [diff] [blame] | 85 | -N Run all the networking tests. |
robbiew | 2379611 | 2003-02-05 16:28:37 +0000 | [diff] [blame] | 86 | -n Run LTP with network traffic in background. |
iyermanoj | 1d9a963 | 2003-10-07 17:17:00 +0000 | [diff] [blame] | 87 | -o OUTPUTFILE Redirect test output to a file. |
iyermanoj | 6714bb1 | 2003-01-28 20:08:44 +0000 | [diff] [blame] | 88 | -p Human readable format logfiles. |
iyermanoj | 1e77a29 | 2003-01-30 06:29:46 +0000 | [diff] [blame] | 89 | -q Print less verbose output to screen. |
iyermanoj | 1d9a963 | 2003-10-07 17:17:00 +0000 | [diff] [blame] | 90 | -r LTPROOT Fully qualified path where testsuite is installed. |
| 91 | -t DURATION Execute the testsuite for given duration. Examples: |
robbiew | 458cc81 | 2003-03-25 17:00:24 +0000 | [diff] [blame] | 92 | -t 60s = 60 seconds |
| 93 | -t 45m = 45 minutes |
| 94 | -t 24h = 24 hours |
| 95 | -t 2d = 2 days |
| 96 | |
iyermanoj | 1d9a963 | 2003-10-07 17:17:00 +0000 | [diff] [blame] | 97 | -x INSTANCES Run multiple instances of this testsuite. |
plars | d05638c | 2002-09-09 18:30:48 +0000 | [diff] [blame] | 98 | |
robbiew | 797ab8c | 2003-02-04 21:04:14 +0000 | [diff] [blame] | 99 | example: ./${0##*/} -i 1024 -m 128 -p -q -l /tmp/resultlog.$$ -d ${PWD} |
iyermanoj | b299a83 | 2003-03-27 09:21:33 +0000 | [diff] [blame] | 100 | |
iyermanoj | 1d9a963 | 2003-10-07 17:17:00 +0000 | [diff] [blame] | 101 | NOTE: If you do not wish to learn these options use the |
| 102 | "runltp" program instead. |
| 103 | |
| 104 | EOF |
| 105 | exit 0 |
plars | d05638c | 2002-09-09 18:30:48 +0000 | [diff] [blame] | 106 | } |
| 107 | |
iyermanoj | 1d9a963 | 2003-10-07 17:17:00 +0000 | [diff] [blame] | 108 | |
| 109 | main() |
| 110 | { |
| 111 | local CMDFILE="" |
| 112 | local PRETTY_PRT="" |
| 113 | local ALT_DIR=0 |
| 114 | local RUN_NETEST=0 |
| 115 | local QUIET_MODE="" |
| 116 | local NETPIPE=0 |
| 117 | local GENLOAD=0 |
| 118 | local MEMSIZE=0 |
robbiew | e95f741 | 2004-01-13 15:59:38 +0000 | [diff] [blame] | 119 | local DURATION="" |
iyermanoj | 1d9a963 | 2003-10-07 17:17:00 +0000 | [diff] [blame] | 120 | local BYTESIZE=0 |
| 121 | local LOGFILE="" |
| 122 | local SCENFILES="" |
| 123 | local PRETTY_PRT="" |
| 124 | |
| 125 | while getopts cd:f:hi:l:m:Nno:pqr:t:x: arg |
| 126 | do case $arg in |
| 127 | c) |
plars | d8da48a | 2004-05-14 19:24:02 +0000 | [diff] [blame^] | 128 | $LTPROOT/testcases/bin/genload --cpu 1 >/dev/null 2>&1 & |
iyermanoj | 1d9a963 | 2003-10-07 17:17:00 +0000 | [diff] [blame] | 129 | GENLOAD=1 ;; |
| 130 | |
| 131 | d) # append $$ to TMP, as it is recursively |
iyermanoj | 1e45bef | 2003-01-26 20:38:45 +0000 | [diff] [blame] | 132 | # removed at end of script. |
robbiew | 8cf5934 | 2003-08-12 21:14:53 +0000 | [diff] [blame] | 133 | TMPBASE=$OPTARG |
| 134 | TMP="${TMPBASE}/runalltests-$$";; |
iyermanoj | 1d9a963 | 2003-10-07 17:17:00 +0000 | [diff] [blame] | 135 | f) # Execute user defined set of testcases. |
| 136 | CMDFILE=$OPTARG;; |
iyermanoj | 1e45bef | 2003-01-26 20:38:45 +0000 | [diff] [blame] | 137 | |
iyermanoj | 1d9a963 | 2003-10-07 17:17:00 +0000 | [diff] [blame] | 138 | h) usage;; |
| 139 | |
| 140 | i) |
| 141 | BYTESIZE=$(($OPTARG * 1024 * 1024)) |
plars | d8da48a | 2004-05-14 19:24:02 +0000 | [diff] [blame^] | 142 | $LTPROOT/testcases/bin/genload --io 1 >/dev/null 2>&1 & |
| 143 | $LTPROOT/testcases/bin/genload --hdd 0 --hdd-bytes $BYTESIZE \ |
iyermanoj | 1d9a963 | 2003-10-07 17:17:00 +0000 | [diff] [blame] | 144 | >/dev/null 2>&1 & |
| 145 | GENLOAD=1 ;; |
| 146 | |
| 147 | l) |
iyermanoj | 7a30209 | 2003-10-31 07:28:14 +0000 | [diff] [blame] | 148 | |
plars | 8119465 | 2003-12-30 19:57:47 +0000 | [diff] [blame] | 149 | echo "INFO: creating $LTPROOT/results directory" |
iyermanoj | 7a30209 | 2003-10-31 07:28:14 +0000 | [diff] [blame] | 150 | [ ! -d $LTPROOT/results ] && \ |
| 151 | { |
| 152 | mkdir -p $LTPROOT/results || \ |
| 153 | { |
| 154 | echo "ERROR: failed to create $LTPROOT/results" |
| 155 | exit 1 |
iyermanoj | 1d9a963 | 2003-10-07 17:17:00 +0000 | [diff] [blame] | 156 | } |
iyermanoj | 7a30209 | 2003-10-31 07:28:14 +0000 | [diff] [blame] | 157 | } |
| 158 | case $OPTARG in |
plars | 8119465 | 2003-12-30 19:57:47 +0000 | [diff] [blame] | 159 | /*) |
| 160 | LOGFILE="-l $OPTARG" ;; |
iyermanoj | 7a30209 | 2003-10-31 07:28:14 +0000 | [diff] [blame] | 161 | *) |
iyermanoj | 1d9a963 | 2003-10-07 17:17:00 +0000 | [diff] [blame] | 162 | LOGFILE="-l $LTPROOT/results/$OPTARG" |
| 163 | ALT_DIR=1 ;; |
| 164 | esac ;; |
| 165 | |
| 166 | m) |
| 167 | MEMSIZE=$(($OPTARG * 1024 * 1024)) |
plars | d8da48a | 2004-05-14 19:24:02 +0000 | [diff] [blame^] | 168 | $LTPROOT/testcases/bin/genload --vm 0 --vm-bytes $MEMSIZE \ |
iyermanoj | 1d9a963 | 2003-10-07 17:17:00 +0000 | [diff] [blame] | 169 | >/dev/null 2>&1 & |
| 170 | GENLOAD=1;; |
| 171 | |
| 172 | N) RUN_NETEST=1;; |
| 173 | |
| 174 | n) |
plars | ae2dd10 | 2003-12-30 21:12:27 +0000 | [diff] [blame] | 175 | $LTPROOT/testcases/bin/netpipe.sh |
iyermanoj | 1d9a963 | 2003-10-07 17:17:00 +0000 | [diff] [blame] | 176 | NETPIPE=1;; |
| 177 | |
| 178 | o) OUTPUTFILE="-o $OPTARG" ;; |
| 179 | |
| 180 | p) PRETTY_PRT=" -p ";; |
| 181 | |
| 182 | q) QUIET_MODE=" -q ";; |
| 183 | |
| 184 | r) LTPROOT=$OPTARG;; |
| 185 | |
| 186 | t) # In case you want to specify the time |
iyermanoj | 1e45bef | 2003-01-26 20:38:45 +0000 | [diff] [blame] | 187 | # to run from the command line |
| 188 | # (2m = two minutes, 2h = two hours, etc) |
iyermanoj | 1d9a963 | 2003-10-07 17:17:00 +0000 | [diff] [blame] | 189 | DURATION="-t $OPTARG" ;; |
| 190 | |
| 191 | x) # number of ltp's to run |
| 192 | cat <<-EOF >&1 |
| 193 | WARNING: The use of -x can cause unpredictable failures, as a |
| 194 | result of concurrently running multiple tests designed |
| 195 | to be ran exclusively. |
| 196 | Pausing for 10 seconds..." |
| 197 | EOF |
| 198 | sleep 10 |
| 199 | INSTANCES="-x $OPTARG -O ${TMP}";; |
| 200 | |
| 201 | \?) usage;; |
| 202 | esac |
| 203 | done |
| 204 | |
| 205 | mkdir -p $TMP || \ |
| 206 | { |
| 207 | echo "FATAL: Unable to make temporaty directory $TMP" |
| 208 | exit 1 |
| 209 | } |
| 210 | |
| 211 | cd $TMP || \ |
| 212 | { |
| 213 | echo "could not cd ${TMP} ... exiting" |
| 214 | exit 1 |
| 215 | } |
| 216 | |
iyermanoj | 7a30209 | 2003-10-31 07:28:14 +0000 | [diff] [blame] | 217 | [ "$RUN_NETEST" -eq 1 ] && \ |
iyermanoj | 1d9a963 | 2003-10-07 17:17:00 +0000 | [diff] [blame] | 218 | { |
iyermanoj | 7a30209 | 2003-10-31 07:28:14 +0000 | [diff] [blame] | 219 | [ -z "$RHOST" ] || [ -z "$PASSWD" ] && \ |
iyermanoj | 1d9a963 | 2003-10-07 17:17:00 +0000 | [diff] [blame] | 220 | { |
iyermanoj | 7a30209 | 2003-10-31 07:28:14 +0000 | [diff] [blame] | 221 | [ -z "$RHOST" ] && \ |
iyermanoj | 1d9a963 | 2003-10-07 17:17:00 +0000 | [diff] [blame] | 222 | { |
| 223 | echo \ |
| 224 | "INFO: Enter RHOST = 'name of the remote host machine'" |
| 225 | echo -n "-> " |
| 226 | read RHOST |
| 227 | } |
iyermanoj | 0ceb948 | 2002-12-15 22:49:34 +0000 | [diff] [blame] | 228 | |
iyermanoj | 7a30209 | 2003-10-31 07:28:14 +0000 | [diff] [blame] | 229 | [ -z "$PASSWD" ] && \ |
iyermanoj | 1d9a963 | 2003-10-07 17:17:00 +0000 | [diff] [blame] | 230 | { |
| 231 | echo " " |
| 232 | echo \ |
| 233 | "INFO: Enter PASSWD = 'root passwd of the remote host machine'" |
| 234 | echo -n "-> " |
| 235 | read PASSWD |
| 236 | } |
| 237 | export RHOST=$RHOST |
| 238 | export PASSWD=$PASSWD |
| 239 | echo "WARNING: security of $RHOST may be compromised" |
| 240 | } |
| 241 | } |
| 242 | |
| 243 | # If user does not provide a command file select a default set of testcases |
| 244 | # to execute. |
iyermanoj | 7a30209 | 2003-10-31 07:28:14 +0000 | [diff] [blame] | 245 | if [ -z "$CMDFILE" ] |
iyermanoj | 1d9a963 | 2003-10-07 17:17:00 +0000 | [diff] [blame] | 246 | then |
| 247 | cat <<-EOF >&1 |
iyermanoj | 0ceb948 | 2002-12-15 22:49:34 +0000 | [diff] [blame] | 248 | |
iyermanoj | 1d9a963 | 2003-10-07 17:17:00 +0000 | [diff] [blame] | 249 | INFO: no command files were provided, using default, |
| 250 | system calls, memory management, IPC, scheduler |
| 251 | direct io, file system, math and pty tests will |
| 252 | now be executed |
| 253 | |
| 254 | EOF |
plars | d05638c | 2002-09-09 18:30:48 +0000 | [diff] [blame] | 255 | |
iyermanoj | 1d9a963 | 2003-10-07 17:17:00 +0000 | [diff] [blame] | 256 | for SCENFILES in ${LTPROOT}/runtest/syscalls ${LTPROOT}/runtest/fs \ |
| 257 | ${LTPROOT}/runtest/fsx ${LTPROOT}/runtest/dio \ |
| 258 | ${LTPROOT}/runtest/mm ${LTPROOT}/runtest/ipc \ |
| 259 | ${LTPROOT}/runtest/sched ${LTPROOT}/runtest/math \ |
robbiew | 2466005 | 2004-03-18 16:38:58 +0000 | [diff] [blame] | 260 | ${LTPROOT}/runtest/nptl ${LTPROOT}/runtest/pty |
iyermanoj | 1d9a963 | 2003-10-07 17:17:00 +0000 | [diff] [blame] | 261 | do |
iyermanoj | 7a30209 | 2003-10-31 07:28:14 +0000 | [diff] [blame] | 262 | [ -a "$SCENFILES" ] || \ |
iyermanoj | 1d9a963 | 2003-10-07 17:17:00 +0000 | [diff] [blame] | 263 | { |
| 264 | echo "FATAL: missing scenario file $SCENFILES" |
| 265 | exit 1 |
| 266 | } |
robbiew | 8cf5934 | 2003-08-12 21:14:53 +0000 | [diff] [blame] | 267 | |
iyermanoj | 1d9a963 | 2003-10-07 17:17:00 +0000 | [diff] [blame] | 268 | cat $SCENFILES >> ${TMP}/alltests || \ |
| 269 | { |
| 270 | echo "FATAL: unable to create command file" |
| 271 | exit 1 |
| 272 | } |
| 273 | done |
| 274 | else |
| 275 | cat $CMDFILE > ${TMP}/alltests || \ |
| 276 | { |
| 277 | echo "FATAL: Unable to create command file" |
| 278 | exit 1 |
| 279 | } |
| 280 | fi |
| 281 | |
iyermanoj | 7a30209 | 2003-10-31 07:28:14 +0000 | [diff] [blame] | 282 | [ "$RUN_NETEST" -eq 1 ] && \ |
iyermanoj | 1d9a963 | 2003-10-07 17:17:00 +0000 | [diff] [blame] | 283 | { |
| 284 | for SCENFILES in ${LTPROOT}/runtest/tcp_cmds \ |
| 285 | ${LTPROOT}/runtest/multicast \ |
| 286 | ${LTPROOT}/runtest/rpc \ |
| 287 | ${LTPROOT}/runtest/nfs |
| 288 | do |
iyermanoj | 7a30209 | 2003-10-31 07:28:14 +0000 | [diff] [blame] | 289 | [ -a "$SCENFILES" ] || \ |
iyermanoj | 1d9a963 | 2003-10-07 17:17:00 +0000 | [diff] [blame] | 290 | { |
| 291 | echo "FATAL: missing scenario file $SCENFILES" |
| 292 | exit 1 |
| 293 | } |
| 294 | |
| 295 | cat $SCENFILES >> ${TMP}/alltests || \ |
| 296 | { |
| 297 | echo "FATAL: unable to create command file" |
| 298 | exit 1 |
| 299 | } |
| 300 | done |
| 301 | } |
| 302 | |
| 303 | # The fsx-linux tests use the SCRATCHDEV environment variable as a location |
| 304 | # that can be reformatted and run on. Set SCRATCHDEV if you want to run |
| 305 | # these tests. As a safeguard, this is disabled. |
| 306 | unset SCRATCHDEV |
| 307 | [ -n "$SCRATCHDEV" ] && \ |
| 308 | { |
| 309 | cat ${LTPROOT}/runtest/fsx >> ${TMP}/alltests || |
| 310 | { |
| 311 | echo "FATAL: unable to create fsx-linux tests command file" |
| 312 | exit 1 |
| 313 | } |
| 314 | } |
| 315 | |
| 316 | # check for required users and groups |
| 317 | ${LTPROOT}/IDcheck.sh &>/dev/null || \ |
| 318 | { |
| 319 | echo "WARNING: required users and groups not present" |
| 320 | echo "WARNING: some test cases may fail" |
| 321 | } |
| 322 | |
| 323 | # display versions of installed software |
iyermanoj | 7a30209 | 2003-10-31 07:28:14 +0000 | [diff] [blame] | 324 | [ -z "$QUIET_MODE" ] && \ |
iyermanoj | 1d9a963 | 2003-10-07 17:17:00 +0000 | [diff] [blame] | 325 | { |
| 326 | ${LTPROOT}/ver_linux || \ |
| 327 | { |
| 328 | echo "WARNING: unable to display versions of software installed" |
| 329 | exit 1 |
| 330 | } |
| 331 | } |
robbiew | 8cf5934 | 2003-08-12 21:14:53 +0000 | [diff] [blame] | 332 | |
iyermanoj | 7a30209 | 2003-10-31 07:28:14 +0000 | [diff] [blame] | 333 | [ ! -z "$QUIET_MODE" ] && { echo "INFO: Test start time: $(date)" ; } |
iyermanoj | 1d9a963 | 2003-10-07 17:17:00 +0000 | [diff] [blame] | 334 | ${LTPROOT}/pan/pan $QUIET_MODE -e -S $INSTANCES $DURATION -a $$ \ |
| 335 | -n $$ $PRETTY_PRT -f ${TMP}/alltests $LOGFILE $OUTPUTFILE |
| 336 | |
| 337 | if [ $? -eq 0 ]; then |
| 338 | echo "INFO: pan reported all tests PASS" |
robbiew | 2e27e83 | 2004-04-20 15:30:27 +0000 | [diff] [blame] | 339 | VALUE=0 |
iyermanoj | 1d9a963 | 2003-10-07 17:17:00 +0000 | [diff] [blame] | 340 | else |
| 341 | echo "INFO: pan reported some tests FAIL" |
robbiew | 2e27e83 | 2004-04-20 15:30:27 +0000 | [diff] [blame] | 342 | VALUE=1 |
iyermanoj | 1d9a963 | 2003-10-07 17:17:00 +0000 | [diff] [blame] | 343 | fi |
iyermanoj | 7a30209 | 2003-10-31 07:28:14 +0000 | [diff] [blame] | 344 | [ ! -z "$QUIET_MODE" ] && { echo "INFO: Test end time: $(date)" ; } |
iyermanoj | 1d9a963 | 2003-10-07 17:17:00 +0000 | [diff] [blame] | 345 | |
iyermanoj | 7a30209 | 2003-10-31 07:28:14 +0000 | [diff] [blame] | 346 | [ "$GENLOAD" -eq 1 ] && { killall -9 genload ; } |
| 347 | [ "$NETPIPE" -eq 1 ] && { killall -9 NPtcp ; } |
iyermanoj | 1d9a963 | 2003-10-07 17:17:00 +0000 | [diff] [blame] | 348 | |
iyermanoj | 7a30209 | 2003-10-31 07:28:14 +0000 | [diff] [blame] | 349 | [ "$ALT_DIR" -eq 1 ] && \ |
iyermanoj | 1d9a963 | 2003-10-07 17:17:00 +0000 | [diff] [blame] | 350 | { |
| 351 | cat <<-EOF >&1 |
| 352 | |
| 353 | ###############################################################" |
| 354 | |
| 355 | Done executing testcases." |
| 356 | result log is in the $LTPROOT/results directory" |
| 357 | |
| 358 | ###############################################################" |
| 359 | |
| 360 | EOF |
| 361 | } |
robbiew | 2e27e83 | 2004-04-20 15:30:27 +0000 | [diff] [blame] | 362 | exit $VALUE |
iyermanoj | 1d9a963 | 2003-10-07 17:17:00 +0000 | [diff] [blame] | 363 | } |
alaffin | 802d3e3 | 2000-08-23 20:04:23 +0000 | [diff] [blame] | 364 | |
iyermanoj | 1d9a963 | 2003-10-07 17:17:00 +0000 | [diff] [blame] | 365 | cleanup() |
| 366 | { |
| 367 | rm -rf ${TMP} |
| 368 | } |
alaffin | 879684a | 2000-09-20 18:41:17 +0000 | [diff] [blame] | 369 | |
iyermanoj | 1d9a963 | 2003-10-07 17:17:00 +0000 | [diff] [blame] | 370 | trap "cleanup" 0 |
| 371 | setup |
| 372 | main "$@" |