#
# Writing with cache timeout
#
TEST=`basename $0`
writer -l 64k -c 64k -r 0 -d 0 -f checkfile

if [ "$1" = COOKIE ]; then
	trap "exit 1" 1 2 3 13 15
	sleep 45
	cmp testfile checkfile || (
		echo "$TEST (write timeout) failed: files differ"
		ls -l testfile checkfile
	)
	exit
fi
interrupt -ns HUP -t 60 -m "$TEST (write timeout)" \
	-- writer -l 64k -c 64k -d 3600 -f testfile \
	-- /bin/sh $0 COOKIE
rm -f testfile checkfile
