tests.sh 432 B

1234567891011121314151617181920
  1. #!/bin/sh
  2. while ! timeout 1 bash -c "echo > /dev/tcp/vote/80"; do
  3. sleep 1
  4. done
  5. curl -sS -X POST --data "vote=b" http://vote > /dev/null
  6. sleep 10
  7. if phantomjs render.js http://result | grep -q '1 vote'; then
  8. echo -e "\\e[42m------------"
  9. echo -e "\\e[92mTests passed"
  10. echo -e "\\e[42m------------"
  11. exit 0
  12. else
  13. echo -e "\\e[41m------------"
  14. echo -e "\\e[91mTests failed"
  15. echo -e "\\e[41m------------"
  16. exit 1
  17. fi