#
#   RUNDIR - a newly created directory on the nfs share.
#            will exist only when running COMMAND.
# 
#   LOCALDIR - a directory on the local fs meant to serve as storage space for 
#             the fetch stage and setup() call
#             will exist for setup, fetch stages and when COMMAND is run, but
#             not durning check().
#

URL="git://linux-nfs.org/~steved/cthon04.git"
URL_OUT="cthon"

#
# the command to run
#
COMMAND="cd $LOCALDIR/cthon && NFSTESTDIR=\"$RUNDIR\" ./runtests -a"

# 
# command description
#
DESCRIPTION="The connectathon test suite from git://linux-nfs.org/~steved/cthon04.git.  All tests are run: basic, special, general and locking"

# workload_check()
#  - no arguments
#  - any output to stdout means the check failed
#  - use need_* functions from workloads.sh
workload_check()
{
	need_bin time
}

# workload_setup()
#  - no arguments
#  - non-zero return indicates a problem
workload_setup()
{
	cd cthon || return 1

	# fix tests.init file
	mv tests.init tests.init.bak || return 1
	cat tests.init.bak | grep -v "SUNW" > tests.init || return 1

	# fix runtests script
	mv runtests runtests.bak || return 1
	cat runtests.bak | sed 's/TESTARG=-a/TESTARG=/g' > runtests || return 1

	# finally make
	make 2>&1 || return 1

	return 0
}


