#!/bin/sh
# x11r6-tc.sh : test case for /usr/X11R6 directory

# This is 1.2
#
# x11r6-tc.sh,v
# Revision 1.2  2000/04/09 07:15:43  cyeoh
# Added CVS header information
#
#

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


tp1()
{
	tpstart "Reference 4.4-1(A)"
	tet_infoline "The /usr/X11R6 directory exists and is searchable"
	lsb_test_dir_searchable /usr/X11R6 >out.stdout  2>out.stderr
	check_exit_value $? 0		# should be zero
	check_nostdout			# should be no stdout
	check_nostderr			# should be no stderr
	tpresult				# set result code
}

tp2()
{
	tpstart "Reference 4.4-2(C)"

	tet_infoline "If the X11 subsystem and an X Server is installed"
	tet_infoline "The symbolic link /usr/bin/X11 shall exist and point to /usr/X11R6/bin"
	lsb_test_symlink /usr/bin/X11 /usr/X11R6/bin >out.stdout 2>out.stderr
	check_exit_value $? 0		# should be zero
	check_nostdout			# should be no stdout
	check_nostderr			# should be no stderr
 	if [ $FAIL = Y ]
 	then
 		FAIL=N
 		tpresult UNSUPPORTED
 		return
 	fi
	tpresult 			# set result code
}

tp3()
{
	tpstart "Reference 4.4-3(C)"
	tet_infoline "If the X11 subsystem and an X Server is installed"
	tet_infoline "The symbolic link /usr/lib/X11 shall exist and point to /usr/X11R6/lib/X11"
	lsb_test_symlink /usr/lib/X11 /usr/X11R6/lib/X11 >out.stdout 2>out.stderr
	check_exit_value $? 0		# should be zero
	check_nostdout			# should be no stdout
	check_nostderr			# should be no stderr
 	if [ $FAIL = Y ]
 	then
 		FAIL=N
 		tpresult UNSUPPORTED
 		return
 	fi
	tpresult 			# set result code
}

tp4()
{
	tpstart "Reference 4.4-4(C)"
	tet_infoline "If the file /usr/include/X11 exists, it shall be a symbolic link and point to /usr/X11R6/include/X11"

        lsb_test_file /usr/include/X11 >out.stdout 2>out.stderr
        if [ $? -eq 1 ]
        then
            tpresult UNSUPPORTED
            return
        fi

	lsb_test_symlink /usr/include/X11 /usr/X11R6/include/X11 >out.stdout 2>out.stderr
	check_exit_value $? 0		# should be zero
	check_nostdout			# should be no stdout
	check_nostderr			# should be no stderr
	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
