On Tue, 16 Dec 2008 15:16:23 +0530
Sudhir Kumar <[email protected]> wrote:

> On Tue, Dec 16, 2008 at 05:31:19PM +0900, Mitsuru Chinen wrote:
> > This patch adds a menu to networktests.sh in order to select the
> > network tests like networkstress.sh. 
> > For the backword compatibility, the default test sets are left as-is.
> > Namely, networktests.sh doesn't run any additional tests when no
> > option is specified.
> > 
> > Signed-off-by: Mitsuru Chinen <[email protected]>
> > ---
> >  runtest/tcp_cmds_addition   |    7 +++
> >  testscripts/networktests.sh |  115 
> > +++++++++++++++++++++++++++++++++++++-----
> >  2 files changed, 108 insertions(+), 14 deletions(-)
> >  create mode 100644 runtest/tcp_cmds_addition
> > 
> > diff --git a/runtest/tcp_cmds_addition b/runtest/tcp_cmds_addition
> > new file mode 100644
> > index 0000000..432cfca
> > --- /dev/null
> > +++ b/runtest/tcp_cmds_addition
> > @@ -0,0 +1,7 @@
> > +#DESCRIPTION: addtional TCP/IP commands tests
> > +# The tests described in tcp_cmds are being in the default tests long time
> > +# New tests for TCP/IP should be in this command file
> > +#
> > +iproute ip_tests.sh
> > +traceroute traceroute_tests.sh
> > +xinetd xinetd_tests.sh
> Looks good.
> I happened to go through the network testcases in ltp and I saw that the
> network testcases are not organized in a good fashion. Even there are
> many command files and if my memory is correct there are testcases which
> are not part of any command file (if they are, it may be to a less/not
> relevant command file). It will be very good if people can volunteer to
> organize these testcases in a better fashion.
> I may be one of the volunteers ;)

It looks some of the network tests, which is not in the current command
files, are not on the ltp test framework (nfs_fsstress, sockets and nfsv4).
I've added the tests on ltp test framework into this tcp_cmds_addition file.
I'm not sure the former can run on pan. Is it possible?


