# @(#)server 1.5 90/01/10 NFS Rev 2 testsuite
# 1.1 Lachman ONC Test Suite source
# Uncomment the appropriate mount/umount commands depending upon whether
# run tests given a server name. mounts, tests, and unmounts
# -a|-b|-g|-s test selectors, passed to runtests
# -f|-t|-n test arguments, passed to runtests
# mnt_options arg to -o mount options
# server_path path to mount from server
# mntpoint path to mount on locally
# server_name server to mount from
USAGE="usage: $Program [-a|-b|-g|-s] [-f|-t|-n] [-o mnt_options] [-p server_path] [-m mntpoint] server_name"
set - `getopt abfgm:no:p:st $*`
-a|-b|-g|-s) TESTS=$c; shift ;;
-f|-n|-t) TESTARG=$c; shift ;;
-m) MNTPOINT=$2; shift; shift ;;
-o) MNTOPTIONS=$2; shift; shift ;;
-p) SERVPATH=$2; shift; shift ;;
# if no server specified, exit
# make sure nothing is mounted on the mountpoint
$UMOUNT $MNTPOINT > /dev/null 2>&1
if [ "$SYSTYPE" = "-DSVR3" ]
# use the following command if this is SYSV3
$MOUNT -f NFS,$MNTOPTIONS $SERVER\:$SERVPATH $MNTPOINT
# use the following command if this is BSD
$MOUNT -v -o $MNTOPTIONS $SERVER\:$SERVPATH $MNTPOINT
echo "Can't mount $SERVER:$SERVPATH on $MNTPOINT"
# mount doesn't always return error code if it fails, so lets
HOSTNAME=`expr $HOSTNAME : '\([^.]*\)'`
NFSTESTDIR=$MNTPOINT/$HOSTNAME.test
echo -n "Start tests on path $NFSTESTDIR [y/n]
\a? "
echo "Terminating ($MNTPOINT not unmounted)."
echo "sh ./runtests $TESTS $TESTARG $NFSTESTDIR"
sh ./runtests $TESTS $TESTARG $NFSTESTDIR
# use the following command if this is SYSV3
if [ "$SYSTYPE" = "-DSVR3" ]
# use the following command if this is BSD
exec $UMOUNT -v $MNTPOINT
# nothing executed after here