2018-12-10 19:21:44 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
set -u
|
|
|
|
set -o pipefail
|
|
|
|
|
2018-12-15 21:58:29 +00:00
|
|
|
#
|
|
|
|
# NOTE: Parsing curl to tac to circumnvent "failed writing body"
|
|
|
|
# https://stackoverflow.com/questions/16703647/why-curl-return-and-error-23-failed-writing-body
|
|
|
|
#
|
|
|
|
|
2018-12-10 19:21:44 +00:00
|
|
|
|
|
|
|
printf "[TEST] devilbox-version key in Redis"
|
|
|
|
# 1st Try
|
2018-12-15 21:58:29 +00:00
|
|
|
if ! curl -sS localhost/db_redis.php | tac | tac | grep -q 'devilbox-version'; then
|
2018-12-10 19:21:44 +00:00
|
|
|
sleep 1
|
2018-12-15 21:58:29 +00:00
|
|
|
if ! curl -sS localhost/db_redis.php | tac | tac | grep -q 'devilbox-version'; then
|
2018-12-10 19:21:44 +00:00
|
|
|
sleep 1
|
2018-12-15 21:58:29 +00:00
|
|
|
if ! curl -sS localhost/db_redis.php | tac | tac | grep -q 'devilbox-version'; then
|
2018-12-10 19:21:44 +00:00
|
|
|
printf "\r[FAIL] devilbox-version key in Redis\n"
|
|
|
|
curl -sS localhost/db_redis.php || true
|
|
|
|
exit 1
|
|
|
|
else
|
|
|
|
printf "\r[OK] devilbox-version key in Redis (3 rounds)\n"
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
printf "\r[OK] devilbox-version key in Redis (2 rounds)\n"
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
printf "\r[OK] devilbox-version key in Redis (1 round)\n"
|
|
|
|
fi
|