diff --git a/.dev-tools/test-nginx-2.sh b/.dev-tools/test-nginx-2.sh index f0b23d7d9..335faf373 100755 --- a/.dev-tools/test-nginx-2.sh +++ b/.dev-tools/test-nginx-2.sh @@ -165,42 +165,6 @@ fi } run_curltest10 () { -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 "${bold}${green}PASSED - ${red}Googlebot/Nutch2.1 BAD BOT DETECTED" -else - echo "${bold}${red}FAILED - ${red}Googlebot/Nutch2.1 BAD BOT NOT DETECTED" - exit 1 -fi -} - -run_curltest11 () { -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 "${bold}${green}PASSED - ${red}Googlebot/nutch/-2.1 BAD BOT DETECTED" -else - echo "${bold}${red}FAILED - Googlebot/nutch/-2.1 BAD BOT NOT DETECTED" - exit 1 -fi -} - -run_curltest12 () { -if curl -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 "${bold}${green}PASSED - NO FALSE POSITIVE on Googlebot-Image/Snutch\-/-2.1" -else - echo "${bold}${red}FAILED - FALSE POSITIVE FOUND on Googlebot-Image/Snutch\-/-2.1" - exit 1 -fi -} - -run_curltest13 () { -if curl -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 "${bold}${green}PASSED - NO FALSE POSITIVE on SnutchMozilla/5.0" -else - echo "${bold}${red}FAILED - FALSE POSITIVE FOUND on SnutchMozilla/5.0" - exit 1 -fi -} - -run_curltest14 () { if curl -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 "${bold}${green}PASSED - NO FALSE POSITIVE on Mozilla/5.0" else @@ -209,7 +173,7 @@ else fi } -run_curltest15 () { +run_curltest11 () { if curl -A "Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1 Mobile/15E148 Safari/604.1" http://localhost:9000 2>&1 | grep -i 'Welcome'; then echo "${bold}${green}PASSED - NO FALSE POSITIVE on Safari" else @@ -364,10 +328,6 @@ run_curltest8 run_curltest9 run_curltest10 run_curltest11 -run_curltest12 -run_curltest13 -run_curltest14 -run_curltest15 testBadUserAgents testGoodUserAgents testAllowedUserAgents diff --git a/.dev-tools/test-nginx-3.sh b/.dev-tools/test-nginx-3.sh index 059d2f17b..4588c4c48 100755 --- a/.dev-tools/test-nginx-3.sh +++ b/.dev-tools/test-nginx-3.sh @@ -165,42 +165,6 @@ fi } run_curltest10 () { -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 "${bold}${green}PASSED - ${red}Googlebot/Nutch2.1 BAD BOT DETECTED" -else - echo "${bold}${red}FAILED - ${red}Googlebot/Nutch2.1 BAD BOT NOT DETECTED" - exit 1 -fi -} - -run_curltest11 () { -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 "${bold}${green}PASSED - ${red}Googlebot/nutch/-2.1 BAD BOT DETECTED" -else - echo "${bold}${red}FAILED - Googlebot/nutch/-2.1 BAD BOT NOT DETECTED" - exit 1 -fi -} - -run_curltest12 () { -if curl -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 "${bold}${green}PASSED - NO FALSE POSITIVE on Googlebot-Image/Snutch\-/-2.1" -else - echo "${bold}${red}FAILED - FALSE POSITIVE FOUND on Googlebot-Image/Snutch\-/-2.1" - exit 1 -fi -} - -run_curltest13 () { -if curl -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 "${bold}${green}PASSED - NO FALSE POSITIVE on SnutchMozilla/5.0" -else - echo "${bold}${red}FAILED - FALSE POSITIVE FOUND on SnutchMozilla/5.0" - exit 1 -fi -} - -run_curltest14 () { if curl -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 "${bold}${green}PASSED - NO FALSE POSITIVE on Mozilla/5.0" else @@ -209,7 +173,7 @@ else fi } -run_curltest15 () { +run_curltest11 () { if curl -A "Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1 Mobile/15E148 Safari/604.1" http://localhost:9000 2>&1 | grep -i 'Welcome'; then echo "${bold}${green}PASSED - NO FALSE POSITIVE on Safari" else @@ -364,10 +328,6 @@ run_curltest8 run_curltest9 run_curltest10 run_curltest11 -run_curltest12 -run_curltest13 -run_curltest14 -run_curltest15 testBadUserAgents testGoodUserAgents testAllowedUserAgents