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