mirror of
https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker.git
synced 2025-09-01 18:19:55 +00:00
Test Rate Limiting REF: #175
This commit is contained in:
parent
81b999cdd0
commit
5da642ab7d
1 changed files with 25 additions and 12 deletions
|
@ -261,18 +261,31 @@ echo "${bold}${yellow}----------------------------------------------------------
|
|||
printf "\n\n"
|
||||
sleep 30s
|
||||
|
||||
IFS=$'\n'
|
||||
file=${TRAVIS_BUILD_DIR}/.dev-tools/test_units/rate-limit-googlebot.list
|
||||
lines=$(cat ${file})
|
||||
for line in ${lines}; do
|
||||
if
|
||||
time curl -A "${line}" http://localhost:9000 2>&1 | grep -i 'Welcome'; then
|
||||
echo "${bold}${green}PASSED - ${red}${line} was ${bold}${green}ALLOWED"
|
||||
else
|
||||
echo "${bold}${red}FAILED - ${red}${line} was ${bold}${red}NOT ALLOWED"
|
||||
fi
|
||||
done
|
||||
IFS=""
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1
|
||||
|
||||
#IFS=$'\n'
|
||||
#file=${TRAVIS_BUILD_DIR}/.dev-tools/test_units/rate-limit-googlebot.list
|
||||
#lines=$(cat ${file})
|
||||
#for line in ${lines}; do
|
||||
# if
|
||||
# time curl -A "${line}" http://localhost:9000 2>&1 | grep -i 'Welcome'; then
|
||||
# echo "${bold}${green}PASSED - ${red}${line} was ${bold}${green}ALLOWED"
|
||||
# else
|
||||
# echo "${bold}${red}FAILED - ${red}${line} was ${bold}${red}NOT ALLOWED"
|
||||
# fi
|
||||
#done
|
||||
#IFS=""
|
||||
|
||||
printf "\n"
|
||||
echo "${bold}${green}---------------------------"
|
||||
|
|
Loading…
Add table
Reference in a new issue