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