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 | # |
iyermanoj | 0ceb948 | 2002-12-15 22:49:34 +0000 | [diff] [blame] | 4 | # 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. |
martinjn | fef097c | 2002-07-10 14:08:24 +0000 | [diff] [blame] | 9 | # |
| 10 | |
alaffin | 802d3e3 | 2000-08-23 20:04:23 +0000 | [diff] [blame] | 11 | cd `dirname $0` |
plars | efd320c | 2001-09-05 20:45:14 +0000 | [diff] [blame] | 12 | export LTPROOT=${PWD} |
plars | d05638c | 2002-09-09 18:30:48 +0000 | [diff] [blame] | 13 | export TMPBASE="/tmp" |
alaffin | 802d3e3 | 2000-08-23 20:04:23 +0000 | [diff] [blame] | 14 | |
plars | d05638c | 2002-09-09 18:30:48 +0000 | [diff] [blame] | 15 | usage() |
| 16 | { |
| 17 | cat <<-END >&2 |
iyermanoj | 0ceb948 | 2002-12-15 22:49:34 +0000 | [diff] [blame] | 18 | usage: ${0##*/} -c [-d tmpdir] -i [ -l logfile ] -m [ -r ltproot ] |
| 19 | [ -t duration ] [ -x instances ] |
| 20 | |
iyermanoj | 0c9ab4a | 2002-12-18 16:32:57 +0000 | [diff] [blame] | 21 | -c Run LTP under CPU load. |
iyermanoj | 0ceb948 | 2002-12-15 22:49:34 +0000 | [diff] [blame] | 22 | -d tmpdir Directory where temporary files will be created. |
iyermanoj | 0c9ab4a | 2002-12-18 16:32:57 +0000 | [diff] [blame] | 23 | -i Run LTP under heavy IO load. |
iyermanoj | 0ceb948 | 2002-12-15 22:49:34 +0000 | [diff] [blame] | 24 | -l logfile Log results of test in a logfile. |
iyermanoj | 0c9ab4a | 2002-12-18 16:32:57 +0000 | [diff] [blame] | 25 | -m Run LTP under heavy memory load. |
iyermanoj | 0ceb948 | 2002-12-15 22:49:34 +0000 | [diff] [blame] | 26 | -r ltproot Fully qualified path where testsuite is installed. |
iyermanoj | a34eb07 | 2002-12-15 21:29:15 +0000 | [diff] [blame] | 27 | -t duration Execute the testsuite for given duration in hours. |
| 28 | -x instances Run multiple instances of this testsuite. |
plars | d05638c | 2002-09-09 18:30:48 +0000 | [diff] [blame] | 29 | |
| 30 | example: ${0##*/} -t 2h -x3 -l /tmp/ltplog.$$ -d ${PWD} |
| 31 | END |
| 32 | exit |
| 33 | } |
| 34 | |
iyermanoj | 0ceb948 | 2002-12-15 22:49:34 +0000 | [diff] [blame] | 35 | |
| 36 | # while getopts :t:x:l:r:d:mic arg |
| 37 | while getopts cd:il:mr:t:x arg |
| 38 | do 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 |
plars | d05638c | 2002-09-09 18:30:48 +0000 | [diff] [blame] | 61 | # (2m = two minutes, 2h = two hours, etc) |
| 62 | duration="-t $OPTARG" ;; |
iyermanoj | 0ceb948 | 2002-12-15 22:49:34 +0000 | [diff] [blame] | 63 | |
| 64 | x) # number of ltp's to run |
plars | d05638c | 2002-09-09 18:30:48 +0000 | [diff] [blame] | 65 | instances="-x $OPTARG";; |
iyermanoj | 0ceb948 | 2002-12-15 22:49:34 +0000 | [diff] [blame] | 66 | |
| 67 | \?) usage;; |
| 68 | esac |
plars | d05638c | 2002-09-09 18:30:48 +0000 | [diff] [blame] | 69 | done |
| 70 | |
| 71 | export TMP="${TMPBASE}/runalltests-$$" |
| 72 | mkdir -p ${TMP} |
| 73 | |
| 74 | if [ -n "$instances" ]; then |
| 75 | instances="$instances -O ${TMP}" |
| 76 | fi |
| 77 | |
alaffin | 879684a | 2000-09-20 18:41:17 +0000 | [diff] [blame] | 78 | cd ${TMP} |
plars | d05638c | 2002-09-09 18:30:48 +0000 | [diff] [blame] | 79 | if [ $? -ne 0 ]; then |
| 80 | echo "could not cd ${TMP} ... exiting" |
| 81 | exit |
| 82 | fi |
alaffin | 802d3e3 | 2000-08-23 20:04:23 +0000 | [diff] [blame] | 83 | |
plars | 1a4c202 | 2001-09-06 15:04:36 +0000 | [diff] [blame] | 84 | export PATH="${PATH}:${LTPROOT}/testcases/bin" |
alaffin | 802d3e3 | 2000-08-23 20:04:23 +0000 | [diff] [blame] | 85 | |
robbiew | d25c028 | 2002-12-04 22:00:49 +0000 | [diff] [blame] | 86 | 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] | 87 | |
nstraz | 731655a | 2002-06-21 20:01:59 +0000 | [diff] [blame] | 88 | # 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. |
| 91 | unset SCRATCHDEV |
| 92 | if [ -n "$SCRATCHDEV" ]; then |
| 93 | cat ${LTPROOT}/runtest/fsx >> ${TMP}/alltests |
| 94 | fi |
robbiew | 9612ae0 | 2001-12-19 17:39:55 +0000 | [diff] [blame] | 95 | |
plars | d05638c | 2002-09-09 18:30:48 +0000 | [diff] [blame] | 96 | # display versions of installed software |
robbiew | 03cbf73 | 2001-10-12 21:06:50 +0000 | [diff] [blame] | 97 | ${LTPROOT}/ver_linux |
| 98 | |
plars | d05638c | 2002-09-09 18:30:48 +0000 | [diff] [blame] | 99 | ${LTPROOT}/pan/pan -e -S $instances $duration -a $$ -n $$ -f ${TMP}/alltests $logfile |
alaffin | 802d3e3 | 2000-08-23 20:04:23 +0000 | [diff] [blame] | 100 | |
plars | d05638c | 2002-09-09 18:30:48 +0000 | [diff] [blame] | 101 | if [ $? -eq 0 ]; then |
alaffin | 879684a | 2000-09-20 18:41:17 +0000 | [diff] [blame] | 102 | echo pan reported PASS |
alaffin | 802d3e3 | 2000-08-23 20:04:23 +0000 | [diff] [blame] | 103 | else |
alaffin | 879684a | 2000-09-20 18:41:17 +0000 | [diff] [blame] | 104 | echo pan reported FAIL |
alaffin | 802d3e3 | 2000-08-23 20:04:23 +0000 | [diff] [blame] | 105 | fi |
alaffin | ad4c5fa | 2000-08-23 21:09:27 +0000 | [diff] [blame] | 106 | |
alaffin | 879684a | 2000-09-20 18:41:17 +0000 | [diff] [blame] | 107 | rm -rf ${TMP} |