#!/bin/ksh
#
#pragma ident "@(#)test2.tst	1.6      01/07/27 SMI"
# 
# Copyright (c) 2001 by Sun Microsystems, Inc.
# All rights reserved.
#
#
#
# Original Author: Michael Koller
# Modified by:	   Alex Kaplan
#

# variables
hctsdir=SUNWhcts			# base directory
hname=$1			# test system
testcmd=tests/str/rmd.stf	# storage test
prgdir=prgs			# program directory
dls=				# data list
inst=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 local/remote
if [ `hostname` = $hname ]
then
	dls=`cat /etc/mnttab | grep  -w "rmdisk" | grep "rw," | tr ":" "-"`
	if [ -z "$dls" ]
	then
		echo "No Rmdisk Found."
		exit 2
	fi
else
	dls=`rsh -n $hname "cat /etc/mnttab" | grep  -w "rmdisk" | grep "rw," | tr ":" "-"`
	if [ -z "$dls" ]
	then
		echo "No Rmdisk Found."
		exit 2
	fi
fi


# rmd

echo "h:<HR><B><U>System certification test - RMD</U></B>:"
echo "h:Mount point = $dls:"
echo "X:4:$testcmd"

go_fun runt 1 0 1 $inst 


