GHA workflow - Stage 2 Test 1 [skip travis]

This commit is contained in:
Mitchell Krog 2021-07-05 10:13:17 +02:00
parent d8b6fb4733
commit 8b23595106
No known key found for this signature in database
GPG key ID: E02E9D10427B6A43
2 changed files with 9 additions and 9 deletions

View file

@ -201,10 +201,10 @@ echo "${bold}${green}-------------------------------------------------------"
echo "${bold}${green}Backup all conf files and folders used during this test"
echo "${bold}${green}-------------------------------------------------------"
printf "\n"
sudo cp ./usr/local/nginx/bots.d/* ./dev-tools/test2_conf_files/bots.d/
sudo cp ./usr/local/nginx/conf.d/* ./dev-tools/test2_conf_files/conf.d/
sudo cp ./etc/nginx/sites-available/default.vhost ./dev-tools/test2_conf_files/default.vhost
sudo cp ./etc/nginx/nginx.conf ./dev-tools/test2_conf_files/nginx.conf
sudo cp /usr/local/nginx/bots.d/* ./dev-tools/test2_conf_files/bots.d/
sudo cp /usr/local/nginx/conf.d/* ./dev-tools/test2_conf_files/conf.d/
sudo cp /etc/nginx/sites-available/default.vhost ./dev-tools/test2_conf_files/default.vhost
sudo cp /etc/nginx/nginx.conf ./dev-tools/test2_conf_files/nginx.conf
}

View file

@ -127,11 +127,11 @@ UAtest_mustmatch () {
for mustmatch in "${UAmustmatch[@]}"
do
if
curl -A "${mustmatch}" http://localhost:80 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"
exit 0
exit 1
fi
done
}
@ -142,7 +142,7 @@ do
if
curl -A "${mustnotmatch}" http://localhost:80 2>&1 | grep -i '(52)'; then
echo "${bold}${red}FAILED (FALSE POSITIVE DETECTED) - ${bold}${red}${mustnotmatch}"
exit 0
exit 1
else
echo "${bold}${green}PASSED (No False Positive) - ${bold}${red}${mustnotmatch}"
fi
@ -161,7 +161,7 @@ do
echo "${bold}${green}PASSED - ${red}${mustmatch} was ${bold}${red}BLOCKED"
else
echo "${bold}${red}FAILED - ${red}${mustmatch} was ${bold}${red}NOT BLOCKED"
exit 0
exit 1
fi
done
}
@ -172,7 +172,7 @@ do
if
curl -I http://localhost:80 -e "${mustnotmatch}" 2>&1 | grep -i '(52)'; then
echo "${bold}${red}FAILED (FALSE POSITIVE DETECTED) - ${bold}${red}${mustnotmatch}"
exit 0
exit 1
else
echo "${bold}${green}PASSED (No False Positive) - ${bold}${red}${mustnotmatch}"
fi