• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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@us.ibm.com new tests
6
7cd `dirname $0`
8export LTPROOT=${PWD}
9export TMPBASE="/tmp"
10
11
12usage()
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
27exit
28}
29
30while getopts :h:d: arg
31do      case $arg in
32		h)	hostname1=$OPTARG;;
33                d)      testdata=$OPTARG;;
34
35                \?)     echo "************** Help Info: ********************"
36                        usage;;
37        esac
38done
39
40if [ ! -n "$hostname1"  ]; then
41  echo "Missing the hostname! A hostname must be passed for the test."
42  usage;
43  exit
44fi
45
46if [ ! -n "$testdata" ]; then
47  echo "Missing test data! You must pass data for the test."
48  usage;
49  exit
50fi
51
52echo "Starting UDP, TCP and Multicast tests..."
53
54echo "Starting ltpServer..."
55
56./ltpServer $hostname1 &
57sleep 5
58echo "Starting ltpClient..."
59./ltpClient $hostname1 $hostname1 $testdata
60sleep 1
61killall -9 ltpServer
62killall -9 ltpClient
63
64
65