#!/bin/ksh
#
# pragma ident "@(#)testio3.tst	1.0      03/11/12 SMI"
# 
# Copyright 2004 by Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#
# Original Author: Erica Zhang
#

# variables
hctsdir=SUNWhcts				# base directory
#hname=$2				# test system
rdir=results				# results directory
tdir=tests				# test directory
testcmd=$tdir/common/mpflip.stf		# network test
x=0					# loop counter
dls=					# data list
prgdir=prgs				# program directory
nfile=$rdir/$hname/nethost.dat		# network client's hostname
inst=1					# number of instances
rhost=$1

# functions

# do function
go_fun()
{
	$prgdir/funcs "$*" 2>&1
}	

### MAIN ###

# change to base directory
cd `dirname $0`
while [ `basename $PWD` != $hctsdir ]
do
	cd ..
done
#set ppp client
rhname=`cat /tmp/ppp_rhname`
if [ -z $rhname ]
then
	dls="!ERROR: No ppp client found"
fi

# network
if [ -z "$dls" ] 
then
	echo "h:<HR><B><U>Driver test - MPFLIP</U></B>:"		
        echo "X:4:$testcmd"     

	echo "n:Delay between flips (seconds)!1!5!1"
	echo "x:5:"

	go_fun runt 1 0 1 $inst
else
	echo "$dls"
	exit 1
fi
