#!/bin/sh
# media-tc.sh : test case for /media directory

# $Log: media-tc.sh,v $
# Revision 1.2  2004/02/13 06:55:01  ajosey
# if /media directory does not exist cancel tps 2 thru 5
#
# Revision 1.1  2004/02/12 13:40:14  ajosey
# initial checkin
#

tet_startup="startup"			# startup function
tet_cleanup="cleanup"			# cleanup function
iclist="ic1 ic2 ic3 ic4 ic5"
ic1="tp1"
ic2="tp2"
ic3="tp3"
ic4="tp4"
ic5="tp5"

tp1()
{
	tpstart "Reference 3.11-1(A)"
	tet_infoline "The /media directory exists and is searchable"
	lsb_test_dir_searchable /media >out.stdout  2>out.stderr
	check_exit_value $? 0		# should be zero
	check_nostdout			# should be stdout
	check_nostderr			# should be no stderr
	if [ $FAIL = Y ]
	then
	# cancel rest of the testcases 
		for testcasename in tp2 tp3 tp4 tp5
		do
			tet_delete $testcasename "prerequisite /media directory does not exist or is not searchable"
		done
	fi
	tpresult				# set result code
}

tp2()
{
	tpstart "Reference 3.11-2(C)" 
	tet_infoline "The /media/floppy subdirectory may exist under the /media directory to support the mounting of filesystems"
	lsb_test_dir_searchable /media/floppy >out.stdout  2>out.stderr
	check_exit_value $? 0		# should be zero
	check_nostdout			# should be stdout
	check_nostderr			# should be no stderr
        if [ $FAIL = Y ]
        then
                FAIL=N
                tpresult UNSUPPORTED
                return
        fi
	tpresult			# set result code
}

tp3()
{
	tpstart "Reference 3.11-3(C)" 
	tet_infoline "The /media/cdrom subdirectory may exist under the /media directory to support the mounting of filesystems"
	lsb_test_dir_searchable /media/cdrom >out.stdout  2>out.stderr
	check_exit_value $? 0		# should be zero
	check_nostdout			# should be stdout
	check_nostderr			# should be no stderr
        if [ $FAIL = Y ]
        then
                FAIL=N
                tpresult UNSUPPORTED
                return
        fi
	tpresult			# set result code
}

tp4()
{
	tpstart "Reference 3.11-4(C)" 
	tet_infoline "The /media/cdrecorder subdirectory may exist under the /media directory to support the mounting of filesystems"
	lsb_test_dir_searchable /media/cdrecorder >out.stdout  2>out.stderr
	check_exit_value $? 0		# should be zero
	check_nostdout			# should be stdout
	check_nostderr			# should be no stderr
        if [ $FAIL = Y ]
        then
                FAIL=N
                tpresult UNSUPPORTED
                return
        fi
	tpresult			# set result code
}


tp5()
{
	tpstart "Reference 3.11-5(C)" 
	tet_infoline "The /media/zip subdirectory may exist under the /media directory to support the mounting of filesystems"
	lsb_test_dir_searchable /media/zip >out.stdout  2>out.stderr
	check_exit_value $? 0		# should be zero
	check_nostdout			# should be stdout
	check_nostderr			# should be no stderr
        if [ $FAIL = Y ]
        then
                FAIL=N
                tpresult UNSUPPORTED
                return
        fi
	tpresult			# set result code
}



startup() # startup function
{
     rm -f out.stdout out.stderr out.experr >/dev/null 2>&1
}


cleanup() # clean-up function
{
     rm -f out.stdout out.stderr out.experr >/dev/null 2>&1
}

# source common shell functions

. $TET_EXECUTE/LIB/shfuncs.sh
. $TET_EXECUTE/LIB/lsbfuncs.sh

# execute shell test case manager - must be last line
. $TET_ROOT/lib/xpg3sh/tcm.sh
