tests.sh 415 B

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