#!/bin/sh
# share-man-tc.sh : test case for /usr/share/man directory

##########################################################################
# (C) Copyright 1998-2001 The Open Group
#
# All rights reserved.  No part of this source code may be reproduced,
# stored in a retrieval system, or transmitted, in any form or by any
# means, electronic, mechanical, photocopying, recording or otherwise,
# except as stated in the end-user licence agreement, without the prior
# permission of the copyright owners.
#
# X/Open and the 'X' symbol are trademarks of X/Open Company Limited in
# the UK and other countries.
#
#	PROJECT:	LSB-FHS
#	PRODUCT:	LSB.fhs/usr/share-man/share-man-tc.sh
#	AUTHOR:		Andrew Josey, The Open Group
#	DATE CREATED:	21 Dec 1998
##########################################################################

# This is $Revision: 1.4 $
#
# $Log: share-man-tc.sh,v $
# Revision 1.4  2001/08/15 08:38:20  ajosey
# tp1 should be mandatory as per FHS 4.11.2/4.11.5
#
# Revision 1.3  2001/08/15 07:04:35  ajosey
# update the assertion numbers for FHS2.2
#
# Revision 1.2  2001/07/20 12:26:12  ajosey
# update test cases for FHS2.2
#
#
# -- old cvs log below --
# This is 1.4
#
# share-man-tc.sh,v
# Revision 1.4  2000/04/17 07:09:12  ajosey
# add tests 2-9
#
# Revision 1.3  2000/04/14 10:50:25  ajosey
# renumber the assertions for FHS2.1
#
# Revision 1.2  2000/04/09 07:15:41  cyeoh
# Added CVS header information
#
#

tet_startup="startup"			# startup function
tet_cleanup="cleanup"			# cleanup function
iclist="ic1 ic2 ic3 ic4 ic5 ic6 ic7 ic8 ic9"
ic1="tp1"
ic2="tp2"
ic3="tp3"
ic4="tp4"
ic5="tp5"
ic6="tp6"
ic7="tp7"
ic8="tp8"
ic9="tp9"


tp1()
{
	tpstart "Reference 4.11.5-1(A)"
	tet_infoline "The /usr/share/man directory exists and is searchable"
	lsb_test_dir_searchable /usr/share/man >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.11.5-2(C)"
	tet_infoline "If the implementation supports the subsystem"
	tet_infoline "The /usr/share/man/man1 directory exists and is searchable"
	lsb_test_dir_searchable /usr/share/man/man1 >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
		tet_infoline "This test result needs to be manually resolved"
		tpresult FIP
		return
	fi
	tpresult				# set result code
}

tp3()
{
	tpstart "Reference 4.11.5-3(C)"
	tet_infoline "If the implementation supports the subsystem"
	tet_infoline "The /usr/share/man/man2 directory exists and is searchable"
	lsb_test_dir_searchable /usr/share/man/man2 >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
		tet_infoline "This test result needs to be manually resolved"
		tpresult FIP
		return
	fi
	tpresult				# set result code
}

tp4()
{
	tpstart "Reference 4.11.5-4(C)"
	tet_infoline "If the implementation supports the subsystem"
	tet_infoline "The /usr/share/man/man3 directory exists and is searchable"
	lsb_test_dir_searchable /usr/share/man/man3 >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
		tet_infoline "This test result needs to be manually resolved"
		tpresult FIP
		return
	fi
	tpresult				# set result code
}

tp5()
{
	tpstart "Reference 4.11.5-5(C)"
	tet_infoline "If the implementation supports the subsystem"
	tet_infoline "The /usr/share/man/man4 directory exists and is searchable"
	lsb_test_dir_searchable /usr/share/man/man4 >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
		tet_infoline "This test result needs to be manually resolved"
		tpresult FIP
		return
	fi
	tpresult				# set result code
}

tp6()
{
	tpstart "Reference 4.11.5-6(C)"
	tet_infoline "If the implementation supports the subsystem"
	tet_infoline "The /usr/share/man/man5 directory exists and is searchable"
	lsb_test_dir_searchable /usr/share/man/man5 >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
		tet_infoline "This test result needs to be manually resolved"
		tpresult FIP
		return
	fi
	tpresult				# set result code
}

tp7()
{
	tpstart "Reference 4.11.5-7(C)"
	tet_infoline "If the implementation supports the subsystem"
	tet_infoline "The /usr/share/man/man6 directory exists and is searchable"
	lsb_test_dir_searchable /usr/share/man/man6 >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
		tet_infoline "This test result needs to be manually resolved"
		tpresult FIP
		return
	fi
	tpresult				# set result code
}

tp8()
{
	tpstart "Reference 4.11.5-8(C)"
	tet_infoline "If the implementation supports the subsystem"
	tet_infoline "The /usr/share/man/man7 directory exists and is searchable"
	lsb_test_dir_searchable /usr/share/man/man7 >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
		tet_infoline "This test result needs to be manually resolved"
		tpresult FIP
		return
	fi
	tpresult				# set result code
}

tp9()
{
	tpstart "Reference 4.11.5-9(C)"
	tet_infoline "If the implementation supports the subsystem"
	tet_infoline "The /usr/share/man/man8 directory exists and is searchable"
	lsb_test_dir_searchable /usr/share/man/man8 >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
		tet_infoline "This test result needs to be manually resolved"
		tpresult FIP
		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
