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