#!/bin/sh
# spool-lpd-tc.sh : test case for /var/spool/lpd 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/var/spool-lpd/spool-lpd-tc.sh
#	AUTHOR:		Andrew Josey, The Open Group
#	DATE CREATED:	21 Dec 1998
##########################################################################

# This is $Revision: 1.4 $
#
# $Log: spool-lpd-tc.sh,v $
# Revision 1.4  2001/08/15 07:16:17  ajosey
# update the assertion numbers for FHS2.2
#
# Revision 1.3  2001/07/27 08:20:51  ajosey
# missing FAIL=N for FIPS cases
#
# Revision 1.2  2001/07/20 12:39:23  ajosey
# updated for FHS2.2
#
#
# -- old cvs log below --
# This is 1.3
#
# spool-lpd-tc.sh,v
# Revision 1.3  2000/04/17 01:50:20  cyeoh
# Updated reference numbers to 5.11.1-* for FHS2.1 changes
#
# Revision 1.2  2000/04/09 07:15:56  cyeoh
# Added CVS header information
#
#

tet_startup="startup"			# startup function
tet_cleanup="cleanup"			# cleanup function
iclist="ic1 ic2"
ic1="tp1"
ic2="tp2"


tp1()
{
	tpstart "Reference 5.14.3-1(C)"
	tet_infoline "If the subsystem is supported"
	tet_infoline "The /var/spool/lpd directory exists and is searchable"
	lsb_test_dir_searchable /var/spool/lpd >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
}

tp2()
{
	tpstart "Reference 5.14.3-2(C)"
	tet_infoline "If the implementation has the lpd daemon running then"
	tet_infoline "The lock file /var/spool/lpd/lpd.lock exists"
	lsb_test_file /var/spool/lpd/lpd.lock >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
