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