Improve Test Commenting

This commit is contained in:
Mitchell Krog 2019-06-23 10:48:37 +02:00
parent d767dbb885
commit 72cafcc2a0
No known key found for this signature in database
GPG key ID: C243C388553EDE5D

View file

@ -257,6 +257,7 @@ fi
} }
run_curltest15 run_curltest15
bold=$(tput bold)
# ************************************************ # ************************************************
# Test 100 Random User-Agents from Bad-User-Agents # Test 100 Random User-Agents from Bad-User-Agents
# ************************************************ # ************************************************
@ -271,9 +272,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 "$(tput setaf 1)BAD BOT ${line} DETECTED - $(tput setaf 2)TEST PASSED" echo "${bold}$(tput setaf 1)${line} $(tput setaf 2)was BLOCKED - $(tput setaf 2)TEST PASSED"
else else
echo "$(tput setaf 1)BAD BOT ${line} NOT DETECTED - TEST FAILED" echo "${bold}$(tput setaf 1)${line} was NOT BLOCKED - TEST FAILED"
fi fi
done done
IFS="" IFS=""
@ -290,9 +291,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 "$(tput setaf 2)GOOD BOT ${line} ALLOWED - TEST PASSED" echo "$(tput setaf 2)${line} was ALLOWED - TEST PASSED"
else else
echo "$(tput setaf 1)GOOD BOT ${line} NOT ALLOWED - TEST FAILED" echo "$(tput setaf 1)${line} was NOT ALLOWED - TEST FAILED"
fi fi
done done
IFS="" IFS=""
@ -310,9 +311,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 "$(tput setaf 2)ALLOWED BOT ${line} ALLOWED - TEST PASSED" echo "$(tput setaf 2)${line} was ALLOWED - TEST PASSED"
else else
echo "$(tput setaf 1)ALLOWED BOT NOT ${line} ALLOWED - TEST FAILED" echo "$(tput setaf 1)${line} was NOT ALLOWED - TEST FAILED"
fi fi
done done
IFS="" IFS=""
@ -329,9 +330,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 "$(tput setaf 2)LIMITED BOT ${line} ALLOWED - TEST PASSED" echo "$(tput setaf 2)${line} was ALLOWED - TEST PASSED"
else else
echo "$(tput setaf 1)LIMITED BOT ${line} NOT ALLOWED - TEST FAILED" echo "$(tput setaf 1)${line} was NOT ALLOWED - TEST FAILED"
fi fi
done done
IFS="" IFS=""
@ -348,9 +349,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 "$(tput setaf 1)BAD REFERRER ${line} DETECTED - $(tput setaf 2)TEST PASSED" echo "$(tput setaf 1)${line} was BLOCKED - $(tput setaf 2)TEST PASSED"
else else
echo "$(tput setaf 1)BAD REFERRER ${line} NOT DETECTED - TEST FAILED" echo "$(tput setaf 1)${line} was NOT BLOCKED - TEST FAILED"
fi fi
done done
IFS="" IFS=""