mirror of
https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker.git
synced 2025-09-02 18:50:13 +00:00
Introduce Testing of 200 Random Bad Referrers
This commit is contained in:
parent
2a07847b4c
commit
d431eedcd9
1 changed files with 21 additions and 1 deletions
|
@ -273,7 +273,7 @@ for line in ${lines}; do
|
|||
curl -v -A "${line}" http://localhost:9000 2>&1 | grep -i '(52)'; then
|
||||
echo "$(tput setaf 1)BAD BOT DETECTED - $(tput setaf 2)TEST PASSED"
|
||||
else
|
||||
echo "$(tput setaf 1)BAD REFERRER NOT DETECTED - TEST FAILED"
|
||||
echo "$(tput setaf 1)BAD BOT NOT DETECTED - TEST FAILED"
|
||||
fi
|
||||
done
|
||||
IFS=""
|
||||
|
@ -336,6 +336,26 @@ for line in ${lines}; do
|
|||
done
|
||||
IFS=""
|
||||
|
||||
# ********************************************
|
||||
# Test 200 Random Referrers from Bad-Referrers
|
||||
# ********************************************
|
||||
shuf -n 200 ${TRAVIS_BUILD_DIR}/_generator_lists/bad-referrers.list > ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-referrers-for-test.list
|
||||
|
||||
echo "Testing 200 Random Referrers"
|
||||
IFS=$'\n'
|
||||
file=${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-referrers-for-test.list
|
||||
lines=$(cat ${file})
|
||||
for line in ${lines}; do
|
||||
if
|
||||
curl -I http://localhost:9000 -e "http://${line}" 2>&1 | grep -i '(52)'; then
|
||||
echo "$(tput setaf 1)BAD REFERRER DETECTED - $(tput setaf 2)TEST PASSED"
|
||||
else
|
||||
echo "$(tput setaf 1)BAD REFERRER NOT DETECTED - TEST FAILED"
|
||||
fi
|
||||
done
|
||||
IFS=""
|
||||
|
||||
|
||||
echo "Tests Completed"
|
||||
|
||||
# **********************
|
||||
|
|
Loading…
Add table
Reference in a new issue