test-bigfile revision 1.3
11.1Smrg#! /bin/sh
21.3Sschmonz# $NetBSD: test-bigfile,v 1.3 2016/09/23 16:55:56 schmonz Exp $
31.1Smrg
41.1Smrgtest="$1"	# partial4000 or partial8000
51.1Smrgbozohttpd="$2"
61.1Smrgwget="$3"
71.1Smrgdatadir="$4"
81.3Sschmonzverbose="$5"
91.3Sschmonz
101.3Sschmonzif [ "yes" = "$verbose" ]; then
111.3Sschmonz	echo "Running test $test"
121.3Sschmonzelse
131.3Sschmonz	exec 2>tmp.$test.err
141.3Sschmonzfi
151.1Smrg
161.1Smrgbozotestport=11111
171.1Smrg
181.1Smrg# copy beginning file
191.2Smrgcp ${datadir}/bigfile.${test} ./bigfile
201.1Smrg
211.1Smrg# fire up bozohttpd
221.1Smrg${bozohttpd} -b -b -I ${bozotestport} -n -s -f ${datadir} &
231.1Smrgbozopid=$!
241.1Smrg
251.1Smrg${wget} -c http://localhost:${bozotestport}/bigfile
261.1Smrg
271.1Smrgkill -9 $bozopid
281.1Smrg
291.2Smrgif cmp ./bigfile ${datadir}/bigfile; then
301.1Smrg	rm -f ./bigfile
311.1Smrg	exit 0
321.1Smrgelse
331.1Smrg	rm -f ./bigfile
341.3Sschmonz	[ "yes" = "$verbose" ] || echo "Failed test $test: `cat tmp.$test.err`"
351.1Smrg	exit 1
361.1Smrgfi
37