2016-06-18 18:14:28 +02:00
|
|
|
#!/bin/sh
|
2017-12-14 10:49:06 +01:00
|
|
|
|
|
|
|
while ! timeout 1 bash -c "echo > /dev/tcp/vote/80"; do
|
|
|
|
sleep 1
|
|
|
|
done
|
|
|
|
|
2016-06-18 18:14:28 +02:00
|
|
|
curl -sS -X POST --data "vote=b" http://vote > /dev/null
|
|
|
|
sleep 10
|
2017-12-14 10:49:06 +01:00
|
|
|
|
2016-06-19 20:34:14 +02:00
|
|
|
if phantomjs render.js http://result | grep -q '1 vote'; then
|
2017-12-14 10:49:06 +01:00
|
|
|
echo -e "\\e[42m------------"
|
|
|
|
echo -e "\\e[92mTests passed"
|
|
|
|
echo -e "\\e[42m------------"
|
2016-06-18 18:14:28 +02:00
|
|
|
exit 0
|
2017-12-14 10:49:06 +01:00
|
|
|
else
|
|
|
|
echo -e "\\e[41m------------"
|
|
|
|
echo -e "\\e[91mTests failed"
|
|
|
|
echo -e "\\e[41m------------"
|
2016-06-18 18:14:28 +02:00
|
|
|
exit 1
|
2017-12-14 10:49:06 +01:00
|
|
|
fi
|