alaffin | 802d3e3 | 2000-08-23 20:04:23 +0000 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
martinjn | fef097c | 2002-07-10 14:08:24 +0000 | [diff] [blame] | 3 | # |
| 4 | # 7/10/02 martinjn@us.ibm.com added instance and time command line options |
| 5 | # |
| 6 | |
alaffin | 802d3e3 | 2000-08-23 20:04:23 +0000 | [diff] [blame] | 7 | cd `dirname $0` |
plars | efd320c | 2001-09-05 20:45:14 +0000 | [diff] [blame] | 8 | export LTPROOT=${PWD} |
plars | d05638c | 2002-09-09 18:30:48 +0000 | [diff] [blame] | 9 | export TMPBASE="/tmp" |
alaffin | 802d3e3 | 2000-08-23 20:04:23 +0000 | [diff] [blame] | 10 | |
plars | d05638c | 2002-09-09 18:30:48 +0000 | [diff] [blame] | 11 | usage() |
| 12 | { |
| 13 | cat <<-END >&2 |
| 14 | usage: ${0##*/} [ -t duration ] [ -x instances ] [ -l logfile ] |
| 15 | [ -r ltproot ] [ -d tmpdir ] |
| 16 | defaults: |
| 17 | duration=$duration |
| 18 | instances=$instances |
| 19 | logfile=$logfile |
| 20 | ltproot=$LTPROOT |
| 21 | tmpdir=$TMPBASE |
| 22 | |
| 23 | example: ${0##*/} -t 2h -x3 -l /tmp/ltplog.$$ -d ${PWD} |
| 24 | END |
| 25 | exit |
| 26 | } |
| 27 | |
| 28 | while getopts :t:x:l:r:d: arg |
| 29 | do case $arg in |
| 30 | t) # In case you want to specify the time to run from the command line |
| 31 | # (2m = two minutes, 2h = two hours, etc) |
| 32 | duration="-t $OPTARG" ;; |
| 33 | x) # number of ltp's to run |
| 34 | instances="-x $OPTARG";; |
| 35 | l) logfile="-l $OPTARG";; |
| 36 | r) LTPROOT=$OPTARG;; |
| 37 | d) # append $$ to TMP, as it is recursively removed at end of script. |
| 38 | TMPBASE=$OPTARG;; |
| 39 | \?) usage;; |
| 40 | esac |
| 41 | done |
| 42 | |
| 43 | export TMP="${TMPBASE}/runalltests-$$" |
| 44 | mkdir -p ${TMP} |
| 45 | |
| 46 | if [ -n "$instances" ]; then |
| 47 | instances="$instances -O ${TMP}" |
| 48 | fi |
| 49 | |
alaffin | 879684a | 2000-09-20 18:41:17 +0000 | [diff] [blame] | 50 | cd ${TMP} |
plars | d05638c | 2002-09-09 18:30:48 +0000 | [diff] [blame] | 51 | if [ $? -ne 0 ]; then |
| 52 | echo "could not cd ${TMP} ... exiting" |
| 53 | exit |
| 54 | fi |
alaffin | 802d3e3 | 2000-08-23 20:04:23 +0000 | [diff] [blame] | 55 | |
plars | 1a4c202 | 2001-09-06 15:04:36 +0000 | [diff] [blame] | 56 | export PATH="${PATH}:${LTPROOT}/testcases/bin" |
alaffin | 802d3e3 | 2000-08-23 20:04:23 +0000 | [diff] [blame] | 57 | |
robbiew | d25c028 | 2002-12-04 22:00:49 +0000 | [diff] [blame^] | 58 | cat ${LTPROOT}/runtest/syscalls ${LTPROOT}/runtest/fs ${LTPROOT}/runtest/fsx ${LTPROOT}/runtest/dio ${LTPROOT}/runtest/mm ${LTPROOT}/runtest/commands ${LTPROOT}/runtest/ipc ${LTPROOT}/runtest/sched ${LTPROOT}/runtest/math > ${TMP}/alltests |
alaffin | 879684a | 2000-09-20 18:41:17 +0000 | [diff] [blame] | 59 | |
nstraz | 731655a | 2002-06-21 20:01:59 +0000 | [diff] [blame] | 60 | # The fsx-linux tests use the SCRATCHDEV environment variable as a location |
| 61 | # that can be reformatted and run on. Set SCRATCHDEV if you want to run |
| 62 | # these tests. As a safeguard, this is disabled. |
| 63 | unset SCRATCHDEV |
| 64 | if [ -n "$SCRATCHDEV" ]; then |
| 65 | cat ${LTPROOT}/runtest/fsx >> ${TMP}/alltests |
| 66 | fi |
robbiew | 9612ae0 | 2001-12-19 17:39:55 +0000 | [diff] [blame] | 67 | |
plars | d05638c | 2002-09-09 18:30:48 +0000 | [diff] [blame] | 68 | # display versions of installed software |
robbiew | 03cbf73 | 2001-10-12 21:06:50 +0000 | [diff] [blame] | 69 | ${LTPROOT}/ver_linux |
| 70 | |
plars | d05638c | 2002-09-09 18:30:48 +0000 | [diff] [blame] | 71 | ${LTPROOT}/pan/pan -e -S $instances $duration -a $$ -n $$ -f ${TMP}/alltests $logfile |
alaffin | 802d3e3 | 2000-08-23 20:04:23 +0000 | [diff] [blame] | 72 | |
plars | d05638c | 2002-09-09 18:30:48 +0000 | [diff] [blame] | 73 | if [ $? -eq 0 ]; then |
alaffin | 879684a | 2000-09-20 18:41:17 +0000 | [diff] [blame] | 74 | echo pan reported PASS |
alaffin | 802d3e3 | 2000-08-23 20:04:23 +0000 | [diff] [blame] | 75 | else |
alaffin | 879684a | 2000-09-20 18:41:17 +0000 | [diff] [blame] | 76 | echo pan reported FAIL |
alaffin | 802d3e3 | 2000-08-23 20:04:23 +0000 | [diff] [blame] | 77 | fi |
alaffin | ad4c5fa | 2000-08-23 21:09:27 +0000 | [diff] [blame] | 78 | |
alaffin | 879684a | 2000-09-20 18:41:17 +0000 | [diff] [blame] | 79 | rm -rf ${TMP} |