#!/bin/sh
# $Id: t-file.sh,v 1.12 2004/12/29 23:47:29 ca Exp $
# Copyright (c) 2003, 2004 Sendmail, Inc. and its suppliers.
#	All rights reserved.
#
# By using this file, you agree to the terms and conditions set
# forth in the LICENSE file which can be found at the top level of
# the sendmail distribution.
#
# test file operations, e.g., timeout
#
test -s stop && exit 1
#
FN="foo"
ERR="error.log"
rm -f ${FN} ${ERR}
echo "foo bar" > ${FN}
./t-filecat < ${FN} > /dev/null 2> ${ERR}
if grep 'read: EOF' ${ERR}  >/dev/null
then
	:
else
	echo ERROR: expected 'read: EOF'
	cat ${ERR}
	exit 1
fi
./yes | ./t-filecat 2> ${ERR} | (sleep 5; cat >/dev/null)
if grep 'write: .*type=3' ${ERR}  >/dev/null
then
	:
else
	echo ERROR: expected 'type=3'
	cat ${ERR}
	exit 1
fi
rm -f ${FN} ${ERR}
exit 0


syntax highlighted by Code2HTML, v. 0.9.1