mridge | a9e3857 | 2005-04-19 15:48:26 +0000 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | ################################################################################ |
| 3 | ## ## |
| 4 | ## Copyright (c) International Business Machines Corp., 2001,2005 ## |
| 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 ## |
Wanlong Gao | 4548c6c | 2012-10-19 18:03:36 +0800 | [diff] [blame] | 18 | ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ## |
mridge | a9e3857 | 2005-04-19 15:48:26 +0000 | [diff] [blame] | 19 | ## ## |
| 20 | ################################################################################ |
| 21 | # File: runltplite |
| 22 | # |
| 23 | # Description: This script can be used to run a subset the tests in the LTP test suite |
| 24 | # This script is typically used as a quick test to check an install base. |
| 25 | # |
| 26 | # Authors: Manoj Iyer - manoji@us.ibm.com |
| 27 | # Robbie Williamson - robbiew@us.ibm.com |
| 28 | # Marty Ridgeway - mridge@us.ibm.com |
Chris Dearman | 37550cf | 2012-10-17 19:54:01 -0700 | [diff] [blame] | 29 | # |
mridge | a9e3857 | 2005-04-19 15:48:26 +0000 | [diff] [blame] | 30 | # History: Created runltplite script to run a subset of the LTP testsuite |
Chris Dearman | 37550cf | 2012-10-17 19:54:01 -0700 | [diff] [blame] | 31 | # |
| 32 | # |
| 33 | # |
| 34 | # |
| 35 | # |
| 36 | # |
| 37 | # |
| 38 | # |
mridge | a9e3857 | 2005-04-19 15:48:26 +0000 | [diff] [blame] | 39 | |
| 40 | |
| 41 | setup() |
| 42 | { |
| 43 | cd `dirname $0` || \ |
| 44 | { |
| 45 | echo "FATAL: unable to change directory to $(dirname $0)" |
| 46 | exit 1 |
| 47 | } |
| 48 | export LTPROOT=${PWD} |
| 49 | export TMPBASE="/tmp" |
| 50 | export TMP="${TMPBASE}/ltp-$$" |
| 51 | export PATH="${PATH}:${LTPROOT}/testcases/bin" |
| 52 | |
| 53 | [ -d $LTPROOT/testcases/bin ] || |
| 54 | { |
Garrett Cooper | cf86b8b | 2010-11-16 21:46:41 -0800 | [diff] [blame] | 55 | echo "FATAL: LTP not installed correctly" |
| 56 | echo "INFO: Follow directions in INSTALL!" |
mridge | a9e3857 | 2005-04-19 15:48:26 +0000 | [diff] [blame] | 57 | exit 1 |
| 58 | } |
| 59 | |
yaberauneya | ef77253 | 2009-10-09 17:55:43 +0000 | [diff] [blame] | 60 | [ -e $LTPROOT/bin/ltp-pan ] || |
mridge | a9e3857 | 2005-04-19 15:48:26 +0000 | [diff] [blame] | 61 | { |
subrata_modak | 14390fd | 2009-05-19 09:39:11 +0000 | [diff] [blame] | 62 | echo "FATAL: Test suite driver 'ltp-pan' not found" |
Garrett Cooper | cf86b8b | 2010-11-16 21:46:41 -0800 | [diff] [blame] | 63 | echo "INFO: Follow directions in INSTALL!" |
mridge | a9e3857 | 2005-04-19 15:48:26 +0000 | [diff] [blame] | 64 | exit 1 |
| 65 | } |
| 66 | } |
| 67 | |
| 68 | |
Chris Dearman | 37550cf | 2012-10-17 19:54:01 -0700 | [diff] [blame] | 69 | usage() |
mridge | a9e3857 | 2005-04-19 15:48:26 +0000 | [diff] [blame] | 70 | { |
| 71 | cat <<-EOF >&2 |
| 72 | |
Chris Dearman | 37550cf | 2012-10-17 19:54:01 -0700 | [diff] [blame] | 73 | usage: ${0##*/} -c [-d TMPDIR] [-i # (in Mb)] |
| 74 | [ -l LOGFILE ] [ -o OUTPUTFILE ] [ -m # (in Mb)] -N -q |
| 75 | [ -r LTPROOT ] -v |
| 76 | |
mridge | a9e3857 | 2005-04-19 15:48:26 +0000 | [diff] [blame] | 77 | -c NUM_PROCS Run LTP under additional background CPU load. |
| 78 | -d TMPDIR Directory where temporary files will be created. |
| 79 | -h Help. Prints all available options. |
| 80 | -i # (in Mb) Run LTP with a _min_ IO load of # Mb in background. |
| 81 | -l LOGFILE Log results of test in a logfile. |
| 82 | -m # (in Mb) Run LTP with a _min_ memory load of # Mb in background. |
Chris Dearman | 37550cf | 2012-10-17 19:54:01 -0700 | [diff] [blame] | 83 | -N Run all the networking tests. |
mridge | a9e3857 | 2005-04-19 15:48:26 +0000 | [diff] [blame] | 84 | -o OUTPUTFILE Redirect test output to a file. |
Chris Dearman | 37550cf | 2012-10-17 19:54:01 -0700 | [diff] [blame] | 85 | -p Human readable format logfiles. |
mridge | a9e3857 | 2005-04-19 15:48:26 +0000 | [diff] [blame] | 86 | -q Print less verbose output to screen. |
| 87 | -r LTPROOT Fully qualified path where testsuite is installed. |
mridge | a9e3857 | 2005-04-19 15:48:26 +0000 | [diff] [blame] | 88 | |
Garrett Cooper | f95875a | 2010-03-05 02:44:39 -0800 | [diff] [blame] | 89 | example: ${0##*/} -i 1024 -m 128 -p -q -l /tmp/resultlog.$$ -d ${PWD} |
mridge | a9e3857 | 2005-04-19 15:48:26 +0000 | [diff] [blame] | 90 | |
| 91 | |
| 92 | EOF |
| 93 | exit 0 |
| 94 | } |
| 95 | |
| 96 | |
| 97 | main() |
| 98 | { |
| 99 | local CMDFILE="ltplite" |
| 100 | local PRETTY_PRT="" |
| 101 | local ALT_DIR=0 |
| 102 | local RUN_NETEST=0 |
| 103 | local QUIET_MODE="" |
| 104 | local VERBOSE_MODE="" |
| 105 | local NETPIPE=0 |
| 106 | local GENLOAD=0 |
| 107 | local MEMSIZE=0 |
| 108 | local DURATION="" |
| 109 | local BYTESIZE=0 |
| 110 | local LOGFILE="" |
mridge | a9e3857 | 2005-04-19 15:48:26 +0000 | [diff] [blame] | 111 | local PRETTY_PRT="" |
| 112 | local TAG_RESTRICT_STRING="" |
| 113 | local PAN_COMMAND="" |
| 114 | |
Garrett Cooper | cf86b8b | 2010-11-16 21:46:41 -0800 | [diff] [blame] | 115 | local scenfile="" |
| 116 | |
subrata_modak | 8266c29 | 2009-10-13 12:10:13 +0000 | [diff] [blame] | 117 | while getopts c:d:hi:l:m:No:pqr: arg |
mridge | a9e3857 | 2005-04-19 15:48:26 +0000 | [diff] [blame] | 118 | do case $arg in |
Chris Dearman | 37550cf | 2012-10-17 19:54:01 -0700 | [diff] [blame] | 119 | c) |
mridge | a9e3857 | 2005-04-19 15:48:26 +0000 | [diff] [blame] | 120 | NUM_PROCS=$(($OPTARG)) |
| 121 | $LTPROOT/testcases/bin/genload --cpu $NUM_PROCS >/dev/null 2>&1 & |
| 122 | GENLOAD=1 ;; |
Chris Dearman | 37550cf | 2012-10-17 19:54:01 -0700 | [diff] [blame] | 123 | |
| 124 | d) # append $$ to TMP, as it is recursively |
mridge | a9e3857 | 2005-04-19 15:48:26 +0000 | [diff] [blame] | 125 | # removed at end of script. |
| 126 | TMPBASE=$OPTARG |
| 127 | TMP="${TMPBASE}/ltp-$$" |
| 128 | export TMPDIR="$TMP";; |
Chris Dearman | 37550cf | 2012-10-17 19:54:01 -0700 | [diff] [blame] | 129 | |
mridge | a9e3857 | 2005-04-19 15:48:26 +0000 | [diff] [blame] | 130 | h) usage;; |
Chris Dearman | 37550cf | 2012-10-17 19:54:01 -0700 | [diff] [blame] | 131 | |
| 132 | i) |
mridge | a9e3857 | 2005-04-19 15:48:26 +0000 | [diff] [blame] | 133 | BYTESIZE=$(($OPTARG * 1024 * 1024)) |
| 134 | $LTPROOT/testcases/bin/genload --io 1 >/dev/null 2>&1 & |
| 135 | $LTPROOT/testcases/bin/genload --hdd 0 --hdd-bytes $BYTESIZE \ |
Chris Dearman | 37550cf | 2012-10-17 19:54:01 -0700 | [diff] [blame] | 136 | >/dev/null 2>&1 & |
mridge | a9e3857 | 2005-04-19 15:48:26 +0000 | [diff] [blame] | 137 | GENLOAD=1 ;; |
Chris Dearman | 37550cf | 2012-10-17 19:54:01 -0700 | [diff] [blame] | 138 | |
| 139 | l) |
mridge | a9e3857 | 2005-04-19 15:48:26 +0000 | [diff] [blame] | 140 | |
mridge | a9e3857 | 2005-04-19 15:48:26 +0000 | [diff] [blame] | 141 | [ ! -d $LTPROOT/results ] && \ |
| 142 | { |
uid311324 | adebaed | 2009-10-15 21:54:49 +0000 | [diff] [blame] | 143 | echo "INFO: creating $LTPROOT/results directory" |
mridge | a9e3857 | 2005-04-19 15:48:26 +0000 | [diff] [blame] | 144 | mkdir -p $LTPROOT/results || \ |
| 145 | { |
| 146 | echo "ERROR: failed to create $LTPROOT/results" |
| 147 | exit 1 |
| 148 | } |
| 149 | } |
| 150 | case $OPTARG in |
| 151 | /*) |
| 152 | LOGFILE="-l $OPTARG" ;; |
Chris Dearman | 37550cf | 2012-10-17 19:54:01 -0700 | [diff] [blame] | 153 | *) |
mridge | a9e3857 | 2005-04-19 15:48:26 +0000 | [diff] [blame] | 154 | LOGFILE="-l $LTPROOT/results/$OPTARG" |
| 155 | ALT_DIR=1 ;; |
| 156 | esac ;; |
Chris Dearman | 37550cf | 2012-10-17 19:54:01 -0700 | [diff] [blame] | 157 | |
| 158 | m) |
| 159 | MEMSIZE=$(($OPTARG * 1024 * 1024)) |
mridge | a9e3857 | 2005-04-19 15:48:26 +0000 | [diff] [blame] | 160 | $LTPROOT/testcases/bin/genload --vm 0 --vm-bytes $MEMSIZE \ |
Chris Dearman | 37550cf | 2012-10-17 19:54:01 -0700 | [diff] [blame] | 161 | >/dev/null 2>&1 & |
mridge | a9e3857 | 2005-04-19 15:48:26 +0000 | [diff] [blame] | 162 | GENLOAD=1;; |
Chris Dearman | 37550cf | 2012-10-17 19:54:01 -0700 | [diff] [blame] | 163 | |
mridge | a9e3857 | 2005-04-19 15:48:26 +0000 | [diff] [blame] | 164 | N) RUN_NETEST=1;; |
Chris Dearman | 37550cf | 2012-10-17 19:54:01 -0700 | [diff] [blame] | 165 | |
mridge | a9e3857 | 2005-04-19 15:48:26 +0000 | [diff] [blame] | 166 | o) OUTPUTFILE="-o $OPTARG" ;; |
Chris Dearman | 37550cf | 2012-10-17 19:54:01 -0700 | [diff] [blame] | 167 | |
mridge | a9e3857 | 2005-04-19 15:48:26 +0000 | [diff] [blame] | 168 | p) PRETTY_PRT=" -p ";; |
Chris Dearman | 37550cf | 2012-10-17 19:54:01 -0700 | [diff] [blame] | 169 | |
mridge | a9e3857 | 2005-04-19 15:48:26 +0000 | [diff] [blame] | 170 | q) QUIET_MODE=" -q ";; |
Chris Dearman | 37550cf | 2012-10-17 19:54:01 -0700 | [diff] [blame] | 171 | |
mridge | a9e3857 | 2005-04-19 15:48:26 +0000 | [diff] [blame] | 172 | r) LTPROOT=$OPTARG;; |
Chris Dearman | 37550cf | 2012-10-17 19:54:01 -0700 | [diff] [blame] | 173 | |
mridge | a9e3857 | 2005-04-19 15:48:26 +0000 | [diff] [blame] | 174 | \?) usage;; |
| 175 | esac |
| 176 | done |
Chris Dearman | 37550cf | 2012-10-17 19:54:01 -0700 | [diff] [blame] | 177 | |
| 178 | |
mridge | a9e3857 | 2005-04-19 15:48:26 +0000 | [diff] [blame] | 179 | mkdir -p $TMP || \ |
| 180 | { |
| 181 | echo "FATAL: Unable to make temporary directory $TMP" |
| 182 | exit 1 |
| 183 | } |
Chris Dearman | 37550cf | 2012-10-17 19:54:01 -0700 | [diff] [blame] | 184 | |
mridge | a9e3857 | 2005-04-19 15:48:26 +0000 | [diff] [blame] | 185 | cd $TMP || \ |
| 186 | { |
| 187 | echo "could not cd ${TMP} ... exiting" |
| 188 | exit 1 |
| 189 | } |
| 190 | |
| 191 | # Run Networking tests ? |
Chris Dearman | 37550cf | 2012-10-17 19:54:01 -0700 | [diff] [blame] | 192 | |
mridge | a9e3857 | 2005-04-19 15:48:26 +0000 | [diff] [blame] | 193 | [ "$RUN_NETEST" -eq 1 ] && \ |
| 194 | { |
| 195 | [ -z "$RHOST" ] || [ -z "$PASSWD" ] && \ |
| 196 | { |
| 197 | [ -z "$RHOST" ] && \ |
| 198 | { |
| 199 | echo \ |
| 200 | "INFO: Enter RHOST = 'name of the remote host machine'" |
| 201 | echo -n "-> " |
| 202 | read RHOST |
| 203 | } |
| 204 | |
| 205 | [ -z "$PASSWD" ] && \ |
| 206 | { |
| 207 | echo " " |
| 208 | echo \ |
| 209 | "INFO: Enter PASSWD = 'root passwd of the remote host machine'" |
| 210 | echo -n "-> " |
| 211 | read PASSWD |
| 212 | } |
| 213 | export RHOST=$RHOST |
| 214 | export PASSWD=$PASSWD |
| 215 | echo "WARNING: security of $RHOST may be compromised" |
| 216 | } |
| 217 | } |
Chris Dearman | 37550cf | 2012-10-17 19:54:01 -0700 | [diff] [blame] | 218 | |
mridge | a9e3857 | 2005-04-19 15:48:26 +0000 | [diff] [blame] | 219 | # If user does not provide a command file select a default set of testcases |
| 220 | # to execute. |
| 221 | if [ -f $CMDFILE ] || \ |
| 222 | CMDFILE="$LTPROOT/runtest/$CMDFILE" |
| 223 | then |
| 224 | cat $CMDFILE > ${TMP}/alltests || \ |
| 225 | { |
| 226 | echo "FATAL: Unable to create command file" |
| 227 | exit 1 |
| 228 | } |
| 229 | fi |
Garrett Cooper | cf86b8b | 2010-11-16 21:46:41 -0800 | [diff] [blame] | 230 | |
| 231 | if [ "$RUN_NETEST" -eq 1 ]; then |
Garrett Cooper | 89fde87 | 2010-11-16 22:38:08 -0800 | [diff] [blame] | 232 | SCENARIO_LISTS="$SCENARIO_LISTS $LTPROOT/scenario_groups/network" |
Garrett Cooper | cf86b8b | 2010-11-16 21:46:41 -0800 | [diff] [blame] | 233 | fi |
Chris Dearman | 37550cf | 2012-10-17 19:54:01 -0700 | [diff] [blame] | 234 | |
Garrett Cooper | cf86b8b | 2010-11-16 21:46:41 -0800 | [diff] [blame] | 235 | # DO NOT INDENT/DEDENT! |
| 236 | if [ -n "$SCENARIO_LISTS" ]; then |
| 237 | # Insurance to make sure that the first element in the pipe |
| 238 | # completed successfully. |
| 239 | cat_ok_sentinel=$TMP/cat_ok.$$ |
Garrett Cooper | 66d67b5 | 2010-11-16 22:42:48 -0800 | [diff] [blame] | 240 | (cat $SCENARIO_LISTS && touch "$cat_ok_sentinel") | \ |
Garrett Cooper | cf86b8b | 2010-11-16 21:46:41 -0800 | [diff] [blame] | 241 | while read scenfile; do |
| 242 | |
| 243 | scenfile=${LTPROOT}/runtest/$scenfile |
| 244 | |
| 245 | # Skip over non-existent scenario files; things are |
| 246 | # robust enough now that the build will fail if these |
| 247 | # files don't exist. |
| 248 | [ -f "$scenfile" ] || continue |
| 249 | |
| 250 | cat $scenfile >> "$TMP/alltests" || { |
| 251 | echo "FATAL: unable to append to command file" |
| 252 | rm -Rf "$TMP" |
| 253 | rm -f "$cat_ok_sentinel" |
| 254 | exit 1 |
| 255 | } |
| 256 | |
| 257 | done |
| 258 | |
| 259 | rm -f "$cat_ok_sentinel" |
| 260 | |
| 261 | fi |
| 262 | # ^^DO NOT INDENT/DEDENT!^^ |
| 263 | |
mridge | a9e3857 | 2005-04-19 15:48:26 +0000 | [diff] [blame] | 264 | # The fsx-linux tests use the SCRATCHDEV environment variable as a location |
Chris Dearman | 37550cf | 2012-10-17 19:54:01 -0700 | [diff] [blame] | 265 | # that can be reformatted and run on. Set SCRATCHDEV if you want to run |
mridge | a9e3857 | 2005-04-19 15:48:26 +0000 | [diff] [blame] | 266 | # these tests. As a safeguard, this is disabled. |
| 267 | unset SCRATCHDEV |
| 268 | [ -n "$SCRATCHDEV" ] && \ |
| 269 | { |
| 270 | cat ${LTPROOT}/runtest/fsx >> ${TMP}/alltests || |
| 271 | { |
| 272 | echo "FATAL: unable to create fsx-linux tests command file" |
| 273 | exit 1 |
| 274 | } |
| 275 | } |
Chris Dearman | 37550cf | 2012-10-17 19:54:01 -0700 | [diff] [blame] | 276 | |
mridge | a9e3857 | 2005-04-19 15:48:26 +0000 | [diff] [blame] | 277 | # check for required users and groups |
| 278 | ${LTPROOT}/IDcheck.sh &>/dev/null || \ |
| 279 | { |
| 280 | echo "WARNING: required users and groups not present" |
| 281 | echo "WARNING: some test cases may fail" |
| 282 | } |
Chris Dearman | 37550cf | 2012-10-17 19:54:01 -0700 | [diff] [blame] | 283 | |
Garrett Cooper | cf86b8b | 2010-11-16 21:46:41 -0800 | [diff] [blame] | 284 | [ -n "$CMDFILES" ] && \ |
| 285 | { |
| 286 | for scenfile in `echo "$CMDFILES" | tr ',' ' '` |
| 287 | do |
| 288 | [ -f "$scenfile" ] || scenfile="$LTPROOT/runtest/$scenfile" |
| 289 | cat "$scenfile" >> ${TMP}/alltests || \ |
| 290 | { |
| 291 | echo "FATAL: unable to create command file" |
| 292 | rm -Rf "$TMP" |
| 293 | exit 1 |
| 294 | } |
| 295 | done |
| 296 | } |
Chris Dearman | 37550cf | 2012-10-17 19:54:01 -0700 | [diff] [blame] | 297 | |
mridge | a9e3857 | 2005-04-19 15:48:26 +0000 | [diff] [blame] | 298 | # display versions of installed software |
| 299 | [ -z "$QUIET_MODE" ] && \ |
Chris Dearman | 37550cf | 2012-10-17 19:54:01 -0700 | [diff] [blame] | 300 | { |
mridge | a9e3857 | 2005-04-19 15:48:26 +0000 | [diff] [blame] | 301 | ${LTPROOT}/ver_linux || \ |
| 302 | { |
| 303 | echo "WARNING: unable to display versions of software installed" |
| 304 | exit 1 |
Garrett Cooper | cf86b8b | 2010-11-16 21:46:41 -0800 | [diff] [blame] | 305 | } |
mridge | a9e3857 | 2005-04-19 15:48:26 +0000 | [diff] [blame] | 306 | } |
| 307 | |
| 308 | [ ! -z "$QUIET_MODE" ] && { echo "INFO: Test start time: $(date)" ; } |
yaberauneya | ef77253 | 2009-10-09 17:55:43 +0000 | [diff] [blame] | 309 | PAN_COMMAND="${LTPROOT}/bin/ltp-pan $QUIET_MODE -e -S $INSTANCES $DURATION -a $$ \ |
mridge | a9e3857 | 2005-04-19 15:48:26 +0000 | [diff] [blame] | 310 | -n $$ $PRETTY_PRT -f ${TMP}/alltests $LOGFILE $OUTPUTFILE" |
| 311 | if [ ! -z "$VERBOSE_MODE" ] ; then |
| 312 | echo "COMMAND: $PAN_COMMAND" |
| 313 | if [ ! -z "$TAG_RESTRICT_STRING" ] ; then |
| 314 | echo "INFO: Restricted to $TAG_RESTRICT_STRING" |
| 315 | fi |
| 316 | fi |
| 317 | #$PAN_COMMAND #Duplicated code here, because otherwise if we fail, only "PAN_COMMAND" gets output |
subrata_modak | 724098e | 2009-03-19 08:49:18 +0000 | [diff] [blame] | 318 | # Some tests need to run inside the "bin" directory. |
| 319 | cd "${LTPROOT}/testcases/bin" |
yaberauneya | ef77253 | 2009-10-09 17:55:43 +0000 | [diff] [blame] | 320 | ${LTPROOT}/bin/ltp-pan $QUIET_MODE -e -S $INSTANCES $DURATION -a $$ \ |
mridge | a9e3857 | 2005-04-19 15:48:26 +0000 | [diff] [blame] | 321 | -n $$ $PRETTY_PRT -f ${TMP}/alltests $LOGFILE $OUTPUTFILE |
Chris Dearman | 37550cf | 2012-10-17 19:54:01 -0700 | [diff] [blame] | 322 | |
mridge | a9e3857 | 2005-04-19 15:48:26 +0000 | [diff] [blame] | 323 | if [ $? -eq 0 ]; then |
subrata_modak | 14390fd | 2009-05-19 09:39:11 +0000 | [diff] [blame] | 324 | echo "INFO: ltp-pan reported all tests PASS" |
mridge | a9e3857 | 2005-04-19 15:48:26 +0000 | [diff] [blame] | 325 | VALUE=0 |
| 326 | else |
subrata_modak | 14390fd | 2009-05-19 09:39:11 +0000 | [diff] [blame] | 327 | echo "INFO: ltp-pan reported some tests FAIL" |
mridge | a9e3857 | 2005-04-19 15:48:26 +0000 | [diff] [blame] | 328 | VALUE=1 |
| 329 | fi |
subrata_modak | 724098e | 2009-03-19 08:49:18 +0000 | [diff] [blame] | 330 | cd .. |
mridge | a9e3857 | 2005-04-19 15:48:26 +0000 | [diff] [blame] | 331 | [ ! -z "$QUIET_MODE" ] && { echo "INFO: Test end time: $(date)" ; } |
Chris Dearman | 37550cf | 2012-10-17 19:54:01 -0700 | [diff] [blame] | 332 | |
mridge | a9e3857 | 2005-04-19 15:48:26 +0000 | [diff] [blame] | 333 | [ "$GENLOAD" -eq 1 ] && { killall -9 genload ; } |
| 334 | [ "$NETPIPE" -eq 1 ] && { killall -9 NPtcp ; } |
Chris Dearman | 37550cf | 2012-10-17 19:54:01 -0700 | [diff] [blame] | 335 | |
mridge | a9e3857 | 2005-04-19 15:48:26 +0000 | [diff] [blame] | 336 | [ "$ALT_DIR" -eq 1 ] && \ |
| 337 | { |
| 338 | cat <<-EOF >&1 |
Chris Dearman | 37550cf | 2012-10-17 19:54:01 -0700 | [diff] [blame] | 339 | |
mridge | a9e3857 | 2005-04-19 15:48:26 +0000 | [diff] [blame] | 340 | ###############################################################" |
Chris Dearman | 37550cf | 2012-10-17 19:54:01 -0700 | [diff] [blame] | 341 | |
mridge | a9e3857 | 2005-04-19 15:48:26 +0000 | [diff] [blame] | 342 | Done executing testcases." |
| 343 | result log is in the $LTPROOT/results directory" |
Chris Dearman | 37550cf | 2012-10-17 19:54:01 -0700 | [diff] [blame] | 344 | |
mridge | a9e3857 | 2005-04-19 15:48:26 +0000 | [diff] [blame] | 345 | ###############################################################" |
Chris Dearman | 37550cf | 2012-10-17 19:54:01 -0700 | [diff] [blame] | 346 | |
mridge | a9e3857 | 2005-04-19 15:48:26 +0000 | [diff] [blame] | 347 | EOF |
| 348 | } |
| 349 | exit $VALUE |
| 350 | } |
| 351 | |
| 352 | cleanup() |
| 353 | { |
| 354 | rm -rf ${TMP} |
| 355 | } |
| 356 | |
| 357 | trap "cleanup" 0 |
| 358 | setup |
| 359 | main "$@" |
Garrett Cooper | cf86b8b | 2010-11-16 21:46:41 -0800 | [diff] [blame] | 360 | |
| 361 | #vim: syntax=sh |