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