> > diff --git a/testscripts/networktests.sh b/testscripts/networktests.sh
> > index b74a073..572b8f7 100755
> > --- a/testscripts/networktests.sh
> > +++ b/testscripts/networktests.sh
> > @@ -1,5 +1,11 @@
> >  #!/bin/sh
> > -# This will run all the network tests, with the status logged in 
> > /tmp/netpan.log  
> > +# This will run all the network tests, with the status logged in 
> > /tmp/netpan.log
> > +
> > +# ---***** THESE MUST BE SET FOR CORRECT OPERATION *****---
> > +export RHOST=
> > +export PASSWD=
> > +# ---***************************************************---
> > +
> >  cd `dirname $0`
> >  export LTPROOT=${PWD}
> >  echo $LTPROOT | grep testscripts > /dev/null 2>&1
> > @@ -8,11 +14,22 @@ if [ $? -eq 0 ]; then
> >   export LTPROOT=${PWD}
> >  fi
> > 
> > +export TMPDIR=/tmp/netpan-$$
> > +mkdir -p $TMPDIR
> > +CMDFILE=${TMPDIR}/network.tests
> > +VERBOSE="no"
> > 
> > -# ---***** THESE MUST BE SET FOR CORRECT OPERATION *****---
> > -export RHOST=
> > -export PASSWD=
> > -# ---***************************************************---
> > +# For bitwise operation to determine which testsets run
> > +CMD_IPV6=1         # 0x0001
> > +CMD_IPV6_LIB=2             # 0x0002
> > +CMD_MULTICAST=4            # 0x0004
> > +CMD_NFS=8          # 0x0008
> > +CMD_RPC=16         # 0x0010
> > +CMD_SCTP=32                # 0x0020
> > +CMD_TCPCMDS=64             # 0x0040
> > +CMD_TCPCMDS_ADD=128        # 0x0080
> > +CMD_WHOLE=65535            # 0xFFFF
> > +CMD_DEFAULT=$(($CMD_MULTICAST|$CMD_NFS|$CMD_RPC|$CMD_TCPCMDS))
> > 
> >  # ---***** NFS OPTIONAL SETTINGS *****---
> >  # DEFAULTS
> > @@ -20,22 +37,92 @@ export PASSWD=
> >  # export SOCKET_TYPE=udp
> >  # ---*********************************---
> > 
> > +usage() {
> > +    echo ""
> > +    echo "---------------------------------------------------------"
> > +    echo -e "\033[31m $0 [options] \033[0m "
> > +    echo "---------------------------------------------------------"
> > +    echo " -W|w: whole network tests"
> > +    echo " -D|d: default network tests"
> > +    echo " -6:   IPv6 tests"
> > +    echo " -L|l: IPv6 library tests"
> > +    echo " -M|m: multicast tests"
> > +    echo " -N|n: nfs tests"
> > +    echo " -R|r: rpc tests"
> > +    echo " -S|s: sctp tests"
> > +    echo " -T|t: TCP/IP command tests"
> > +    echo " -V|v: Enable verbose"
> > +    echo " -H|h: This Usage"
> > +    echo "*) 'default' runs multicast, rpc, nfs and some of TCP/IP command"
> > +    echo "   It is interpreted as 'default' if no test sets are specified"
> > +    echo ""
> > +}
> > 
> > -export TMPDIR=/tmp/netpan-$$
> > -mkdir $TMPDIR
> > +# Parse options
> > +CMD=0
> > +while getopts WwDd6LlMmNnRrSsTtVvHh OPTION
> > +do
> > +    case $OPTION in
> > +   W|w) CMD=$CMD_WHOLE;;
> > +   D|d) CMD=$(($CMD|$CMD_DEFAULT));;
> > +   6)   CMD=$(($CMD|$CMD_IPV6));;
> > +   L|l) CMD=$(($CMD|$CMD_IPV6_LIB));;
> > +   M|m) CMD=$(($CMD|$CMD_MULTICAST));;
> > +   N|n) CMD=$(($CMD|$CMD_NFS));;
> > +   R|r) CMD=$(($CMD|$CMD_RPC));;
> > +   S|s) CMD=$(($CMD|$CMD_SCTP));;
> > +   T|t) CMD=$(($CMD|$CMD_TCPCMDS|$CMD_TCPCMDS_ADD));;
> > +   V|v) VERBOSE="yes";;
> > +   H|h) usage; exit 0 ;;
> > +   *) echo "Error: invalid option..."; usage; exit 1 ;;
> > +    esac
> > +done
> > +if [ $CMD -eq 0 ]; then
> > +    CMD=$CMD_DEFAULT
> > +fi
> > 
> > -cat  ${LTPROOT}/runtest/tcp_cmds > $TMPDIR/network.tests
> > -cat  ${LTPROOT}/runtest/multicast >> $TMPDIR/network.tests
> > -cat  ${LTPROOT}/runtest/rpc >> $TMPDIR/network.tests
> > -cat  ${LTPROOT}/runtest/nfs >> $TMPDIR/network.tests
> > +# Determine which test set will run
> > +rm -f $CMDFILE
> > +if [ $(($CMD&$CMD_IPV6)) -ne 0 ]; then
> > +    cat  ${LTPROOT}/runtest/ipv6 >> $CMDFILE
> > +fi
> > +if [ $(($CMD&$CMD_IPV6_LIB)) -ne 0 ]; then
> > +    cat  ${LTPROOT}/runtest/ipv6_lib >> $CMDFILE
> > +fi
> > +if [ $(($CMD&$CMD_MULTICAST)) -ne 0 ]; then
> > +    cat  ${LTPROOT}/runtest/multicast >> $CMDFILE
> > +fi
> > +if [ $(($CMD&$CMD_NFS)) -ne 0 ]; then
> > +    cat  ${LTPROOT}/runtest/nfs >> $CMDFILE
> > +fi
> > +if [ $(($CMD&$CMD_RPC)) -ne 0 ]; then
> > +    cat  ${LTPROOT}/runtest/rpc >> $CMDFILE
> > +fi
> > +if [ $(($CMD&$CMD_SCTP)) -ne 0 ]; then
> > +    cat  ${LTPROOT}/runtest/sctp >> $CMDFILE
> > +fi
> > +if [ $(($CMD&$CMD_TCPCMDS)) -ne 0 ]; then
> > +    cat  ${LTPROOT}/runtest/tcp_cmds >> $CMDFILE
> > +fi
> > +if [ $(($CMD&$CMD_TCPCMDS_ADD)) -ne 0 ]; then
> > +    cat  ${LTPROOT}/runtest/tcp_cmds_addition >> $CMDFILE
> > +fi
> > 
> >  cd $TMPDIR
> > 
> >  export PATH="${PATH}:${LTPROOT}/testcases/bin"
> > - 
> > -${LTPROOT}/ver_linux
> > 
> > -${LTPROOT}/pan/pan -e -l /tmp/netpan.log -S -a ltpnet -n ltpnet -f 
> > ${TMPDIR}/network.tests
> > +if [ ${VERBOSE} = "yes" ]; then
> > +    echo "Network parameters:"
> > +    echo " - Remote Host: ${RHOST}"
> > +
> > +    cat $CMDFILE
> > +    ${LTPROOT}/ver_linux
> > +    echo ""
> > +    echo ${LTPROOT}/pan/pan -e -l /tmp/netpan.log -S -a ltpnet -n ltpnet 
> > -f $CMDFILE
> > +fi
> > +
> > +${LTPROOT}/pan/pan -e -l /tmp/netpan.log -S -a ltpnet -n ltpnet -f $CMDFILE
> > 
> >  if [ $? -eq "0" ]; then
> >    echo pan reported PASS
> > -- 
> > 1.5.6
> > 
> > ------------------------------------------------------------------------------
> > SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
> > The future of the web can't happen without you.  Join us at MIX09 to help
> > pave the way to the Next Web now. Learn more and register at
> > http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
> > _______________________________________________
> > Ltp-list mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/ltp-list
> 
> -- 
> Regards
> Sudhir Kumar
> Linux Technology Center
> IBM, India.

------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to