IMPROVE Rate Limiting Test REF: #175

This commit is contained in:
Mitchell Krog 2019-06-26 11:06:41 +02:00
parent 62bac74224
commit 2e9b584a0f
No known key found for this signature in database
GPG key ID: C243C388553EDE5D
2 changed files with 19 additions and 18 deletions

View file

@ -261,24 +261,25 @@ echo "${bold}${yellow}----------------------------------------------------------
printf "\n\n"
sleep 10s
if
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 &
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 | grep -i 'Unavailable'; then
ratelimittestfile=${TRAVIS_BUILD_DIR}/.dev-tools/test_units/ratelimittest.txt
truncate -s 0 ${ratelimittestfile}
curl -A "GoogleBot" http://localhost:9000 2>&1 > ${ratelimittestfile} &
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile}
if grep -i 'Unavailable' < ${ratelimittestfile}; then
echo "${bold}${green}PASSED - ${red}GoogleBot was ${bold}${red}RATE LIMITED"
else
echo "${bold}${red}FAILED - ${red}GoogleBot was ${bold}${red}NOT RATE LIMITED"

View file