Home | History | Annotate | Line # | Download | only in testsuite
test-bigfile revision 1.4
      1 #! /bin/sh
      2 # $NetBSD: test-bigfile,v 1.4 2017/01/31 14:33:54 mrg Exp $
      3 
      4 test="$1"	# partial4000 or partial8000
      5 bozohttpd="$2"
      6 wget="$3"
      7 datadir="$4"
      8 verbose="$5"
      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}" &
     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