test-bigfile revision 1.4
11.1Smrg#! /bin/sh 21.4Smrg# $NetBSD: test-bigfile,v 1.4 2017/01/31 14:33:54 mrg Exp $ 31.1Smrg 41.1Smrgtest="$1" # partial4000 or partial8000 51.1Smrgbozohttpd="$2" 61.1Smrgwget="$3" 71.1Smrgdatadir="$4" 81.3Sschmonzverbose="$5" 91.3Sschmonz 101.4Smrgtmperr="tmp.$test.err" 111.4Smrg 121.3Sschmonzif [ "yes" = "$verbose" ]; then 131.3Sschmonz echo "Running test $test" 141.3Sschmonzelse 151.4Smrg exec 2>"$tmperr" 161.3Sschmonzfi 171.1Smrg 181.1Smrgbozotestport=11111 191.1Smrg 201.1Smrg# copy beginning file 211.4Smrgcp "${datadir}/bigfile.${test}" ./bigfile 221.1Smrg 231.1Smrg# fire up bozohttpd 241.4Smrg${bozohttpd} -b -b -I ${bozotestport} -n -s -f "${datadir}" & 251.1Smrgbozopid=$! 261.1Smrg 271.4Smrg"${wget}" -c http://localhost:${bozotestport}/bigfile 281.1Smrg 291.1Smrgkill -9 $bozopid 301.1Smrg 311.4Smrgif cmp ./bigfile "${datadir}/bigfile"; then 321.1Smrg rm -f ./bigfile 331.1Smrg exit 0 341.1Smrgelse 351.1Smrg rm -f ./bigfile 361.4Smrg if [ "yes" = "$verbose" ]; then 371.4Smrg echo "Failed test $test:" 381.4Smrg cat "$tmperr" 391.4Smrg fi 401.1Smrg exit 1 411.1Smrgfi 42