Improve Test Commenting and Coloring

This commit is contained in:
Mitchell Krog 2019-06-23 12:46:17 +02:00
parent bee219ba84
commit 7cd3e80f26
No known key found for this signature in database
GPG key ID: C243C388553EDE5D

View file

@ -294,9 +294,9 @@ lines=$(cat ${file})
for line in ${lines}; do
if
curl -v -A "${line}" http://localhost:9000 2>&1 | grep -i 'Welcome'; then
echo "${bold}$(tput setaf 2)${line} $(tput setaf 2)was ALLOWED - ${bold}$(tput setaf 2)TEST PASSED"
echo "${bold}${green}PASSED - ${green}${line}was ALLOWED"
else
echo "${bold}$(tput setaf 1)${line} $(tput setaf 1)was NOT ALLOWED - ${bold}$(tput setaf 1)TEST FAILED"
echo "${bold}${red}FAILED - ${red}${line} was BLOCKED"
fi
done
IFS=""
@ -314,9 +314,9 @@ lines=$(cat ${file})
for line in ${lines}; do
if
curl -v -A "${line}" http://localhost:9000 2>&1 | grep -i 'Welcome'; then
echo "${bold}$(tput setaf 2)${line} $(tput setaf 2)was ALLOWED - ${bold}$(tput setaf 2)TEST PASSED"
echo "${bold}${green}PASSED - ${green}${line} was ALLOWED"
else
echo "${bold}$(tput setaf 1)${line} $(tput setaf 1)was NOT ALLOWED - ${bold}$(tput setaf 1)TEST FAILED"
echo "${bold}${red}FAILED - ${red}${line} was BLOCKED"
fi
done
IFS=""
@ -333,9 +333,9 @@ lines=$(cat ${file})
for line in ${lines}; do
if
curl -v -A "${line}" http://localhost:9000 2>&1 | grep -i 'Welcome'; then
echo "${bold}$(tput setaf 2)${line} $(tput setaf 2)was ALLOWED - ${bold}$(tput setaf 2)TEST PASSED"
echo "${bold}${green}PASSED - ${green}${line} was ALLOWED"
else
echo "${bold}$(tput setaf 1)${line} $(tput setaf 1)was NOT ALLOWED - ${bold}$(tput setaf 1)TEST FAILED"
echo "${bold}${green}FAILED - ${red}${line} was BLOCKED"
fi
done
IFS=""
@ -353,9 +353,9 @@ lines=$(cat ${file})
for line in ${lines}; do
if
curl -I http://localhost:9000 -e "http://${line}" 2>&1 | grep -i '(52)'; then
echo "${bold}$(tput setaf 1)${line} $(tput setaf 1)was BLOCKED - ${bold}$(tput setaf 2)TEST PASSED"
echo "${bold}${green}PASSED - ${red}${line} was BLOCKED"
else
echo "${bold}$(tput setaf 1)${line} $(tput setaf 1)was NOT BLOCKED - ${bold}$(tput setaf 1)TEST FAILED"
echo "${bold}${red}FAILED - ${red}${line} was NOT BLOCKED"
fi
done
IFS=""