#!/bin/sh
#
# taken from the standard isode-test shell script by Julian Onions.
#
# PURPOSE:
#  Use misode-test to generate MISODE TP traffic which can
#  e.g. be monitored (by polling) using cmisbrowser or
#       (through event reporting) evsink.
#
#  The SMA MOs to be monitored by the browser would be :
#	transportEntity systemId=<host>@subsystemId=transport@entityId=isode
#       and its subordinate transportConnections
#
# USAGE :
#  1. the ISODE tsapd must already be running (by root) and the
#     ISODE ETCDIR/isoservices should have the right path to mimiscd
#     (see ./README),  otherwise you get lots of error messages like:
#     mimisc: association rejected:
#		[Connect request refused on this network connection]
#
#  2. set MBINDIR variable below to point to your OSIMIS bin directory
#     where mimisc lives
#
#  3. usage: misode-test <hostname>
#     while monitoring traffic with cmisbrowser or evsink
#

MBINDIR=$OSIMISETCPATH/../bin		#default directory


IMISC=$MBINDIR/mimisc

if [ $# -gt 0 ]; then
    host="$1"
    echo "Hostname set to $host"
elif host="`hostname`"; then
    echo "Hostname set to $host"
elif host="`uname`"; then
    echo "Hostname set to $host"
else
    echo -n "I give up, what is your host name? "
    read host
fi

for i in time users chargen
do
echo "$i:"
$IMISC "$host" $i || error=`expr $error + 1`
done

for i in ping sink echo
do
echo "$i:"
$IMISC -c 100 -l 1020 "$host" $i || error=`expr $error + 1`
done

echo "Test done, Errors: $error"
exit $error
