blob: a1657497757707478da7572606d5b148e4c5abaa [file] [log] [blame]
#!/bin/sh
# Copyright (c) International Business Machines Corp., 2001
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
# the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
# FILE : ltp
# DESCRIPTION : a menu-based interface for the LTP testsuite.
# HISTORY :
# 11/28/2001 Robbie Williamson (robbiew@austin.ibm.com)
# written
####################################################
kernel()
{
echo -n "Do you want to run by number of LOOPS or TIME (L/T)? >> "
read DURATION
case $DURATION in
l|L)
LOOPS=1
echo -n "How many loops do you want to run (Default is 1)? Use 0 for infinite. >> "
read LOOPS
TIME=""
;;
*)
TIME=30m
echo "How long do you want to run? (Default 30m)"
echo -n "Use s=seconds, m=minutes, h=hours, or d=days >> "
read TIME
TIME="-t $TIME"
LOOPS=0
;;
esac
echo""
echo -n "Do you want to keep a summary logfile (Y/N)? Default is no. >> "
read kernel_log
TIMESTAMP=`date +%Y%m%d%I%M%S`
case $kernel_log in
y|Y)
echo""
echo " The logfile will be /tmp/kernel_tests.log-$TIMESTAMP"
LOGFILE="-l /tmp/kernel_tests.log-$TIMESTAMP"
;;
*)
LOGFILE=" "
;;
esac
OUTFILE="/tmp/kernel_tests.output-$TIMESTAMP"
echo""
echo " The output file will be $OUTFILE"
echo""
echo -n " Would you like only the FAILURES documented in $OUTFILE (Y/N)? Default is no. >> "
read failures
case $failures in
y|Y)
FAILURES_ONLY=1
;;
*)
FAILURES_ONLY=0
;;
esac
echo""
echo -n "How many simultaneous runs do you want? >> "
read COPIES
cd `dirname $0`
export LTPROOT=${PWD}
export TMP="/tmp/kerneltests-$$"
mkdir $TMP
cd $TMP
export PATH="${PATH}:${LTPROOT}/testcases/bin"
echo -n "Do you want to run the system call tests (Y/N)? >> "
read syscall
if [ $syscall == "Y" ] || [ $syscall == "y" ]; then
cat ${LTPROOT}/runtest/syscalls >> ${TMP}/alltests
fi
echo -n "Do you want to run the filesystem tests (Y/N)? >> "
read fs
if [ $fs == "Y" ] || [ $fs == "y" ]; then
cat ${LTPROOT}/runtest/fs >> ${TMP}/alltests
echo -n "Do you want to run the fsx-linux tests (Y/N)? >> "
read fsx
if [ $fsx == "Y" ] || [ $fsx == "y" ]; then
echo -n " Please define the scratch dev (ex. /dev/hda) >> "
read SCRATCHDEV
export SCRATCHDEV
cat ${LTPROOT}/runtest/fsx >> ${TMP}/alltests
fi
fi
echo -n "Do you want to run the memory managment tests (Y/N)? >> "
read mm
if [ $mm == "Y" ] || [ $mm == "y" ]; then
cat ${LTPROOT}/runtest/mm >> ${TMP}/alltests
fi
echo -n "Do you want to run the application development environment (ade) command tests (Y/N)? >> "
read commands
if [ $commands == "Y" ] || [ $commands == "y" ]; then
cat ${LTPROOT}/runtest/commands >> ${TMP}/alltests
fi
echo -n "Do you want to run the interprocess communication (ipc) tests (Y/N)? >> "
read ipc
if [ $ipc == "Y" ] || [ $ipc == "y" ]; then
cat ${LTPROOT}/runtest/ipc >> ${TMP}/alltests
fi
echo -n "Do you want to run the scheduler tests (Y/N)? >> "
read sched
if [ $sched == "Y" ] || [ $sched == "y" ]; then
cat ${LTPROOT}/runtest/sched >> ${TMP}/alltests
fi
echo -n "Do you want to run the floating point tests (Y/N)? >> "
read float
if [ $float == "Y" ] || [ $float == "y" ]; then
cat ${LTPROOT}/runtest/float >> ${TMP}/alltests
fi
echo -n "Do you want to run the SCTP tests (Y/N)? >> "
read sctp
if [ $sctp == "Y" ] || [ $sctp == "y" ]; then
echo -n "Do you want UDP style SCTP tests (Y/N)? >> "
read udp_style
if [ $udp_style == "Y" ] || [ $udp_style == "y" ]; then
cat ${LTPROOT}/runtest/sctp_udp >> ${TMP}/alltests
fi
echo -n "Do you want TCP style SCTP tests (Y/N)? >> "
read tcp_style
if [ $tcp_style == "Y" ] || [ $tcp_style == "y" ]; then
cat ${LTPROOT}/runtest/sctp_tcp >> ${TMP}/alltests
fi
fi
echo "Test will begin after pressing [ENTER]."
read GO
TESTS=`cat ${TMP}/alltests | grep -v "#" | grep [[:alnum:]] | wc -l`
LOOPS=$(( $LOOPS * $TESTS ))
${LTPROOT}/ver_linux >> $OUTFILE
if [ $LOOPS -eq 0 ]; then
echo ""
echo " Tests running....Press [Ctrl]-C to stop."
if [ $FAILURES_ONLY -eq 0 ]; then
${LTPROOT}/pan/pan -e $TIME -S -a $$ -n $$ -f ${TMP}/alltests -s$LOOPS $LOGFILE -o $OUTFILE
else # Strip out the passes.
${LTPROOT}/pan/pan -e $TIME -S -a $$ -n $$ -f ${TMP}/alltests -s$LOOPS $LOGFILE | ${LTPROOT}/tools/ltpoutput2 > $OUTFILE
fi
else
if [ $FAILURES_ONLY -eq 0 ]; then
${LTPROOT}/pan/pan -e $TIME -S -a $$ -n $$ -f ${TMP}/alltests -s$LOOPS -x$COPIES $LOGFILE -o $OUTFILE &
PID=$!
else #Strip out the passes.
echo " Tests running....Failures will display to the screen at the end of the run."
${LTPROOT}/pan/pan -e $TIME -S -a $$ -n $$ -f ${TMP}/alltests -s$LOOPS -x$COPIES $LOGFILE | ${LTPROOT}/tools/ltpoutput2 > $OUTFILE &
PID=$!
fi
tail -f $OUTFILE &
TAIL_PID=$!
ps -ef | grep -v grep | grep $PID > /dev/null
while [ $? -eq "0" ]
do
ps -ef | grep -v grep | grep $PID > /dev/null
done
kill $TAIL_PID > /dev/null 2>&1
sleep 1
clear
fi
rm -rf $TMP
if [ $FAILURES_ONLY -eq 0 ]; then
echo ""
echo -n "Would you like the errors extracted from $OUTFILE? (Y/N) >> "
read extract
case $extract in
Y*|y*)
echo ""
echo "The file $OUTFILE-errors will contain this information."
sleep 1
${LTPROOT}/tools/ltpoutput $OUTFILE > $OUTFILE-errors
;;
*)
;;
esac
fi
}
####################################################
networking()
{
RHOST=loopback
echo ""
echo -n "Please specify hostname of server machine. Default is loopback. >> "
read RHOST
echo "Server machine is $RHOST."
echo ""
export RHOST
sleep 1
PASSWD=""
echo -n "Please specify root's password on $RHOST. >> "
read PASSWD
echo "$RHOST has \"$PASSWD\" as its root password."
echo""
export PASSWD
sleep 1
echo "Performing pre-test server check on $RHOST."
sleep 1
echo ""
echo "Please verify that the following inetd/xinetd services are turned on for $RHOST:"
echo ""
echo " echo (stream)"
echo " fingerd"
echo " ftpd"
echo " telnetd"
echo " rshd"
echo " rlogind"
echo ""
echo -n "Press [ENTER] to continue>>"
read enter
echo "The program: expect MUST be installed under /usr/bin/expect for the rlogin"
echo "and telnet tests to work. These tests will not be ran if this is not the"
echo "the case."
echo ""
echo -n "Press [ENTER] to continue>>"
read enter
HOSTNAME=`hostname`
echo ""
echo "Make sure that $RHOST's /root/.rhosts file has $HOSTNAME's interface name listed in it. "
echo -n "[ENTER] to continue>>"
read enter
rsh -n -l root $RHOST ls > /dev/null 2>&1
if [ $? -ne "0" ]; then
echo ""
echo " *** ERROR ***"
echo "Could not reach $RHOST. Network tests aborting"
echo ""
echo -n "Press [ENTER] to continue.>>"
read continue
main
fi
echo ""
echo -n "RHOST is: "
rsh -n $RHOST "uname -a"
echo ""
sleep 1
echo -n "Do you want to run by number of LOOPS or TIME (L/T)? >> "
read DURATION
case $DURATION in
l|L)
LOOPS=1
echo -n "How many loops do you want to run (Default is 1)? Use 0 for infinite. >> "
read LOOPS
TIME=""
;;
*)
TIME=30m
echo "How long do you want to run? (Default 30m)"
echo -n "Use s=seconds, m=minutes, h=hours, or d=days >> "
read TIME
TIME="-t $TIME"
LOOPS=0
;;
esac
echo""
echo -n "Do you want to keep a summary logfile (Y/N)? Default is no. >> "
read network_log
TIMESTAMP=`date +%Y%m%d%I%M%S`
case $network_log in
y|Y)
echo""
echo " The logfile will be /tmp/network_tests.log-$TIMESTAMP"
LOGFILE="-l /tmp/network_tests.log-$TIMESTAMP"
;;
*)
LOGFILE=" "
;;
esac
echo""
OUTFILE="/tmp/network_tests.output-$TIMESTAMP"
echo""
echo " The output file will be /tmp/network_tests.output-$TIMESTAMP"
echo""
echo -n " Would you like only the FAILURES documented in $OUTFILE (Y/N)? Default is no. >> "
read failures
case $failures in
y|Y)
FAILURES_ONLY=1
;;
*)
FAILURES_ONLY=0
;;
esac
echo""
cd `dirname $0`
export LTPROOT=${PWD}
export TMP="/tmp/networktests-$$"
mkdir $TMP
cd $TMP
ls /usr/bin/expect > /dev/null
if [ $? == "0" ]; then
echo ""
echo "/usr/bin/expect found. rlogin and telnet tests will be ran."
echo ""
TCP=tcp_cmds
TCP6=ipv6
else
echo ""
echo "/usr/bin/expect NOT found. rlogin and telnet tests will NOT be ran."
echo ""
TCP=tcp_cmds_noexpect
TCP6=ipv6_noexpect
fi
export PATH="${PATH}:${LTPROOT}/testcases/bin"
echo -n "Do you want to run the network commands tests (Y/N)? >> "
read tcp_cmds
if [ $tcp_cmds == "Y" ] || [ $tcp_cmds == "y" ]; then
cat ${LTPROOT}/runtest/$TCP >> ${TMP}/alltests
fi
echo -n "Do you want to run the IPv6 tests (Y/N)? >> "
read ipv6
if [ $ipv6 == "Y" ] || [ $ipv6 == "y" ]; then
cat ${LTPROOT}/runtest/$TCP6 >> ${TMP}/alltests
fi
echo -n "Do you want to run the multicast tests (Y/N)? >> "
read multicast
if [ $multicast == "Y" ] || [ $multicast == "y" ]; then
cat ${LTPROOT}/runtest/multicast >> ${TMP}/alltests
fi
echo -n "Do you want to run the remote procedure call (rpc) tests (Y/N)? >> "
read rpc
if [ $rpc == "Y" ] || [ $rpc == "y" ]; then
cat ${LTPROOT}/runtest/rpc >> ${TMP}/alltests
fi
echo -n "Do you want to run the network filesystem (nfs) tests (Y/N)? >> "
read nfs
if [ $nfs == "Y" ] || [ $nfs == "y" ]; then
echo -n " Which version (2/3)? Default is 2. >> "
read VERS
case $VERS in
3)
export VERSION=$VERS
;;
*)
export VERSION=2
;;
esac
echo -n " Which protocol (udp/tcp)? Default is udp. (U/T)>> "
read PROTO
case $PROTO in
T|t)
export SOCKET_TYPE=tcp
;;
*)
export SOCKET_TYPE=udp
;;
esac
cat ${LTPROOT}/runtest/nfs >> ${TMP}/alltests
fi
echo "Test will begin after pressing [ENTER]."
read GO
TESTS=`cat ${TMP}/alltests | grep -v "#" | grep [[:alnum:]] | wc -l `
LOOPS=$(( $TESTS * $LOOPS ))
${LTPROOT}/ver_linux >> $OUTFILE
if [ $LOOPS -eq 0 ]; then
echo ""
echo " Tests running....Press [Ctrl]-C to stop."
if [ $FAILURES_ONLY -eq 0 ]; then
${LTPROOT}/pan/pan -e $TIME -S -a $$ -n $$ -f ${TMP}/alltests -s$LOOPS $LOGFILE -o $OUTFILE
else # Strip out the passes.
${LTPROOT}/pan/pan -e $TIME -S -a $$ -n $$ -f ${TMP}/alltests -s$LOOPS $LOGFILE | ${LTPROOT}/tools/ltpoutput2 > $OUTFILE
fi
else
if [ $FAILURES_ONLY -eq 0 ]; then
${LTPROOT}/pan/pan -e $TIME -S -a $$ -n $$ -f ${TMP}/alltests -s$LOOPS $LOGFILE -o $OUTFILE &
PID=$!
else # Strip out the passes.
echo " Tests running....Failures will display to the screen"
${LTPROOT}/pan/pan -e $TIME -S -a $$ -n $$ -f ${TMP}/alltests -s$LOOPS $LOGFILE | ${LTPROOT}/tools/ltpoutput2 > $OUTFILE &
PID=$!
fi
tail -f $OUTFILE &
TAIL_PID=$!
ps -ef | grep -v grep | grep $PID > /dev/null
while [ $? -eq "0" ]
do
ps -ef | grep -v grep | grep $PID > /dev/null
done
kill $TAIL_PID > /dev/null 2>&1
sleep 1
clear
fi
rm -rf $TMP
if [ $FAILURES_ONLY -eq 0 ]; then
echo ""
echo -n "Would you like the errors extracted from $OUTFILE? (Y/N) >> "
read extract
case $extract in
Y*|y*)
echo ""
echo "The file $OUTFILE-errors will contain this information."
sleep 1
${LTPROOT}/tools/ltpoutput $OUTFILE > $OUTFILE-errors
;;
*)
;;
esac
fi
}
####################################################
diskio()
{
echo ""
echo "Please make sure a data CD and an unprotected floppy disk are in"
echo "there respectable drives."
echo ""
echo -n "Do you want to run by number of LOOPS or TIME (L/T)? >> "
read DURATION
case $DURATION in
l|L)
LOOPS=1
echo -n "How many loops do you want to run (Default is 1)? Use 0 for infinite. >> "
read LOOPS
TIME=""
;;
*)
TIME=30m
echo "How long do you want to run? (Default 30m)"
echo -n "Use s=seconds, m=minutes, h=hours, or d=days >> "
read TIME
TIME="-t $TIME"
LOOPS=0
;;
esac
echo""
echo -n "Do you want to keep a logfile (Y/N)? Default is no. >> "
read diskio_log
TIMESTAMP=`date +%Y%m%d%I%M%S`
case $diskio_log in
y|Y)
echo""
echo " The logfile will be /tmp/diskio_tests.log-$TIMESTAMP"
LOGFILE="-l /tmp/diskio_tests.log-$TIMESTAMP"
;;
*)
LOGFILE=" "
;;
esac
echo""
OUTFILE="/tmp/diskio_tests.output-$TIMESTAMP"
echo""
echo " The output file will be /tmp/diskio_tests.output-$TIMESTAMP"
echo""
echo -n " Would you like only the FAILURES documented in $OUTFILE (Y/N)? Default is no. >> "
read failures
case $failures in
y|Y)
FAILURES_ONLY=1
;;
*)
FAILURES_ONLY=0
;;
esac
echo""
cd `dirname $0`
export LTPROOT=${PWD}
export TMP="/tmp/diskiotests-$$"
mkdir $TMP
cd $TMP
export PATH="${PATH}:${LTPROOT}/testcases/bin"
cat ${LTPROOT}/runtest/io > ${TMP}/alltests
TESTS=`cat ${TMP}/alltests | grep -v "#" | grep [[:alnum:]] | wc -l`
LOOPS=$(( $LOOPS * $TESTS ))
${LTPROOT}/ver_linux >> $OUTFILE
if [ $LOOPS -eq 0 ]; then
echo ""
echo " Tests running....Press [Ctrl]-C to stop."
if [ $FAILURES_ONLY -eq 0 ]; then
${LTPROOT}/pan/pan -e $TIME -S -a $$ -n $$ -f ${TMP}/alltests -s$LOOPS $LOGFILE -o $OUTFILE
else # Strip out the passes.
${LTPROOT}/pan/pan -e $TIME -S -a $$ -n $$ -f ${TMP}/alltests -s$LOOPS $LOGFILE | ${LTPROOT}/tools/ltpoutput2 > $OUTFILE
fi
else
if [ $FAILURES_ONLY -eq 0 ]; then
${LTPROOT}/pan/pan -e $TIME -S -a $$ -n $$ -f ${TMP}/alltests -s$LOOPS $LOGFILE -o $OUTFILE &
PID=$!
else # Strip out the passes.
echo " Tests running....Failures will display to the screen"
${LTPROOT}/pan/pan -e $TIME -S -a $$ -n $$ -f ${TMP}/alltests -s$LOOPS $LOGFILE | ${LTPROOT}/tools/ltpoutput2 > $OUTFILE &
PID=$!
fi
tail -f $OUTFILE &
TAIL_PID=$!
ps -ef | grep -v grep | grep $PID > /dev/null
while [ $? -eq "0" ]
do
ps -ef | grep -v grep | grep $PID > /dev/null
done
kill $TAIL_PID > /dev/null 2>&1
sleep 1
clear
fi
rm -rf $TMP
if [ $FAILURES_ONLY -eq 0 ]; then
echo ""
echo -n "Would you like the errors extracted from $OUTFILE? (Y/N) >> "
read extract
case $extract in
Y*|y*)
echo ""
echo "The file $OUTFILE-errors will contain this information."
sleep 1
${LTPROOT}/tools/ltpoutput $OUTFILE > $OUTFILE-errors
;;
*)
;;
esac
fi
}
####################################################
menu_print()
{
clear
echo " *****************************************"
echo " * *"
echo " * *"
echo " * LL TTTTTTTTTT PPPPPPPP *"
echo " * LL TT PP PP *"
echo " * LL TT PP PP *"
echo " * LL TT PP PP *"
echo " * LL TT PPPPPPPP *"
echo " * LL TT PP *"
echo " * LL TT PP *"
echo " * LL TT PP *"
echo " * LLLLLLLL TT PP *"
echo " * *"
echo " * *"
echo " *****************************************"
echo ""
echo " The Linux Test Project Testsuite "
echo ""
echo " (1) Kernel system call tests"
echo " (2) Disk I/O tests"
echo " (3) Networking tests"
echo " (4) EXIT"
echo ""
echo -n " Please select 1, 2, 3, or 4 >> "
}
####################################################
cleanup()
{
rm -rf /tmp/kerneltests-*
rm -rf /tmp/networktests-*
rm -rf /tmp/diskiotests-*
exit 0
}
####################################################
main()
{
while [ true ]
do
menu_print
read ans
case $ans in
1*)
kernel
;;
2*)
diskio
;;
3*)
networking
;;
4*)
cleanup
;;
*)
main
;;
esac
sleep 2
done
}
####################################################
####################################################
main