Enhance Whitelist IP test [TEST]

This commit is contained in:
Mitchell Krog 2019-06-28 13:13:35 +02:00
parent 8835ca2d3e
commit 6c8b7f95aa
No known key found for this signature in database
GPG key ID: C243C388553EDE5D

View file

@ -43,6 +43,14 @@ printf "\n\n"
sudo nginx -t && sudo nginx -s reload sudo nginx -t && sudo nginx -s reload
} }
waitforReload () {
echo "${bold}${yellow}-----------------------------------------------------------------------"
echo "${bold}${yellow}Sleeping for 10 seconds to allow Nginx to Properly Reload inside Travis"
echo "${bold}${yellow}-----------------------------------------------------------------------"
printf "\n\n"
sleep 10s
}
run_curltest1 () { run_curltest1 () {
if curl http://localhost:9000 2>&1 | grep -i '(52)'; then if curl http://localhost:9000 2>&1 | grep -i '(52)'; then
echo "${bold}${green}PASSED - ${bold}${red}blacklist own ip is WORKING" echo "${bold}${green}PASSED - ${bold}${red}blacklist own ip is WORKING"
@ -106,12 +114,7 @@ printf "\n\n"
blacklistOwnIP blacklistOwnIP
reloadNginX reloadNginX
waitforReload
echo "${bold}${yellow}-----------------------------------------------------------------------"
echo "${bold}${yellow}Sleeping for 10 seconds to allow Nginx to Properly Reload inside Travis"
echo "${bold}${yellow}-----------------------------------------------------------------------"
printf "\n\n"
sleep 10s
# ************************************************* # *************************************************
# Function Curl Test 1 - Test our IP is Blacklisted # Function Curl Test 1 - Test our IP is Blacklisted
@ -126,12 +129,7 @@ printf "\n\n"
whitelistOwnIP whitelistOwnIP
reloadNginX reloadNginX
waitforReload
echo "${bold}${yellow}-----------------------------------------------------------------------"
echo "${bold}${yellow}Sleeping for 10 seconds to allow Nginx to Properly Reload inside Travis"
echo "${bold}${yellow}-----------------------------------------------------------------------"
printf "\n\n"
sleep 10s
# ************************************************* # *************************************************
# Function Curl Test 2 - Test our IP is Whitelisted # Function Curl Test 2 - Test our IP is Whitelisted