GHA workflow - Beta Tests / Isolate Working Dir [skip travis]

Ref: #419
This commit is contained in:
Mitchell Krog 2021-07-05 10:59:12 +02:00
parent 4305011d86
commit 1c41481ae5
No known key found for this signature in database
GPG key ID: E02E9D10427B6A43
5 changed files with 74 additions and 60 deletions

View file

@ -16,6 +16,8 @@
# #
##############################################################################
export TERM=xterm
# ------------------------------------------------------------------------------
# MIT License
# ------------------------------------------------------------------------------
@ -106,7 +108,7 @@ printf "\n"
echo "${bold}${green}---------------"
echo "${bold}${green}Reloading Nginx"
echo "${bold}${green}---------------"
sudo nginx -t && sudo nginx -s reload
sudo nginx -t && sudo systemctl reload nginx
}
waitforReload () {
@ -125,7 +127,7 @@ UAtest_mustmatch () {
for mustmatch in "${UAmustmatch[@]}"
do
if
curl -A "${mustmatch}" http://localhost:9000 2>&1 | grep -i '(52)'; then
curl -A "${mustmatch}" http://localhost:80 2>&1 | grep -i '(52)'; then
echo "${bold}${green}PASSED - ${red}${mustmatch} was ${bold}${red}BLOCKED"
else
echo "${bold}${red}FAILED - ${red}${mustmatch} was ${bold}${red}NOT BLOCKED"
@ -138,7 +140,7 @@ UAtest_mustnotmatch () {
for mustnotmatch in "${UAmustnotmatch[@]}"
do
if
curl -A "${mustnotmatch}" http://localhost:9000 2>&1 | grep -i '(52)'; then
curl -A "${mustnotmatch}" http://localhost:80 2>&1 | grep -i '(52)'; then
echo "${bold}${red}FAILED (FALSE POSITIVE DETECTED) - ${bold}${red}${mustnotmatch}"
exit 1
else
@ -155,7 +157,7 @@ REFtest_mustmatch () {
for mustmatch in "${REFmustmatch[@]}"
do
if
curl -I http://localhost:9000 -e "${mustmatch}" 2>&1 | grep -i '(52)'; then
curl -I http://localhost:80 -e "${mustmatch}" 2>&1 | grep -i '(52)'; then
echo "${bold}${green}PASSED - ${red}${mustmatch} was ${bold}${red}BLOCKED"
else
echo "${bold}${red}FAILED - ${red}${mustmatch} was ${bold}${red}NOT BLOCKED"
@ -168,7 +170,7 @@ REFtest_mustnotmatch () {
for mustnotmatch in "${REFmustnotmatch[@]}"
do
if
curl -I http://localhost:9000 -e "${mustnotmatch}" 2>&1 | grep -i '(52)'; then
curl -I http://localhost:80 -e "${mustnotmatch}" 2>&1 | grep -i '(52)'; then
echo "${bold}${red}FAILED (FALSE POSITIVE DETECTED) - ${bold}${red}${mustnotmatch}"
exit 1
else