diff --git a/tests/core/antibot/test.sh b/tests/core/antibot/test.sh index 2df21aa1e..a47773d2a 100755 --- a/tests/core/antibot/test.sh +++ b/tests/core/antibot/test.sh @@ -56,8 +56,14 @@ do echo "🤖 Starting stack ..." docker compose up -d 2>/dev/null if [ $? -ne 0 ] ; then - echo "🤖 Up failed ❌" - exit 1 + echo "🤖 Up failed, retrying ... âš ī¸" + manual=1 + cleanup_stack + manual=0 + if [ $? -ne 0 ] ; then + echo "🤖 Up failed ❌" + exit 1 + fi fi # Check if stack is healthy diff --git a/tests/core/authbasic/test.sh b/tests/core/authbasic/test.sh index cb3b8fcdb..7077fc783 100755 --- a/tests/core/authbasic/test.sh +++ b/tests/core/authbasic/test.sh @@ -65,8 +65,14 @@ do echo "🔐 Starting stack ..." docker compose up -d 2>/dev/null if [ $? -ne 0 ] ; then - echo "🔐 Up failed ❌" - exit 1 + echo "🔐 Up failed, retrying ... âš ī¸" + manual=1 + cleanup_stack + manual=0 + if [ $? -ne 0 ] ; then + echo "🔐 Up failed ❌" + exit 1 + fi fi # Check if stack is healthy diff --git a/tests/core/badbehavior/test.sh b/tests/core/badbehavior/test.sh index 1afda4660..587596e35 100755 --- a/tests/core/badbehavior/test.sh +++ b/tests/core/badbehavior/test.sh @@ -72,8 +72,14 @@ do echo "📟 Starting stack ..." docker compose up -d 2>/dev/null if [ $? -ne 0 ] ; then - echo "📟 Up failed ❌" - exit 1 + echo "📟 Up failed, retrying ... âš ī¸" + manual=1 + cleanup_stack + manual=0 + if [ $? -ne 0 ] ; then + echo "📟 Up failed ❌" + exit 1 + fi fi # Check if stack is healthy diff --git a/tests/core/blacklist/test.sh b/tests/core/blacklist/test.sh index 745d11ddf..f471a8997 100755 --- a/tests/core/blacklist/test.sh +++ b/tests/core/blacklist/test.sh @@ -200,8 +200,14 @@ do echo "🏴 Starting stack ..." docker compose up -d 2>/dev/null if [ $? -ne 0 ] ; then - echo "🏴 Up failed ❌" - exit 1 + echo "🏴 Up failed, retrying ... âš ī¸" + manual=1 + cleanup_stack + manual=0 + if [ $? -ne 0 ] ; then + echo "🏴 Up failed ❌" + exit 1 + fi fi # Check if stack is healthy diff --git a/tests/core/brotli/test.sh b/tests/core/brotli/test.sh index a70c41e11..5325a1dd9 100755 --- a/tests/core/brotli/test.sh +++ b/tests/core/brotli/test.sh @@ -52,8 +52,14 @@ do echo "đŸ“Ļ Starting stack ..." docker compose up -d 2>/dev/null if [ $? -ne 0 ] ; then - echo "đŸ“Ļ Up failed ❌" - exit 1 + echo "đŸ“Ļ Up failed, retrying ... âš ī¸" + manual=1 + cleanup_stack + manual=0 + if [ $? -ne 0 ] ; then + echo "đŸ“Ļ Up failed ❌" + exit 1 + fi fi # Check if stack is healthy diff --git a/tests/core/bunkernet/test.sh b/tests/core/bunkernet/test.sh index f5aa48cd8..3985eda48 100755 --- a/tests/core/bunkernet/test.sh +++ b/tests/core/bunkernet/test.sh @@ -61,8 +61,14 @@ do echo "đŸ•¸ī¸ Starting stack ..." docker compose up -d 2>/dev/null if [ $? -ne 0 ] ; then - echo "đŸ•¸ī¸ Up failed ❌" - exit 1 + echo "đŸ•¸ī¸ Up failed, retrying ... âš ī¸" + manual=1 + cleanup_stack + manual=0 + if [ $? -ne 0 ] ; then + echo "đŸ•¸ī¸ Up failed ❌" + exit 1 + fi fi # Check if stack is healthy @@ -96,12 +102,12 @@ do docker compose -f docker-compose.test.yml up --abort-on-container-exit --exit-code-from tests 2>/dev/null if [ $? -ne 0 ] ; then - echo "🏴 Test \"$test\" failed ❌" + echo "đŸ•¸ī¸ Test \"$test\" failed ❌" echo "đŸ›Ąī¸ Showing BunkerWeb, BunkerWeb Scheduler and Custom API logs ..." docker compose logs bw bw-scheduler bunkernet-api exit 1 else - echo "🏴 Test \"$test\" succeeded ✅" + echo "đŸ•¸ī¸ Test \"$test\" succeeded ✅" fi manual=1 diff --git a/tests/core/clientcache/test.sh b/tests/core/clientcache/test.sh index 0b7ad9bb9..28650e226 100755 --- a/tests/core/clientcache/test.sh +++ b/tests/core/clientcache/test.sh @@ -66,8 +66,14 @@ do echo "📝 Starting stack ..." docker compose up -d 2>/dev/null if [ $? -ne 0 ] ; then - echo "📝 Up failed ❌" - exit 1 + echo "📝 Up failed, retrying ... âš ī¸" + manual=1 + cleanup_stack + manual=0 + if [ $? -ne 0 ] ; then + echo "📝 Up failed ❌" + exit 1 + fi fi # Check if stack is healthy diff --git a/tests/core/cors/test.sh b/tests/core/cors/test.sh index 0e9924e88..7855208e8 100755 --- a/tests/core/cors/test.sh +++ b/tests/core/cors/test.sh @@ -81,8 +81,14 @@ do echo "đŸ›°ī¸ Starting stack ..." docker compose up -d 2>/dev/null if [ $? -ne 0 ] ; then - echo "đŸ›°ī¸ Up failed ❌" - exit 1 + echo "đŸ›°ī¸ Up failed, retrying ... âš ī¸" + manual=1 + cleanup_stack + manual=0 + if [ $? -ne 0 ] ; then + echo "đŸ›°ī¸ Up failed ❌" + exit 1 + fi fi # Check if stack is healthy diff --git a/tests/core/country/test.sh b/tests/core/country/test.sh index 2a5bf9d15..1cfd8a1c6 100755 --- a/tests/core/country/test.sh +++ b/tests/core/country/test.sh @@ -57,8 +57,14 @@ do echo "🌍 Starting stack ..." docker compose up -d 2>/dev/null if [ $? -ne 0 ] ; then - echo "🌍 Up failed ❌" - exit 1 + echo "🌍 Up failed, retrying ... âš ī¸" + manual=1 + cleanup_stack + manual=0 + if [ $? -ne 0 ] ; then + echo "🌍 Up failed ❌" + exit 1 + fi fi # Check if stack is healthy diff --git a/tests/core/customcert/test.sh b/tests/core/customcert/test.sh index 5fdf6fc18..3de92b654 100755 --- a/tests/core/customcert/test.sh +++ b/tests/core/customcert/test.sh @@ -68,8 +68,14 @@ do echo "🔏 Starting stack ..." docker compose up -d 2>/dev/null if [ $? -ne 0 ] ; then - echo "🔏 Up failed ❌" - exit 1 + echo "🔏 Up failed, retrying ... âš ī¸" + manual=1 + cleanup_stack + manual=0 + if [ $? -ne 0 ] ; then + echo "🔏 Up failed ❌" + exit 1 + fi fi # Check if stack is healthy diff --git a/tests/core/db/test.sh b/tests/core/db/test.sh index 507192dad..71a9e7c2b 100755 --- a/tests/core/db/test.sh +++ b/tests/core/db/test.sh @@ -64,8 +64,14 @@ trap cleanup_stack EXIT echo "💾 Starting stack ..." docker compose up -d 2>/dev/null if [ $? -ne 0 ] ; then - echo "💾 Up failed ❌" - exit 1 + echo "💾 Up failed, retrying ... âš ī¸" + manual=1 + cleanup_stack + manual=0 + if [ $? -ne 0 ] ; then + echo "💾 Up failed ❌" + exit 1 + fi fi echo "💾 Initializing workspace ..." @@ -133,8 +139,14 @@ do echo "💾 Starting stack ..." docker compose up -d 2>/dev/null if [ $? -ne 0 ] ; then - echo "💾 Up failed ❌" - exit 1 + echo "💾 Up failed, retrying ... âš ī¸" + manual=1 + cleanup_stack + manual=0 + if [ $? -ne 0 ] ; then + echo "💾 Up failed ❌" + exit 1 + fi fi # Check if stack is healthy diff --git a/tests/core/dnsbl/test.sh b/tests/core/dnsbl/test.sh index 54b97685a..a5cf832af 100755 --- a/tests/core/dnsbl/test.sh +++ b/tests/core/dnsbl/test.sh @@ -84,8 +84,14 @@ do echo "đŸšĢ Starting stack ..." docker compose up -d 2>/dev/null if [ $? -ne 0 ] ; then - echo "đŸšĢ Up failed ❌" - exit 1 + echo "đŸšĢ Up failed, retrying ... âš ī¸" + manual=1 + cleanup_stack + manual=0 + if [ $? -ne 0 ] ; then + echo "đŸšĢ Up failed ❌" + exit 1 + fi fi # Check if stack is healthy diff --git a/tests/core/errors/test.sh b/tests/core/errors/test.sh index 068a6c929..eb8fe78d2 100755 --- a/tests/core/errors/test.sh +++ b/tests/core/errors/test.sh @@ -57,8 +57,14 @@ do echo "⭕ Starting stack ..." docker compose up -d 2>/dev/null if [ $? -ne 0 ] ; then - echo "⭕ Up failed ❌" - exit 1 + echo "⭕ Up failed, retrying ... âš ī¸" + manual=1 + cleanup_stack + manual=0 + if [ $? -ne 0 ] ; then + echo "⭕ Up failed ❌" + exit 1 + fi fi # Check if stack is healthy diff --git a/tests/core/greylist/test.sh b/tests/core/greylist/test.sh index 405a04dd0..f20e0b189 100755 --- a/tests/core/greylist/test.sh +++ b/tests/core/greylist/test.sh @@ -101,7 +101,7 @@ do find . -type f -name 'docker-compose.*' -exec sed -i 's@GREYLIST_IP_URLS: "http://greylist-api:8080/ip"@GREYLIST_IP_URLS: ""@' {} \; find . -type f -name 'docker-compose.*' -exec sed -i 's@GREYLIST_RDNS: ""@GREYLIST_RDNS: ".bw-services"@' {} \; elif [ "$test" = "rdns_global" ] ; then - echo "🏴 Running tests when greylist's rdns also scans local ip addresses ..." + echo "🏁 Running tests when greylist's rdns also scans local ip addresses ..." find . -type f -name 'docker-compose.*' -exec sed -i 's@GREYLIST_RDNS_GLOBAL: "yes"@GREYLIST_RDNS_GLOBAL: "no"@' {} \; elif [ "$test" = "rdns_urls" ] ; then echo "🏁 Running tests with greylist's rdns url set to http://greylist-api:8080/rdns ..." @@ -138,8 +138,14 @@ do echo "🏁 Starting stack ..." docker compose up -d 2>/dev/null if [ $? -ne 0 ] ; then - echo "🏁 Up failed ❌" - exit 1 + echo "🏁 Up failed, retrying ... âš ī¸" + manual=1 + cleanup_stack + manual=0 + if [ $? -ne 0 ] ; then + echo "🏁 Up failed ❌" + exit 1 + fi fi # Check if stack is healthy diff --git a/tests/core/gzip/test.sh b/tests/core/gzip/test.sh index d7627a554..aa462538f 100755 --- a/tests/core/gzip/test.sh +++ b/tests/core/gzip/test.sh @@ -52,8 +52,14 @@ do echo "đŸ—œī¸ Starting stack ..." docker compose up -d 2>/dev/null if [ $? -ne 0 ] ; then - echo "đŸ—œī¸ Up failed ❌" - exit 1 + echo "đŸ—œī¸ Up failed, retrying ... âš ī¸" + manual=1 + cleanup_stack + manual=0 + if [ $? -ne 0 ] ; then + echo "đŸ—œī¸ Up failed ❌" + exit 1 + fi fi # Check if stack is healthy diff --git a/tests/core/headers/test.sh b/tests/core/headers/test.sh index 6df8f142e..8d7fbb541 100755 --- a/tests/core/headers/test.sh +++ b/tests/core/headers/test.sh @@ -108,8 +108,14 @@ do echo "đŸŽ›ī¸ Starting stack ..." docker compose up -d 2>/dev/null if [ $? -ne 0 ] ; then - echo "đŸŽ›ī¸ Up failed ❌" - exit 1 + echo "đŸŽ›ī¸ Up failed, retrying ... âš ī¸" + manual=1 + cleanup_stack + manual=0 + if [ $? -ne 0 ] ; then + echo "đŸŽ›ī¸ Up failed ❌" + exit 1 + fi fi # Check if stack is healthy diff --git a/tests/core/inject/test.sh b/tests/core/inject/test.sh index 190f1c55c..da88942fc 100755 --- a/tests/core/inject/test.sh +++ b/tests/core/inject/test.sh @@ -35,8 +35,14 @@ echo "💉 Running tests while injecting TEST into the HTML page ..." echo "💉 Starting stack ..." docker compose up -d 2>/dev/null if [ $? -ne 0 ] ; then - echo "💉 Up failed ❌" - exit 1 + echo "💉 Up failed, retrying ... âš ī¸" + manual=1 + cleanup_stack + manual=0 + if [ $? -ne 0 ] ; then + echo "💉 Up failed ❌" + exit 1 + fi fi # Check if stack is healthy diff --git a/tests/core/limit/test.sh b/tests/core/limit/test.sh index 4856c5c4e..7bcc62a30 100755 --- a/tests/core/limit/test.sh +++ b/tests/core/limit/test.sh @@ -86,8 +86,14 @@ do echo "đŸŽšī¸ Starting stack ..." docker compose up -d 2>/dev/null if [ $? -ne 0 ] ; then - echo "đŸŽšī¸ Up failed ❌" - exit 1 + echo "đŸŽšī¸ Up failed, retrying ... âš ī¸" + manual=1 + cleanup_stack + manual=0 + if [ $? -ne 0 ] ; then + echo "đŸŽšī¸ Up failed ❌" + exit 1 + fi fi # Check if stack is healthy diff --git a/tests/core/modsecurity/test.sh b/tests/core/modsecurity/test.sh index bfced6eaf..77b8a9e34 100755 --- a/tests/core/modsecurity/test.sh +++ b/tests/core/modsecurity/test.sh @@ -57,8 +57,14 @@ do echo "👮 Starting stack ..." docker compose up -d 2>/dev/null if [ $? -ne 0 ] ; then - echo "👮 Up failed ❌" - exit 1 + echo "👮 Up failed, retrying ... âš ī¸" + manual=1 + cleanup_stack + manual=0 + if [ $? -ne 0 ] ; then + echo "👮 Up failed ❌" + exit 1 + fi fi # Check if stack is healthy diff --git a/tests/core/redirect/test.sh b/tests/core/redirect/test.sh index b8c3159de..710167cc0 100755 --- a/tests/core/redirect/test.sh +++ b/tests/core/redirect/test.sh @@ -54,8 +54,14 @@ do echo "â†Šī¸ Starting stack ..." docker compose up -d 2>/dev/null if [ $? -ne 0 ] ; then - echo "â†Šī¸ Up failed ❌" - exit 1 + echo "â†Šī¸ Up failed, retrying ... âš ī¸" + manual=1 + cleanup_stack + manual=0 + if [ $? -ne 0 ] ; then + echo "â†Šī¸ Up failed ❌" + exit 1 + fi fi # Check if stack is healthy diff --git a/tests/core/reversescan/test.sh b/tests/core/reversescan/test.sh index 4e01a64e1..7cca1b2be 100755 --- a/tests/core/reversescan/test.sh +++ b/tests/core/reversescan/test.sh @@ -56,8 +56,14 @@ do echo "đŸ•ĩī¸ Starting stack ..." docker compose up -d 2>/dev/null if [ $? -ne 0 ] ; then - echo "đŸ•ĩī¸ Up failed ❌" - exit 1 + echo "đŸ•ĩī¸ Up failed, retrying ... âš ī¸" + manual=1 + cleanup_stack + manual=0 + if [ $? -ne 0 ] ; then + echo "đŸ•ĩī¸ Up failed ❌" + exit 1 + fi fi # Check if stack is healthy diff --git a/tests/core/selfsigned/test.sh b/tests/core/selfsigned/test.sh index 85bb6cee9..00a56da82 100755 --- a/tests/core/selfsigned/test.sh +++ b/tests/core/selfsigned/test.sh @@ -1,16 +1,16 @@ #!/bin/bash -echo "🔐 Building selfsigned stack ..." +echo "🔑 Building selfsigned stack ..." # Starting stack docker compose pull bw-docker if [ $? -ne 0 ] ; then - echo "🔐 Pull failed ❌" + echo "🔑 Pull failed ❌" exit 1 fi docker compose -f docker-compose.test.yml build if [ $? -ne 0 ] ; then - echo "🔐 Build failed ❌" + echo "🔑 Build failed ❌" exit 1 fi @@ -27,16 +27,16 @@ cleanup_stack () { fi fi - echo "🔐 Cleaning up current stack ..." + echo "🔑 Cleaning up current stack ..." docker compose down -v --remove-orphans 2>/dev/null if [ $? -ne 0 ] ; then - echo "🔐 Down failed ❌" + echo "🔑 Down failed ❌" exit 1 fi - echo "🔐 Cleaning up current stack done ✅" + echo "🔑 Cleaning up current stack done ✅" } # Cleanup stack on exit @@ -45,25 +45,31 @@ trap cleanup_stack EXIT for test in "deactivated" "activated" "tweaked_options" do if [ "$test" = "deactivated" ] ; then - echo "🔐 Running tests without selfsigned ..." + echo "🔑 Running tests without selfsigned ..." elif [ "$test" = "activated" ] ; then - echo "🔐 Running tests with selfsigned activated ..." + echo "🔑 Running tests with selfsigned activated ..." find . -type f -name 'docker-compose.*' -exec sed -i 's@GENERATE_SELF_SIGNED_SSL: "no"@GENERATE_SELF_SIGNED_SSL: "yes"@' {} \; elif [ "$test" = "tweaked_options" ] ; then - echo "🔐 Running tests with selfsigned's options tweaked ..." + echo "🔑 Running tests with selfsigned's options tweaked ..." find . -type f -name 'docker-compose.*' -exec sed -i 's@SELF_SIGNED_SSL_EXPIRY: "365"@SELF_SIGNED_SSL_EXPIRY: "30"@' {} \; find . -type f -name 'docker-compose.*' -exec sed -i 's@SELF_SIGNED_SSL_SUBJ: "/CN=www.example.com/"@SELF_SIGNED_SSL_SUBJ: "/CN=example.com/"@' {} \; fi - echo "🔐 Starting stack ..." + echo "🔑 Starting stack ..." docker compose up -d 2>/dev/null if [ $? -ne 0 ] ; then - echo "🔐 Up failed ❌" - exit 1 + echo "🔑 Up failed, retrying ... âš ī¸" + manual=1 + cleanup_stack + manual=0 + if [ $? -ne 0 ] ; then + echo "🔑 Up failed ❌" + exit 1 + fi fi # Check if stack is healthy - echo "🔐 Waiting for stack to be healthy ..." + echo "🔑 Waiting for stack to be healthy ..." i=0 while [ $i -lt 120 ] ; do containers=("selfsigned-bw-1" "selfsigned-bw-scheduler-1") @@ -76,7 +82,7 @@ do fi done if [ "$healthy" = "true" ] ; then - echo "🔐 Docker stack is healthy ✅" + echo "🔑 Docker stack is healthy ✅" break fi sleep 1 @@ -84,7 +90,7 @@ do done if [ $i -ge 120 ] ; then docker compose logs - echo "🔐 Docker stack is not healthy ❌" + echo "🔑 Docker stack is not healthy ❌" exit 1 fi @@ -93,12 +99,12 @@ do docker compose -f docker-compose.test.yml up --abort-on-container-exit --exit-code-from tests 2>/dev/null if [ $? -ne 0 ] ; then - echo "🔐 Test \"$test\" failed ❌" + echo "🔑 Test \"$test\" failed ❌" echo "đŸ›Ąī¸ Showing BunkerWeb and BunkerWeb Scheduler logs ..." docker compose logs bw bw-scheduler exit 1 else - echo "🔐 Test \"$test\" succeeded ✅" + echo "🔑 Test \"$test\" succeeded ✅" fi manual=1 @@ -109,4 +115,4 @@ do done end=1 -echo "🔐 Tests are done ! ✅" +echo "🔑 Tests are done ! ✅" diff --git a/tests/core/sessions/test.sh b/tests/core/sessions/test.sh index 5d440cb6b..3c37c9501 100755 --- a/tests/core/sessions/test.sh +++ b/tests/core/sessions/test.sh @@ -57,8 +57,14 @@ do echo "đŸ§ŗ Starting stack ..." docker compose up -d 2>/dev/null if [ $? -ne 0 ] ; then - echo "đŸ§ŗ Up failed ❌" - exit 1 + echo "đŸ§ŗ Up failed, retrying ... âš ī¸" + manual=1 + cleanup_stack + manual=0 + if [ $? -ne 0 ] ; then + echo "đŸ§ŗ Up failed ❌" + exit 1 + fi fi # Check if stack is healthy diff --git a/tests/core/whitelist/test.sh b/tests/core/whitelist/test.sh index 1c4756784..595164c1a 100755 --- a/tests/core/whitelist/test.sh +++ b/tests/core/whitelist/test.sh @@ -102,7 +102,7 @@ do find . -type f -name 'docker-compose.*' -exec sed -i 's@WHITELIST_IP_URLS: "http://whitelist-api:8080/ip"@WHITELIST_IP_URLS: ""@' {} \; find . -type f -name 'docker-compose.*' -exec sed -i 's@WHITELIST_RDNS: ""@WHITELIST_RDNS: ".bw-services"@' {} \; elif [ "$test" = "rdns_global" ] ; then - echo "🏴 Running tests when whitelist's rdns also scans local ip addresses ..." + echo "đŸŗī¸ Running tests when whitelist's rdns also scans local ip addresses ..." find . -type f -name 'docker-compose.*' -exec sed -i 's@WHITELIST_RDNS_GLOBAL: "yes"@WHITELIST_RDNS_GLOBAL: "no"@' {} \; elif [ "$test" = "rdns_urls" ] ; then echo "đŸŗī¸ Running tests with whitelist's rdns url set to http://whitelist-api:8080/rdns ..." @@ -139,8 +139,14 @@ do echo "đŸŗī¸ Starting stack ..." docker compose up -d 2>/dev/null if [ $? -ne 0 ] ; then - echo "đŸŗī¸ Up failed ❌" - exit 1 + echo "đŸŗī¸ Up failed, retrying ... âš ī¸" + manual=1 + cleanup_stack + manual=0 + if [ $? -ne 0 ] ; then + echo "đŸŗī¸ Up failed ❌" + exit 1 + fi fi # Check if stack is healthy