mirror of
https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker.git
synced 2025-09-10 06:15:06 +00:00
Update Test Commenting / Disable Test Cases on Test Unit REF: #264
This commit is contained in:
parent
4f2143a069
commit
fa224b124d
3 changed files with 11 additions and 15 deletions
|
@ -139,7 +139,7 @@ map $http_user_agent $bad_bot {
|
|||
|
||||
# TEST CASES
|
||||
# **********
|
||||
"~*(?:\b)ozilla(?:|\s|,|\.|\b|\/)" 3;
|
||||
#"~*(?:\b)ozilla(?:|\s|,|\.|\b|\/)" 3;
|
||||
|
||||
|
||||
# START BAD BOTS ### DO NOT EDIT THIS LINE AT ALL ###
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
# Make sure we test latest generated globalblacklist-testing-version.conf
|
||||
# ***********************************************************************
|
||||
|
||||
printf '\n%s\n%s\n%s\n\n' "##############################################################################" "Copy latest generated globalblacklist.conf file to test for any compile errors" "##############################################################################"
|
||||
printf '\n%s\n%s\n%s\n\n' "##############################################################################" "Copy Test Unit of globalblacklist.conf file to test for any compile errors" "##############################################################################"
|
||||
sudo cp ${TRAVIS_BUILD_DIR}/conf.d/globalblacklist-testing-version.conf /etc/nginx/conf.d/globalblacklist.conf
|
||||
|
||||
# *********************
|
||||
|
|
|
@ -246,14 +246,13 @@ run_curltest11
|
|||
|
||||
run_curltest12 () {
|
||||
truncate -s 0 ${_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" "############################"
|
||||
printf '%s%s\n\n' "Last Tested: " "$_now" >> "${_curltest12}"
|
||||
curl -A "Mozilla/5.0 (compatible; Googlebot-Image/Snutch\-/-2.1; +http://www.google.com/bot.html)" http://localhost:9000/index.php 2>> ${_curltest12}
|
||||
if grep -i '(52)' ${_curltest12}; then
|
||||
if grep -i 'Welcome' ${_curltest12}; then
|
||||
echo 'NO FALSE POSITIVE - TEST PASSED'
|
||||
else
|
||||
echo 'FALSE POSITIVE - TEST FAILED'
|
||||
#exit 1
|
||||
fi
|
||||
}
|
||||
run_curltest12
|
||||
|
@ -264,14 +263,13 @@ run_curltest12
|
|||
|
||||
run_curltest13 () {
|
||||
truncate -s 0 ${_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" "############################"
|
||||
printf '%s%s\n\n' "Last Tested: " "$_now" >> "${_curltest13}"
|
||||
curl -A "SnutchMozilla/5.0 (compatible; Googlebot-Image/SMutch\-/-2.1; +http://www.google.com/bot.html)" http://localhost:9000/index.php 2>> ${_curltest13}
|
||||
if grep -i '(52)' ${_curltest13}; then
|
||||
if grep -i 'Welcome' ${_curltest13}; then
|
||||
echo 'NO FALSE POSITIVE - TEST PASSED'
|
||||
else
|
||||
echo 'FALSE POSITIVE - TEST FAILED'
|
||||
#exit 1
|
||||
fi
|
||||
}
|
||||
run_curltest13
|
||||
|
@ -282,14 +280,13 @@ run_curltest13
|
|||
|
||||
run_curltest14 () {
|
||||
truncate -s 0 ${_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" "############################"
|
||||
printf '%s%s\n\n' "Last Tested: " "$_now" >> "${_curltest14}"
|
||||
curl -A "Mozilla/5.0 (X11; Linux x86_64; rv:67.0) Gecko/20100101 Firefox/67.0" http://localhost:9000/index.php 2>> ${_curltest14}
|
||||
if grep -i 'Welcome' ${_curltest14}; then
|
||||
echo 'NO FALSE POSITIVE - TEST PASSED'
|
||||
else
|
||||
echo 'FALSE POSITIVE - TEST FAILED'
|
||||
#exit 1
|
||||
fi
|
||||
}
|
||||
run_curltest14
|
||||
|
@ -301,14 +298,13 @@ run_curltest14
|
|||
|
||||
run_curltest15 () {
|
||||
truncate -s 0 ${_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" "############################"
|
||||
printf '%s%s\n\n' "Last Tested: " "$_now" >> "${_curltest15}"
|
||||
curl -A "Mozilla/5.0 (X11; Linux x86_64; rv:67.0) Gecko/20100101 Firefox/67.0" http://localhost:9000/index.php 2>> ${_curltest15}
|
||||
if grep -i '(52)' ${_curltest15}; then
|
||||
echo 'NO FALSE POSITIVE - TEST FAILED'
|
||||
if grep -i 'Welcome' ${_curltest15}; then
|
||||
echo 'NO FALSE POSITIVE - TEST PASSED'
|
||||
else
|
||||
echo 'FALSE POSITIVE - TEST PASSED'
|
||||
#exit 1
|
||||
echo 'FALSE POSITIVE - TEST FAILED'
|
||||
fi
|
||||
}
|
||||
run_curltest15
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue