mirror of
https://github.com/cytopia/devilbox.git
synced 2025-04-23 02:00:50 +00:00
Check against PHPRedmin
This commit is contained in:
parent
a459597759
commit
178a81c24b
41
.tests/intra-tests/vendor-phpredmin.sh
Executable file
41
.tests/intra-tests/vendor-phpredmin.sh
Executable file
@ -0,0 +1,41 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
set -u
|
||||
set -o pipefail
|
||||
|
||||
|
||||
#
|
||||
# NOTE: Parsing curl to tac to circumnvent "failed writing body"
|
||||
# https://stackoverflow.com/questions/16703647/why-curl-return-and-error-23-failed-writing-body
|
||||
#
|
||||
|
||||
|
||||
###
|
||||
### Ensure PHPRedmin works
|
||||
###
|
||||
|
||||
URL="/vendor/phpredmin/public/index.php"
|
||||
|
||||
printf "[TEST] Fetch ${URL}"
|
||||
# 1st Try
|
||||
if [ "$(curl -sS localhost${URL} | tac | tac | grep -Ec "Strings|Hashes|Lists|Sets|Sorted Sets")" != "5" ]; then
|
||||
# 2nd Try
|
||||
sleep 1
|
||||
if [ "$(curl -sS localhost${URL} | tac | tac | grep -Ec "Strings|Hashes|Lists|Sets|Sorted Sets")" != "5" ]; then
|
||||
# 3rd Try
|
||||
sleep 1
|
||||
if [ "$(curl -sS localhost${URL} | tac | tac | grep -Ec "Strings|Hashes|Lists|Sets|Sorted Sets")" != "5" ]; then
|
||||
printf "\r[FAIL] Fetch ${URL}\n"
|
||||
curl -sS localhost/${URL} || true
|
||||
curl -sSI localhost/${URL} || true
|
||||
exit 1
|
||||
else
|
||||
printf "\r[OK] Fetch ${URL} (3 rounds)\n"
|
||||
fi
|
||||
else
|
||||
printf "\r[OK] Fetch ${URL} (2 rounds)\n"
|
||||
fi
|
||||
else
|
||||
printf "\r[OK] Fetch ${URL} (1 round)\n"
|
||||
fi
|
Loading…
x
Reference in New Issue
Block a user