blob: 0041f601a4f8dff118276b0567c16f67dfceaa0b [file] [log] [blame]
alaffin802d3e32000-08-23 20:04:23 +00001#!/bin/sh
2
martinjnfef097c2002-07-10 14:08:24 +00003#
iyermanoj0ceb9482002-12-15 22:49:34 +00004# 07/10/02 - Jeff Martin - martinjn@us.ibm.com: Added instance and
5# time command line options
6#
7# 12/15/02 - Manoj Iyer - manjo@mail.utexas.edu: Added options to run
8# LTP under CPU, IO and MM load.
martinjnfef097c2002-07-10 14:08:24 +00009#
10
alaffin802d3e32000-08-23 20:04:23 +000011cd `dirname $0`
plarsefd320c2001-09-05 20:45:14 +000012export LTPROOT=${PWD}
plarsd05638c2002-09-09 18:30:48 +000013export TMPBASE="/tmp"
alaffin802d3e32000-08-23 20:04:23 +000014
plarsd05638c2002-09-09 18:30:48 +000015usage()
16{
17 cat <<-END >&2
iyermanoj0ceb9482002-12-15 22:49:34 +000018 usage: ${0##*/} -c [-d tmpdir] -i [ -l logfile ] -m [ -r ltproot ]
19 [ -t duration ] [ -x instances ]
20
iyermanoj0c9ab4a2002-12-18 16:32:57 +000021 -c Run LTP under CPU load.
iyermanoj0ceb9482002-12-15 22:49:34 +000022 -d tmpdir Directory where temporary files will be created.
iyermanoj0c9ab4a2002-12-18 16:32:57 +000023 -i Run LTP under heavy IO load.
iyermanoj0ceb9482002-12-15 22:49:34 +000024 -l logfile Log results of test in a logfile.
iyermanoj0c9ab4a2002-12-18 16:32:57 +000025 -m Run LTP under heavy memory load.
iyermanoj0ceb9482002-12-15 22:49:34 +000026 -r ltproot Fully qualified path where testsuite is installed.
iyermanoja34eb072002-12-15 21:29:15 +000027 -t duration Execute the testsuite for given duration in hours.
28 -x instances Run multiple instances of this testsuite.
plarsd05638c2002-09-09 18:30:48 +000029
30 example: ${0##*/} -t 2h -x3 -l /tmp/ltplog.$$ -d ${PWD}
31 END
32exit
33}
34
iyermanoj0ceb9482002-12-15 22:49:34 +000035
36# while getopts :t:x:l:r:d:mic arg
37while getopts cd:il:mr:t:x arg
38do case $arg in
39 c)
40 $LTPROOT/testcases/bin/genload --cpu 10 2>&1 1>/dev/null & ;;
41
42 d) # append $$ to TMP, as it is recursively
43 # removed at end of script.
44 TMPBASE=$OPTARG;;
45
46 i)
47 $LTPROOT/testcases/bin/genload --io 10 2>&1 1>/dev/null &
48 $LTPROOT/testcases/bin/genload --hdd 10 --hdd-files \
49 2>&1 1>/dev/null & ;;
50
51 l) logfile="-l $OPTARG";;
52
53 m)
54 $LTPROOT/testcases/bin/genload --vm 10 --vm-chunks 10 \
55 2>&1 1>/dev/null & ;;
56
57 r) LTPROOT=$OPTARG;;
58
59 t) # In case you want to specify the time
60 # to run from the command line
plarsd05638c2002-09-09 18:30:48 +000061 # (2m = two minutes, 2h = two hours, etc)
62 duration="-t $OPTARG" ;;
iyermanoj0ceb9482002-12-15 22:49:34 +000063
64 x) # number of ltp's to run
plarsd05638c2002-09-09 18:30:48 +000065 instances="-x $OPTARG";;
iyermanoj0ceb9482002-12-15 22:49:34 +000066
67 \?) usage;;
68 esac
plarsd05638c2002-09-09 18:30:48 +000069done
70
71export TMP="${TMPBASE}/runalltests-$$"
72mkdir -p ${TMP}
73
74if [ -n "$instances" ]; then
75 instances="$instances -O ${TMP}"
76fi
77
alaffin879684a2000-09-20 18:41:17 +000078cd ${TMP}
plarsd05638c2002-09-09 18:30:48 +000079if [ $? -ne 0 ]; then
80 echo "could not cd ${TMP} ... exiting"
81 exit
82fi
alaffin802d3e32000-08-23 20:04:23 +000083
plars1a4c2022001-09-06 15:04:36 +000084export PATH="${PATH}:${LTPROOT}/testcases/bin"
alaffin802d3e32000-08-23 20:04:23 +000085
robbiewd25c0282002-12-04 22:00:49 +000086cat ${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 +000087
nstraz731655a2002-06-21 20:01:59 +000088# The fsx-linux tests use the SCRATCHDEV environment variable as a location
89# that can be reformatted and run on. Set SCRATCHDEV if you want to run
90# these tests. As a safeguard, this is disabled.
91unset SCRATCHDEV
92if [ -n "$SCRATCHDEV" ]; then
93 cat ${LTPROOT}/runtest/fsx >> ${TMP}/alltests
94fi
robbiew9612ae02001-12-19 17:39:55 +000095
plarsd05638c2002-09-09 18:30:48 +000096# display versions of installed software
robbiew03cbf732001-10-12 21:06:50 +000097${LTPROOT}/ver_linux
98
plarsd05638c2002-09-09 18:30:48 +000099${LTPROOT}/pan/pan -e -S $instances $duration -a $$ -n $$ -f ${TMP}/alltests $logfile
alaffin802d3e32000-08-23 20:04:23 +0000100
plarsd05638c2002-09-09 18:30:48 +0000101if [ $? -eq 0 ]; then
alaffin879684a2000-09-20 18:41:17 +0000102 echo pan reported PASS
alaffin802d3e32000-08-23 20:04:23 +0000103else
alaffin879684a2000-09-20 18:41:17 +0000104 echo pan reported FAIL
alaffin802d3e32000-08-23 20:04:23 +0000105fi
alaffinad4c5fa2000-08-23 21:09:27 +0000106
alaffin879684a2000-09-20 18:41:17 +0000107rm -rf ${TMP}