Improve Test Results Commenting and Coloring

This commit is contained in:
Mitchell Krog 2019-06-24 09:58:32 +02:00
parent 6142ae46dc
commit 6481be32d8
No known key found for this signature in database
GPG key ID: C243C388553EDE5D

View file

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