blob: 9d44bdce94339905e4ba791f6a2cd4c7298071f2 [file] [log] [blame]
alaffin802d3e32000-08-23 20:04:23 +00001#!/bin/sh
2
martinjnfef097c2002-07-10 14:08:24 +00003#
4# 7/10/02 martinjn@us.ibm.com added instance and time command line options
5#
6
alaffin802d3e32000-08-23 20:04:23 +00007cd `dirname $0`
plarsefd320c2001-09-05 20:45:14 +00008export LTPROOT=${PWD}
plarsd05638c2002-09-09 18:30:48 +00009export TMPBASE="/tmp"
alaffin802d3e32000-08-23 20:04:23 +000010
plarsd05638c2002-09-09 18:30:48 +000011usage()
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
25exit
26}
27
28while getopts :t:x:l:r:d: arg
29do 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
41done
42
43export TMP="${TMPBASE}/runalltests-$$"
44mkdir -p ${TMP}
45
46if [ -n "$instances" ]; then
47 instances="$instances -O ${TMP}"
48fi
49
alaffin879684a2000-09-20 18:41:17 +000050cd ${TMP}
plarsd05638c2002-09-09 18:30:48 +000051if [ $? -ne 0 ]; then
52 echo "could not cd ${TMP} ... exiting"
53 exit
54fi
alaffin802d3e32000-08-23 20:04:23 +000055
plars1a4c2022001-09-06 15:04:36 +000056export PATH="${PATH}:${LTPROOT}/testcases/bin"
alaffin802d3e32000-08-23 20:04:23 +000057
robbiewd25c0282002-12-04 22:00:49 +000058cat ${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
alaffin879684a2000-09-20 18:41:17 +000059
nstraz731655a2002-06-21 20:01:59 +000060# 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.
63unset SCRATCHDEV
64if [ -n "$SCRATCHDEV" ]; then
65 cat ${LTPROOT}/runtest/fsx >> ${TMP}/alltests
66fi
robbiew9612ae02001-12-19 17:39:55 +000067
plarsd05638c2002-09-09 18:30:48 +000068# display versions of installed software
robbiew03cbf732001-10-12 21:06:50 +000069${LTPROOT}/ver_linux
70
plarsd05638c2002-09-09 18:30:48 +000071${LTPROOT}/pan/pan -e -S $instances $duration -a $$ -n $$ -f ${TMP}/alltests $logfile
alaffin802d3e32000-08-23 20:04:23 +000072
plarsd05638c2002-09-09 18:30:48 +000073if [ $? -eq 0 ]; then
alaffin879684a2000-09-20 18:41:17 +000074 echo pan reported PASS
alaffin802d3e32000-08-23 20:04:23 +000075else
alaffin879684a2000-09-20 18:41:17 +000076 echo pan reported FAIL
alaffin802d3e32000-08-23 20:04:23 +000077fi
alaffinad4c5fa2000-08-23 21:09:27 +000078
alaffin879684a2000-09-20 18:41:17 +000079rm -rf ${TMP}