mirror of
https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker.git
synced 2025-09-03 19:20:16 +00:00
Remove Banner Printing / Update Quick Test Commenting
This commit is contained in:
parent
fa5e6941df
commit
7f6a2a72f2
2 changed files with 114 additions and 82 deletions
|
@ -16,30 +16,58 @@
|
||||||
# #
|
# #
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
|
# ************************
|
||||||
|
# Set Terminal Font Colors
|
||||||
|
# ************************
|
||||||
|
|
||||||
|
bold=$(tput bold)
|
||||||
|
red=$(tput setaf 1)
|
||||||
|
green=$(tput setaf 2)
|
||||||
|
yellow=$(tput setaf 3)
|
||||||
|
blue=$(tput setaf 4)
|
||||||
|
magenta=$(tput setaf 5)
|
||||||
|
cyan=$(tput setaf 6)
|
||||||
|
white=$(tput setaf 7)
|
||||||
|
defaultcolor=$(tput setaf default)
|
||||||
|
|
||||||
# *******************************************
|
# *******************************************
|
||||||
# Set Location of our Curl Test Results Files
|
# Set Location of our Curl Test Results Files
|
||||||
# *******************************************
|
# *******************************************
|
||||||
|
|
||||||
echo "Tests Starting"
|
echo "${bold}${green}------------------------------------------------"
|
||||||
|
echo "${bold}${green}Disable any User Whitelisting and set to Default"
|
||||||
echo "Disable any User Whitelisting and set to Default"
|
echo "${bold}${green}------------------------------------------------"
|
||||||
|
printf "\n\n"
|
||||||
sudo cp ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/blacklist-user-agents-none.conf /etc/nginx/bots.d/blacklist-user-agents.conf
|
sudo cp ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/blacklist-user-agents-none.conf /etc/nginx/bots.d/blacklist-user-agents.conf
|
||||||
echo "Reloading Nginx"
|
|
||||||
|
echo "${bold}${green}---------------"
|
||||||
|
echo "${bold}${green}Reloading Nginx"
|
||||||
|
echo "${bold}${green}---------------"
|
||||||
|
printf "\n\n"
|
||||||
sudo nginx -t && sudo nginx -s reload
|
sudo nginx -t && sudo nginx -s reload
|
||||||
|
|
||||||
echo "Sleeping for 30 seconds to allow Nginx Properly Reload inside Travis"
|
echo "${bold}${yellow}--------------------------------------------------------------------"
|
||||||
|
echo "${bold}${yellow}Sleeping for 30 seconds to allow Nginx Properly Reload inside Travis"
|
||||||
|
echo "${bold}${yellow}--------------------------------------------------------------------"
|
||||||
|
printf "\n\n"
|
||||||
sleep 30s
|
sleep 30s
|
||||||
|
|
||||||
|
echo "${bold}${green}--------------"
|
||||||
|
echo "${bold}${green}Tests Starting"
|
||||||
|
echo "${bold}${green}--------------"
|
||||||
|
printf "\n\n"
|
||||||
|
|
||||||
|
|
||||||
# *************************************************
|
# *************************************************
|
||||||
# Function Curl Test 1 - Check for Bad Bot "80legs"
|
# Function Curl Test 1 - Check for Bad Bot "80legs"
|
||||||
# *************************************************
|
# *************************************************
|
||||||
|
|
||||||
run_curltest1 () {
|
run_curltest1 () {
|
||||||
printf '\n%s\n%s\n%s\n\n' "#########################" "TESTING BAD BOT IS DENIED" "#########################"
|
printf '\n%s\n%s\n%s\n\n' "#########################" "TESTING BAD BOT IS DENIED" "#########################"
|
||||||
if curl -v -A "80legs" http://localhost:9000/index.html 2>&1 | grep -i '(52)'; then
|
if curl -v -A "80legs" http://localhost:9000 2>&1 | grep -i '(52)'; then
|
||||||
echo "$(tput setaf 1)BAD BOT DETECTED - $(tput setaf 2)TEST PASSED"
|
echo "${bold}${green}PASSED - ${red}BAD BOT DETECTED"
|
||||||
else
|
else
|
||||||
echo "$(tput setaf 1)BAD BOT NOT DETECTED - TEST FAILED"
|
echo "${bold}${red}FAILED - ${red}BAD BOT NOT DETECTED"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
@ -52,10 +80,10 @@ run_curltest1
|
||||||
|
|
||||||
run_curltest2 () {
|
run_curltest2 () {
|
||||||
printf '\n%s\n%s\n%s\n\n' "#########################" "TESTING BAD BOT IS DENIED" "#########################"
|
printf '\n%s\n%s\n%s\n\n' "#########################" "TESTING BAD BOT IS DENIED" "#########################"
|
||||||
if curl -v -A "Nutch" http://localhost:9000/index.html 2>&1 | grep -i '(52)'; then
|
if curl -v -A "Nutch" http://localhost:9000 2>&1 | grep -i '(52)'; then
|
||||||
echo "$(tput setaf 1)BAD BOT DETECTED - $(tput setaf 2)TEST PASSED"
|
echo "${bold}${green}PASSED - ${red}BAD BOT DETECTED"
|
||||||
else
|
else
|
||||||
echo "$(tput setaf 1)BAD BOT NOT DETECTED - TEST FAILED"
|
echo "${bold}${red}FAILED - ${red}BAD BOT NOT DETECTED"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
@ -68,10 +96,10 @@ run_curltest2
|
||||||
|
|
||||||
run_curltest3 () {
|
run_curltest3 () {
|
||||||
printf '\n%s\n%s\n%s\n\n' "##############################" "TESTING BAD REFERRER IS DENIED" "##############################"
|
printf '\n%s\n%s\n%s\n\n' "##############################" "TESTING BAD REFERRER IS DENIED" "##############################"
|
||||||
if curl -I http://localhost:9000/index.html -e http://100dollars-seo.com 2>&1 | grep -i '(52)'; then
|
if curl -I http://localhost:9000 -e http://100dollars-seo.com 2>&1 | grep -i '(52)'; then
|
||||||
echo "$(tput setaf 1)BAD REFERRER DETECTED - $(tput setaf 2)TEST PASSED"
|
echo "${bold}${green}PASSED - ${red}BAD REFERRER DETECTED"
|
||||||
else
|
else
|
||||||
echo "$(tput setaf 1)BAD REFERRER NOT DETECTED - TEST FAILED"
|
echo "${bold}${red}FAILED - ${red}BAD REFERRER NOT DETECTED"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
@ -84,10 +112,10 @@ run_curltest3
|
||||||
|
|
||||||
run_curltest4 () {
|
run_curltest4 () {
|
||||||
printf '\n%s\n%s\n%s\n\n' "##############################" "TESTING BAD REFERRER IS DENIED" "##############################"
|
printf '\n%s\n%s\n%s\n\n' "##############################" "TESTING BAD REFERRER IS DENIED" "##############################"
|
||||||
if curl -I http://localhost:9000/index.html -e http://zx6.ru 2>&1 | grep -i '(52)'; then
|
if curl -I http://localhost:9000 -e http://zx6.ru 2>&1 | grep -i '(52)'; then
|
||||||
echo "$(tput setaf 1)BAD REFERRER DETECTED - $(tput setaf 2)TEST PASSED"
|
echo "${bold}${green}PASSED - ${red}BAD REFERRER DETECTED"
|
||||||
else
|
else
|
||||||
echo "$(tput setaf 1)BAD REFERRER NOT DETECTED - TEST FAILED"
|
echo "${bold}${red}FAILED - ${red}BAD REFERRER NOT DETECTED"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
@ -99,10 +127,10 @@ run_curltest4
|
||||||
|
|
||||||
run_curltest5 () {
|
run_curltest5 () {
|
||||||
printf '\n%s\n%s\n%s\n\n' "###########################" "TESTING GOOD BOT IS ALLOWED" "###########################"
|
printf '\n%s\n%s\n%s\n\n' "###########################" "TESTING GOOD BOT IS ALLOWED" "###########################"
|
||||||
if curl -v -A "GoogleBot" http://localhost:9000/index.html 2>&1 | grep -i 'Welcome'; then
|
if curl -v -A "GoogleBot" http://localhost:9000 2>&1 | grep -i 'Welcome'; then
|
||||||
echo "$(tput setaf 2)GOOD BOT ALLOWED THROUGH - TEST PASSED"
|
echo "${bold}${green}PASSED - ${green}GOOD BOT ALLOWED THROUGH"
|
||||||
else
|
else
|
||||||
echo "$(tput setaf 1)GOOD BOT NOT ALLOWED THROUGH - TEST FAILED"
|
echo "${bold}${red}FAILED - ${red}GOOD BOT NOT ALLOWED THROUGH"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
@ -114,10 +142,10 @@ run_curltest5
|
||||||
|
|
||||||
run_curltest6 () {
|
run_curltest6 () {
|
||||||
printf '\n%s\n%s\n%s\n\n' "###########################" "TESTING GOOD BOT IS ALLOWED" "###########################"
|
printf '\n%s\n%s\n%s\n\n' "###########################" "TESTING GOOD BOT IS ALLOWED" "###########################"
|
||||||
if curl -v -A "BingBot" http://localhost:9000/index.html 2>&1 | grep -i 'Welcome'; then
|
if curl -v -A "BingBot" http://localhost:9000 2>&1 | grep -i 'Welcome'; then
|
||||||
echo "$(tput setaf 2)GOOD BOT ALLOWED THROUGH - TEST PASSED"
|
echo "${bold}${green}PASSED - ${green}GOOD BOT ALLOWED THROUGH"
|
||||||
else
|
else
|
||||||
echo "$(tput setaf 1)GOOD BOT NOT ALLOWED THROUGH - TEST FAILED"
|
echo "${bold}${red}FAILED - ${red}GOOD BOT NOT ALLOWED THROUGH"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
@ -129,10 +157,10 @@ run_curltest6
|
||||||
|
|
||||||
run_curltest7 () {
|
run_curltest7 () {
|
||||||
printf '\n%s\n%s\n%s\n\n' "################################" "TESTING GOOD REFERRER IS ALLOWED" "################################"
|
printf '\n%s\n%s\n%s\n\n' "################################" "TESTING GOOD REFERRER IS ALLOWED" "################################"
|
||||||
if curl http://localhost:9000/index.html -e http://google.com 2>&1 | grep -i 'Welcome'; then
|
if curl http://localhost:9000 -e http://google.com 2>&1 | grep -i 'Welcome'; then
|
||||||
echo "$(tput setaf 2)GOOD REFERRER DETECTED - TEST PASSED"
|
echo "${bold}${green}PASSED - ${green}GOOD REFERRER DETECTED"
|
||||||
else
|
else
|
||||||
echo "$(tput setaf 1)GOOD REFERRER NOT DETECTED - TEST FAILED"
|
echo "${bold}${red}FAILED - ${red}GOOD REFERRER NOT DETECTED"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
@ -144,10 +172,10 @@ run_curltest7
|
||||||
|
|
||||||
run_curltest8 () {
|
run_curltest8 () {
|
||||||
printf '\n%s\n%s\n%s\n\n' "################################" "TESTING GOOD REFERRER IS ALLOWED" "################################"
|
printf '\n%s\n%s\n%s\n\n' "################################" "TESTING GOOD REFERRER IS ALLOWED" "################################"
|
||||||
if curl http://localhost:9000/index.html -e http://bing.com 2>&1 | grep -i 'Welcome'; then
|
if curl http://localhost:9000 -e http://bing.com 2>&1 | grep -i 'Welcome'; then
|
||||||
echo "$(tput setaf 2)GOOD REFERRER DETECTED - TEST PASSED"
|
echo "${bold}${green}PASSED - ${red}GOOD REFERRER DETECTED"
|
||||||
else
|
else
|
||||||
echo "$(tput setaf 1)GOOD REFERRER NOT DETECTED - TEST FAILED"
|
echo "${bold}${red}FAILED - ${red}GOOD REFERRER NOT DETECTED"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
@ -159,10 +187,10 @@ run_curltest8
|
||||||
|
|
||||||
run_curltest9 () {
|
run_curltest9 () {
|
||||||
printf '\n%s\n%s\n%s\n\n' "#########################" "TESTING BAD BOT IS DENIED" "#########################"
|
printf '\n%s\n%s\n%s\n\n' "#########################" "TESTING BAD BOT IS DENIED" "#########################"
|
||||||
if curl -A "Googlebot/Nutch-1.7" http://localhost:9000/index.html 2>&1 | grep -i '(52)'; then
|
if curl -A "Googlebot/Nutch-1.7" http://localhost:9000 2>&1 | grep -i '(52)'; then
|
||||||
echo "$(tput setaf 1)BAD BOT DETECTED - $(tput setaf 2)TEST PASSED"
|
echo "${bold}${green}PASSED - ${red}BAD BOT DETECTED"
|
||||||
else
|
else
|
||||||
echo "$(tput setaf 1)BAD BOT NOT DETECTED - TEST FAILED"
|
echo "${bold}${red}FAILED - ${red}BAD BOT NOT DETECTED"
|
||||||
#exit 1
|
#exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
@ -174,10 +202,10 @@ run_curltest9
|
||||||
|
|
||||||
run_curltest10 () {
|
run_curltest10 () {
|
||||||
printf '\n%s\n%s\n%s\n\n' "#########################" "TESTING BAD BOT IS DENIED" "#########################"
|
printf '\n%s\n%s\n%s\n\n' "#########################" "TESTING BAD BOT IS DENIED" "#########################"
|
||||||
if curl -A "Mozilla/5.0 (compatible; Googlebot/Nutch2.1; +http://www.google.com/bot.html)" http://localhost:9000/index.html 2>&1 | grep -i '(52)'; then
|
if curl -A "Mozilla/5.0 (compatible; Googlebot/Nutch2.1; +http://www.google.com/bot.html)" http://localhost:9000 2>&1 | grep -i '(52)'; then
|
||||||
echo "$(tput setaf 1)BAD BOT DETECTED - $(tput setaf 2)TEST PASSED"
|
echo "${bold}${green}PASSED - ${red}BAD BOT DETECTED"
|
||||||
else
|
else
|
||||||
echo "$(tput setaf 1)BAD BOT NOT DETECTED - TEST FAILED"
|
echo "${bold}${red}FAILED - ${red}BAD BOT NOT DETECTED"
|
||||||
#exit 1
|
#exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
@ -189,10 +217,10 @@ run_curltest10
|
||||||
|
|
||||||
run_curltest11 () {
|
run_curltest11 () {
|
||||||
printf '\n%s\n%s\n%s\n\n' "#########################" "TESTING BAD BOT IS DENIED" "#########################"
|
printf '\n%s\n%s\n%s\n\n' "#########################" "TESTING BAD BOT IS DENIED" "#########################"
|
||||||
if curl -A "Mozilla/5.0 (compatible; Googlebot/nutch/-2.1; +http://www.google.com/bot.html)" http://localhost:9000/index.html 2>&1 | grep -i '(52)'; then
|
if curl -A "Mozilla/5.0 (compatible; Googlebot/nutch/-2.1; +http://www.google.com/bot.html)" http://localhost:9000 2>&1 | grep -i '(52)'; then
|
||||||
echo "$(tput setaf 1)BAD BOT DETECTED - $(tput setaf 2)TEST PASSED"
|
echo "${bold}${green}PASSED - ${red}BAD BOT DETECTED"
|
||||||
else
|
else
|
||||||
echo "$(tput setaf 1)BAD BOT NOT DETECTED - TEST FAILED"
|
echo "${bold}${red}FAILED - BAD BOT NOT DETECTED"
|
||||||
#exit 1
|
#exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
@ -204,10 +232,10 @@ run_curltest11
|
||||||
|
|
||||||
run_curltest12 () {
|
run_curltest12 () {
|
||||||
printf '\n%s\n%s\n%s\n\n' "############################" "TESTING FALSE POSITIVE CASES" "############################"
|
printf '\n%s\n%s\n%s\n\n' "############################" "TESTING FALSE POSITIVE CASES" "############################"
|
||||||
if curl -v -A "Mozilla/5.0 (compatible; Googlebot-Image/Snutch\-/-2.1; +http://www.google.com/bot.html)" http://localhost:9000/index.html 2>&1 | grep -i 'Welcome'; then
|
if curl -v -A "Mozilla/5.0 (compatible; Googlebot-Image/Snutch\-/-2.1; +http://www.google.com/bot.html)" http://localhost:9000 2>&1 | grep -i 'Welcome'; then
|
||||||
echo "$(tput setaf 2)NO FALSE POSITIVE - TEST PASSED"
|
echo "${bold}${green}PASSED - NO FALSE POSITIVE"
|
||||||
else
|
else
|
||||||
echo "$(tput setaf 1)FALSE POSITIVE - TEST FAILED"
|
echo "${bold}${red}FAILED - FALSE POSITIVE FOUND"
|
||||||
#exit 1
|
#exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
@ -219,10 +247,10 @@ run_curltest12
|
||||||
|
|
||||||
run_curltest13 () {
|
run_curltest13 () {
|
||||||
printf '\n%s\n%s\n%s\n\n' "############################" "TESTING FALSE POSITIVE CASES" "############################"
|
printf '\n%s\n%s\n%s\n\n' "############################" "TESTING FALSE POSITIVE CASES" "############################"
|
||||||
if curl -v -A "SnutchMozilla/5.0 (compatible; Googlebot-Image/SMutch\-/-2.1; +http://www.google.com/bot.html)" http://localhost:9000/index.html 2>&1 | grep -i 'Welcome'; then
|
if curl -v -A "SnutchMozilla/5.0 (compatible; Googlebot-Image/SMutch\-/-2.1; +http://www.google.com/bot.html)" http://localhost:9000 2>&1 | grep -i 'Welcome'; then
|
||||||
echo "$(tput setaf 2)NO FALSE POSITIVE - TEST PASSED"
|
echo "${bold}${green}PASSED - NO FALSE POSITIVE"
|
||||||
else
|
else
|
||||||
echo "$(tput setaf 1)FALSE POSITIVE - TEST FAILED"
|
echo "${bold}${red}FAILED - FALSE POSITIVE FOUND"
|
||||||
#exit 1
|
#exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
@ -234,10 +262,10 @@ run_curltest13
|
||||||
|
|
||||||
run_curltest14 () {
|
run_curltest14 () {
|
||||||
printf '\n%s\n%s\n%s\n\n' "############################" "TESTING FALSE POSITIVE CASES" "############################"
|
printf '\n%s\n%s\n%s\n\n' "############################" "TESTING FALSE POSITIVE CASES" "############################"
|
||||||
if curl -v -A "Mozilla/5.0 (X11; Linux x86_64; rv:67.0) Gecko/20100101 Firefox/67.0" http://localhost:9000/index.html 2>&1 | grep -i 'Welcome'; then
|
if curl -v -A "Mozilla/5.0 (X11; Linux x86_64; rv:67.0) Gecko/20100101 Firefox/67.0" http://localhost:9000 2>&1 | grep -i 'Welcome'; then
|
||||||
echo "$(tput setaf 2)NO FALSE POSITIVE - TEST PASSED"
|
echo "${bold}${green}PASSED - NO FALSE POSITIVE"
|
||||||
else
|
else
|
||||||
echo "$(tput setaf 1)FALSE POSITIVE - TEST FAILED"
|
echo "${bold}${red}FAILED - FALSE POSITIVE FOUND"
|
||||||
#exit 1
|
#exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
@ -250,27 +278,28 @@ run_curltest14
|
||||||
|
|
||||||
run_curltest15 () {
|
run_curltest15 () {
|
||||||
printf '\n%s\n%s\n%s\n\n' "############################" "TESTING FALSE POSITIVE CASES" "############################"
|
printf '\n%s\n%s\n%s\n\n' "############################" "TESTING FALSE POSITIVE CASES" "############################"
|
||||||
if curl -v -A "Mozilla/5.0 (X11; Linux x86_64; rv:67.0) Gecko/20100101 Firefox/67.0" http://localhost:9000/index.html 2>&1 | grep -i 'Welcome'; then
|
if curl -v -A "Mozilla/5.0 (X11; Linux x86_64; rv:67.0) Gecko/20100101 Firefox/67.0" http://localhost:9000 2>&1 | grep -i 'Welcome'; then
|
||||||
echo "$(tput setaf 2)NO FALSE POSITIVE - TEST PASSED"
|
echo "${bold}${green}PASSED - NO FALSE POSITIVE"
|
||||||
else
|
else
|
||||||
echo "$(tput setaf 1)FALSE POSITIVE - TEST FAILED"
|
echo "${bold}${red}FAILED - FALSE POSITIVE FOUND"
|
||||||
#exit 1
|
#exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
run_curltest15
|
run_curltest15
|
||||||
|
|
||||||
bold=$(tput bold)
|
|
||||||
red=$(tput setaf 1)
|
|
||||||
green=$(tput setaf 2)
|
|
||||||
# ************************************************
|
# ************************************************
|
||||||
# Test 50 Random User-Agents from Bad-User-Agents
|
# Test 50 User-Agents from Bad-User-Agents
|
||||||
# ************************************************
|
# ************************************************
|
||||||
shuf -n 50 ${TRAVIS_BUILD_DIR}/_generator_lists/bad-user-agents.list > ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-bots-for-test-quick.tmp
|
shuf -n 50 ${TRAVIS_BUILD_DIR}/_generator_lists/bad-user-agents.list > ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-bots-for-test-quick.tmp
|
||||||
sed 's/\\//g' ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-bots-for-test-quick.tmp > ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-bots-for-test-quick.list
|
sed 's/\\//g' ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-bots-for-test-quick.tmp > ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-bots-for-test-quick.list
|
||||||
sudo rm ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-bots-for-test-quick.tmp
|
sudo rm ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-bots-for-test-quick.tmp
|
||||||
sort -u ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-bots-for-test-quick.list -o ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-bots-for-test-quick.list
|
sort -u ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-bots-for-test-quick.list -o ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-bots-for-test-quick.list
|
||||||
|
|
||||||
echo "Testing 250 Random Bad Bots"
|
printf "\n\n"
|
||||||
|
echo "${bold}${magenta}---------------------------"
|
||||||
|
echo "${bold}${magenta}Testing 50 Random Bad Bots"
|
||||||
|
echo "${bold}${magenta}---------------------------"
|
||||||
|
printf "\n\n"
|
||||||
IFS=$'\n'
|
IFS=$'\n'
|
||||||
file=${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-bots-for-test-quick.list
|
file=${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-bots-for-test-quick.list
|
||||||
lines=$(cat ${file})
|
lines=$(cat ${file})
|
||||||
|
@ -289,7 +318,11 @@ IFS=""
|
||||||
# ************************************************
|
# ************************************************
|
||||||
sed 's/\\//g' ${TRAVIS_BUILD_DIR}/_generator_lists/good-user-agents.list > ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/good-bots-for-test.list
|
sed 's/\\//g' ${TRAVIS_BUILD_DIR}/_generator_lists/good-user-agents.list > ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/good-bots-for-test.list
|
||||||
|
|
||||||
echo "Testing All Good Bots"
|
printf "\n\n"
|
||||||
|
echo "${bold}${magenta}---------------------"
|
||||||
|
echo "${bold}${magenta}Testing All Good Bots"
|
||||||
|
echo "${bold}${magenta}---------------------"
|
||||||
|
printf "\n\n"
|
||||||
IFS=$'\n'
|
IFS=$'\n'
|
||||||
file=${TRAVIS_BUILD_DIR}/.dev-tools/test_units/good-bots-for-test.list
|
file=${TRAVIS_BUILD_DIR}/.dev-tools/test_units/good-bots-for-test.list
|
||||||
lines=$(cat ${file})
|
lines=$(cat ${file})
|
||||||
|
@ -309,7 +342,11 @@ IFS=""
|
||||||
# *****************************************************
|
# *****************************************************
|
||||||
sed 's/\\//g' ${TRAVIS_BUILD_DIR}/_generator_lists/allowed-user-agents.list > ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/allowed-bots-for-test.list
|
sed 's/\\//g' ${TRAVIS_BUILD_DIR}/_generator_lists/allowed-user-agents.list > ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/allowed-bots-for-test.list
|
||||||
|
|
||||||
echo "Testing All Allowed Bots"
|
printf "\n\n"
|
||||||
|
echo "${bold}${magenta}------------------------"
|
||||||
|
echo "${bold}${magenta}Testing All Allowed Bots"
|
||||||
|
echo "${bold}${magenta}------------------------"
|
||||||
|
printf "\n\n"
|
||||||
IFS=$'\n'
|
IFS=$'\n'
|
||||||
file=${TRAVIS_BUILD_DIR}/.dev-tools/test_units/allowed-bots-for-test.list
|
file=${TRAVIS_BUILD_DIR}/.dev-tools/test_units/allowed-bots-for-test.list
|
||||||
lines=$(cat ${file})
|
lines=$(cat ${file})
|
||||||
|
@ -328,7 +365,11 @@ IFS=""
|
||||||
# *****************************************************
|
# *****************************************************
|
||||||
sed 's/\\//g' ${TRAVIS_BUILD_DIR}/_generator_lists/limited-user-agents.list > ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/limited-bots-for-test.list
|
sed 's/\\//g' ${TRAVIS_BUILD_DIR}/_generator_lists/limited-user-agents.list > ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/limited-bots-for-test.list
|
||||||
|
|
||||||
echo "Testing All Limited Bots"
|
printf "\n\n"
|
||||||
|
echo "${bold}${magenta}------------------------"
|
||||||
|
echo "${bold}${magenta}Testing All Limited Bots"
|
||||||
|
echo "${bold}${magenta}------------------------"
|
||||||
|
printf "\n\n"
|
||||||
IFS=$'\n'
|
IFS=$'\n'
|
||||||
file=${TRAVIS_BUILD_DIR}/.dev-tools/test_units/limited-bots-for-test.list
|
file=${TRAVIS_BUILD_DIR}/.dev-tools/test_units/limited-bots-for-test.list
|
||||||
lines=$(cat ${file})
|
lines=$(cat ${file})
|
||||||
|
@ -348,9 +389,13 @@ IFS=""
|
||||||
shuf -n 100 ${TRAVIS_BUILD_DIR}/_generator_lists/bad-referrers.list > ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-referrers-for-test-quick.list
|
shuf -n 100 ${TRAVIS_BUILD_DIR}/_generator_lists/bad-referrers.list > ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-referrers-for-test-quick.list
|
||||||
sort -u ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-referrers-for-test-quick.list -o ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-referrers-for-test-quick.list
|
sort -u ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-referrers-for-test-quick.list -o ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-referrers-for-test-quick.list
|
||||||
|
|
||||||
echo "Testing 100 Random Bad Referrers"
|
printf "\n\n"
|
||||||
|
echo "${bold}${magenta}--------------------------------"
|
||||||
|
echo "${bold}${magenta}Testing 100 Random Bad Referrers"
|
||||||
|
echo "${bold}${magenta}--------------------------------"
|
||||||
|
printf "\n\n"
|
||||||
IFS=$'\n'
|
IFS=$'\n'
|
||||||
file=${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-referrers-for-test-quick.list
|
file=${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-referrers-for-test.list
|
||||||
lines=$(cat ${file})
|
lines=$(cat ${file})
|
||||||
for line in ${lines}; do
|
for line in ${lines}; do
|
||||||
if
|
if
|
||||||
|
@ -366,7 +411,11 @@ IFS=""
|
||||||
# Test Good Referrer Domains
|
# Test Good Referrer Domains
|
||||||
# **************************
|
# **************************
|
||||||
|
|
||||||
echo "Testing Good Referrers"
|
printf "\n\n"
|
||||||
|
echo "${bold}${magenta}----------------------"
|
||||||
|
echo "${bold}${magenta}Testing Good Referrers"
|
||||||
|
echo "${bold}${magenta}----------------------"
|
||||||
|
printf "\n\n"
|
||||||
IFS=$'\n'
|
IFS=$'\n'
|
||||||
file=${TRAVIS_BUILD_DIR}/.dev-tools/test_units/good-referrers-for-test.list
|
file=${TRAVIS_BUILD_DIR}/.dev-tools/test_units/good-referrers-for-test.list
|
||||||
lines=$(cat ${file})
|
lines=$(cat ${file})
|
||||||
|
@ -381,7 +430,10 @@ done
|
||||||
IFS=""
|
IFS=""
|
||||||
|
|
||||||
|
|
||||||
echo "Tests Completed"
|
printf "\n"
|
||||||
|
echo "${bold}${cyan}Tests Completed"
|
||||||
|
echo "${bold}${gren}All Tests Passed"
|
||||||
|
echo "${bold}${magenta}Now We Test Whitelisting and then Release a new build"
|
||||||
|
|
||||||
# **********************
|
# **********************
|
||||||
# Exit With Error Number
|
# Exit With Error Number
|
||||||
|
|
|
@ -29,7 +29,6 @@ magenta=$(tput setaf 5)
|
||||||
cyan=$(tput setaf 6)
|
cyan=$(tput setaf 6)
|
||||||
white=$(tput setaf 7)
|
white=$(tput setaf 7)
|
||||||
defaultcolor=$(tput setaf default)
|
defaultcolor=$(tput setaf default)
|
||||||
banner=$(cat ${TRAVIS_BUILD_DIR}/.dev-tools/banner.txt)
|
|
||||||
|
|
||||||
# *******************************************
|
# *******************************************
|
||||||
# Set Location of our Curl Test Results Files
|
# Set Location of our Curl Test Results Files
|
||||||
|
@ -436,25 +435,6 @@ echo "${bold}${cyan}Tests Completed"
|
||||||
echo "${bold}${gren}All Tests Passed"
|
echo "${bold}${gren}All Tests Passed"
|
||||||
echo "${bold}${magenta}Now We Test Whitelisting and then Release a new build"
|
echo "${bold}${magenta}Now We Test Whitelisting and then Release a new build"
|
||||||
|
|
||||||
printf "\n"
|
|
||||||
${bold}${yellow}
|
|
||||||
cat << "EOF"
|
|
||||||
|
|
||||||
##############################################################################
|
|
||||||
# _ __ _ #
|
|
||||||
# / |/ /__ _(_)__ __ __ #
|
|
||||||
# / / _ `/ / _ \\ \ / #
|
|
||||||
# /_/|_/\_, /_/_//_/_\_\ #
|
|
||||||
# __/___/ __ ___ __ ___ __ __ #
|
|
||||||
# / _ )___ ____/ / / _ )___ / /_ / _ )/ /__ ____/ /_____ ____ #
|
|
||||||
# / _ / _ `/ _ / / _ / _ \/ __/ / _ / / _ \/ __/ '_/ -_) __/ #
|
|
||||||
# /____/\_,_/\_,_/ /____/\___/\__/ /____/_/\___/\__/_/\_\\__/_/ #
|
|
||||||
# #
|
|
||||||
##############################################################################
|
|
||||||
|
|
||||||
EOF
|
|
||||||
${defaultcolor}
|
|
||||||
|
|
||||||
# **********************
|
# **********************
|
||||||
# Exit With Error Number
|
# Exit With Error Number
|
||||||
# **********************
|
# **********************
|
||||||
|
|
Loading…
Add table
Reference in a new issue