5 # 07/10/02 - Jeff Martin - martinjn@us.ibm.com: Added instance and
6 # time command line options
8 # 12/15/02 - Manoj Iyer - manjo@mail.utexas.edu: Added options to run
9 # LTP under CPU, IO and MM load.
11 # 01/26/03 - Manoj Iyer - manjo@mail.utexas.edu: Added -f option; Execute
12 # user defined set of testcases.
14 # 01/27/03 - Manoj Iyer - manjo@mail.utexas.edu: Enabled formatted printing
17 # 01/28/03 - Manoj Iyer - manjo@mail.utexas.edu: added option to enable
18 # formatted printing of logfiles.
20 # 01/29/03 - Manoj Iyer - manjo@mail.utexas.edu: merged networktests.sh with
21 # this script, added the -n option to run these
22 # tests. Also, added -h option to print help messages.
24 # 01/29/03 - Manoj Iyer - manjo@mail.utexas.edu:
25 # added code to cause pan to print less verbose
27 # 02/01/03 - Manoj Iyer - manjo@mail.utexas.edu: Removed variables
28 # initialization of RHOST and PASSWD.
30 # 02/05/03 - Robbie Williamson - Added configurability to the optional load
31 # generator sections. Also added network traffic
38 export TMP
="${TMPBASE}/runalltests-$$"
39 export PATH
="${PATH}:${LTPROOT}/../testcases/bin"
51 usage: ./${0##*/} -c [-d tmpdir] [-f cmdfile ] [-i # (in Mb)] [ -l logfile ]
52 [ -m # (in Mb)] -N -n -q [ -r ltproot ] [ -t duration ] [ -x instances ]
54 -c Run LTP under additional background CPU load.
55 -d tmpdir Directory where temporary files will be created.
56 -f cmdfile Execute user defined list of testcases.
57 -h Help. Prints all available options.
58 -i # (in Mb) Run LTP with a _minimum_ IO load of # megabytes in background.
59 -l logfile Log results of test in a logfile.
60 -m # (in Mb) Run LTP with a _minimum_ memory load of # megabytes in background.
61 -N Run all the networking tests.
62 (export RHOST = remote hostname)
63 (export PASSWD = passwd of remote host)
64 -n Run LTP with network traffic in background.
65 -p Human readable format logfiles.
66 -q Print less verbose output to screen.
67 -r ltproot Fully qualified path where testsuite is installed.
68 -t duration Execute the testsuite for given duration in hours.
69 -x instances Run multiple instances of this testsuite.
71 example: ./${0##*/} -i 1024 -m 128 -p -q -l /tmp/resultlog.$$ -d ${PWD}
80 echo "could not cd ${TMP} ... exiting"
84 while getopts cd:f
:hi
:l
:m
:Nnpqr
:t
:x arg
87 $LTPROOT/..
/testcases
/bin
/genload
--cpu 1 2>&1 1>/dev
/null
&
90 d
) # append $$ to TMP, as it is recursively
91 # removed at end of script.
93 f
) # Execute user defined set of testcases.
99 bytesize
=$
(($OPTARG * 1024 * 1024))
100 $LTPROOT/..
/testcases
/bin
/genload
--io 1 2>&1 1>/dev
/null
&
101 $LTPROOT/..
/testcases
/bin
/genload
--hdd 0 --hdd-bytes $bytesize \
106 if [ ${OPTARG:0:1} != "/" ]
108 if [ -d $LTPROOT/results
]
110 logfile
="-l $LTPROOT/results/$OPTARG"
112 mkdir
-p $LTPROOT/results
115 echo "ERROR: failed to create $LTPROOT/results"
118 logfile
="-l $LTPROOT/results/$OPTARG"
126 memsize
=$
(($OPTARG * 1024 * 1024))
127 $LTPROOT/..
/testcases
/bin
/genload
--vm 0 --vm-bytes $memsize\
133 n
) $LTPROOT/..
/testcases
/bin
/netpipe.sh
136 p
) pretty_prt
=" -p ";;
138 q
) quiet_mode
=" -q ";;
142 t
) # In case you want to specify the time
143 # to run from the command line
144 # (2m = two minutes, 2h = two hours, etc)
145 duration
="-t $OPTARG" ;;
147 x
) # number of ltp's to run
148 instances
="-x $OPTARG";;
158 echo "Please export enviroment variable PASSWD"
159 echo "INFO: export PASSWD = 'root's password'"
163 #if [ $run_netest -eq 1 ]
165 # if [[ -z $RHOST || -z $PASSWD ]]
169 # echo "ERROR: Initializing networking tests."
170 # echo "INFO: Please export RHOST = 'name of the remote host machine'"
171 # echo "INFO: Please export PASSWD = 'passwd of the remote host machine'"
172 # echo "INFO: before running the networking tests."
180 if [ -n "$instances" ]; then
181 instances
="$instances -O ${TMP}"
185 # If user does not provide a command file select a default set of testcases
189 cat ${LTPROOT}/..
/runtest
/admin_tools
> ${TMP}/alltests
191 cat $cmdfile > ${TMP}/alltests
194 if [ $run_netest -eq 1 ]
196 cat ${LTPROOT}/..
/runtest
/network_commands
>> ${TMP}/alltests
199 # The fsx-linux tests use the SCRATCHDEV environment variable as a location
200 # that can be reformatted and run on. Set SCRATCHDEV if you want to run
201 # these tests. As a safeguard, this is disabled.
203 if [ -n "$SCRATCHDEV" ]; then
204 cat ${LTPROOT}/..
/runtest
/fsx
>> ${TMP}/alltests
207 # display versions of installed software
208 ${LTPROOT}/..
/ver_linux
210 ${LTPROOT}/..
/pan
/ltp-pan
$quiet_mode -e -S $instances $duration -a $$
-n $$
$pretty_prt -f ${TMP}/alltests
$logfile
212 if [ $?
-eq 0 ]; then
213 echo ltp-pan reported PASS
215 echo ltp-pan reported FAIL
218 if [ $GenLoad -eq 1 ]
223 if [ $NetPipe -eq 1 ]
228 if [ $alt_dir -eq 1 ]
231 echo "###############################################################"
233 echo " result log is in the $LTPROOT/results directory"
235 echo "###############################################################"