From e2a3bfb106e82abecc1b05ddc2fb2b0079e536e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9ophile=20Diot?= Date: Fri, 2 Jun 2023 10:08:51 -0400 Subject: [PATCH] Bad behavior core tests change the ban time to 60 seconds --- tests/core/badbehavior/main.py | 4 ++-- tests/core/badbehavior/test.sh | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/core/badbehavior/main.py b/tests/core/badbehavior/main.py index 4e3c2cb8..ee61c069 100644 --- a/tests/core/badbehavior/main.py +++ b/tests/core/badbehavior/main.py @@ -68,10 +68,10 @@ try: exit(1) elif bad_behavior_ban_time != "86400": print( - "ℹī¸ Sleeping for 7s to wait if Bad Behavior's ban time changed ...", + "ℹī¸ Sleeping for 65s to wait if Bad Behavior's ban time changed ...", flush=True, ) - sleep(7) + sleep(65) status_code = get( f"http://www.example.com", diff --git a/tests/core/badbehavior/test.sh b/tests/core/badbehavior/test.sh index b2c321df..1b61a596 100755 --- a/tests/core/badbehavior/test.sh +++ b/tests/core/badbehavior/test.sh @@ -21,7 +21,7 @@ cleanup_stack () { if [[ $end -eq 1 || $exit_code = 1 ]] || [[ $end -eq 0 && $exit_code = 0 ]] && [ $manual = 0 ] ; then find . -type f -name 'docker-compose.*' -exec sed -i 's@USE_BAD_BEHAVIOR: "no"@USE_BAD_BEHAVIOR: "yes"@' {} \; find . -type f -name 'docker-compose.*' -exec sed -i 's@BAD_BEHAVIOR_STATUS_CODES: "400 401 404 405 429 444"@BAD_BEHAVIOR_STATUS_CODES: "400 401 403 404 405 429 444"@' {} \; - find . -type f -name 'docker-compose.*' -exec sed -i 's@BAD_BEHAVIOR_BAN_TIME: "5"@BAD_BEHAVIOR_BAN_TIME: "86400"@' {} \; + find . -type f -name 'docker-compose.*' -exec sed -i 's@BAD_BEHAVIOR_BAN_TIME: "60"@BAD_BEHAVIOR_BAN_TIME: "86400"@' {} \; find . -type f -name 'docker-compose.*' -exec sed -i 's@BAD_BEHAVIOR_THRESHOLD: "20"@BAD_BEHAVIOR_THRESHOLD: "10"@' {} \; find . -type f -name 'docker-compose.*' -exec sed -i 's@BAD_BEHAVIOR_COUNT_TIME: "5"@BAD_BEHAVIOR_COUNT_TIME: "60"@' {} \; if [[ $end -eq 1 && $exit_code = 0 ]] ; then @@ -56,12 +56,12 @@ do find . -type f -name 'docker-compose.*' -exec sed -i 's@USE_BAD_BEHAVIOR: "no"@USE_BAD_BEHAVIOR: "yes"@' {} \; find . -type f -name 'docker-compose.*' -exec sed -i 's@BAD_BEHAVIOR_STATUS_CODES: "400 401 403 404 405 429 444"@BAD_BEHAVIOR_STATUS_CODES: "400 401 404 405 429 444"@' {} \; elif [ "$test" = "ban_time" ] ; then - echo "📟 Running tests with badbehavior's ban time changed to 5 seconds ..." + echo "📟 Running tests with badbehavior's ban time changed to 60 seconds ..." find . -type f -name 'docker-compose.*' -exec sed -i 's@BAD_BEHAVIOR_STATUS_CODES: "400 401 404 405 429 444"@BAD_BEHAVIOR_STATUS_CODES: "400 401 403 404 405 429 444"@' {} \; - find . -type f -name 'docker-compose.*' -exec sed -i 's@BAD_BEHAVIOR_BAN_TIME: "86400"@BAD_BEHAVIOR_BAN_TIME: "5"@' {} \; + find . -type f -name 'docker-compose.*' -exec sed -i 's@BAD_BEHAVIOR_BAN_TIME: "86400"@BAD_BEHAVIOR_BAN_TIME: "60"@' {} \; elif [ "$test" = "threshold" ] ; then echo "📟 Running tests with badbehavior's threshold set to 20 ..." - find . -type f -name 'docker-compose.*' -exec sed -i 's@BAD_BEHAVIOR_BAN_TIME: "5"@BAD_BEHAVIOR_BAN_TIME: "86400"@' {} \; + find . -type f -name 'docker-compose.*' -exec sed -i 's@BAD_BEHAVIOR_BAN_TIME: "60"@BAD_BEHAVIOR_BAN_TIME: "86400"@' {} \; find . -type f -name 'docker-compose.*' -exec sed -i 's@BAD_BEHAVIOR_THRESHOLD: "10"@BAD_BEHAVIOR_THRESHOLD: "20"@' {} \; elif [ "$test" = "count_time" ] ; then echo "📟 Running tests with badbehavior's count time set to 5 seconds ..."