Home | History | Annotate | Download | only in sockets
      1 #!/bin/sh
      2 # This script will start the socket server and then run the
      3 # sockets clients to execute the tests. If the kernel isn't
      4 # setup for multiCast server, then the other tests will continue without multiCast.
      5 # 03/28/03 mridge (at] us.ibm.com new tests
      6 
      7 cd `dirname $0`
      8 export LTPROOT=${PWD}
      9 export TMPBASE="/tmp"
     10 
     11 
     12 usage()
     13 {
     14 	cat <<-END >&2
     15 	usage: ${0##*/} [ -h hostname2 ] [ -d testdata ]
     16 
     17 	defaults:
     18 	hostname1=$hostname1
     19 	testdata=$testdata
     20 	ltproot=$LTPROOT
     21 	tmpdir=$TMPBASE
     22 
     23 	example: ${0##*/} -h myhostname  -d "my test data to be sent"
     24 
     25 
     26 	END
     27 exit
     28 }
     29 
     30 while getopts :h:d: arg
     31 do      case $arg in
     32 		h)	hostname1=$OPTARG;;
     33                 d)      testdata=$OPTARG;;
     34 
     35                 \?)     echo "************** Help Info: ********************"
     36                         usage;;
     37         esac
     38 done
     39 
     40 if [ ! -n "$hostname1"  ]; then
     41   echo "Missing the hostname! A hostname must be passed for the test."
     42   usage;
     43   exit
     44 fi
     45 
     46 if [ ! -n "$testdata" ]; then
     47   echo "Missing test data! You must pass data for the test."
     48   usage;
     49   exit
     50 fi
     51 
     52 echo "Starting UDP, TCP and Multicast tests..."
     53 
     54 echo "Starting ltpServer..."
     55 
     56 ./ltpServer $hostname1 &
     57 sleep 5
     58 echo "Starting ltpClient..."
     59 ./ltpClient $hostname1 $hostname1 $testdata
     60 sleep 1
     61 killall -9 ltpServer
     62 killall -9 ltpClient
     63 
     64 
     65