test-bigfile revision 1.5
1#! /bin/sh
2# $NetBSD: test-bigfile,v 1.5 2018/11/21 09:37:02 mrg Exp $
3
4test="$1"; shift	# partial4000 or partial8000
5bozohttpd="$1"; shift
6wget="$1"; shift
7datadir="$1"; shift
8verbose="$1"; shift
9host="$1"; shift
10
11tmperr="tmp.$test.err"
12
13if [ "yes" = "$verbose" ]; then
14	echo "Running test $test"
15else
16	exec 2>"$tmperr"
17fi
18
19bozotestport=11111
20
21# copy beginning file
22cp "${datadir}/bigfile.${test}" ./bigfile
23
24# fire up bozohttpd
25${bozohttpd} -b -b -I ${bozotestport} -n -s -f "$@" "${datadir}" "${host}" &
26bozopid=$!
27
28"${wget}" -c http://localhost:${bozotestport}/bigfile
29
30kill -9 $bozopid
31
32if cmp ./bigfile "${datadir}/bigfile"; then
33	rm -f ./bigfile
34	exit 0
35else
36	rm -f ./bigfile
37	if [ "yes" = "$verbose" ]; then
38		echo "Failed test $test:"
39		cat "$tmperr"
40	fi
41	exit 1
42fi
43