web-test.sh 466 B

1234567891011121314
  1. #!/bin/sh
  2. ## We really need to pick a unique ephemeral port; start by just picking pid+1024
  3. PORT=$(($$ + 1024))
  4. echo "\n\nRun a HTTP server in the background on port " + $PORT
  5. python scripts/dummy-web-server.py $PORT & echo $! > server.PID
  6. sleep 1
  7. echo "\n\nRun test-http.py:"
  8. ./python.manifest scripts/test-http.py 127.0.0.1 $PORT > OUTPUT1
  9. wget -q http://127.0.0.1:$PORT/ -O OUTPUT2
  10. diff -q OUTPUT1 OUTPUT2
  11. kill `cat server.PID`
  12. rm -f OUTPUT1 OUTPUT2 server.PID