From 6d613ed9af70cf9d91ffa850e0243148d69b6180 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Chlup?= Date: Mon, 14 Sep 2026 15:05:03 +0200 Subject: [PATCH 01/16] test: Tweak tomcat_wait_for_n_nodes to run faster when nodes are ready --- test/includes/common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/includes/common.sh b/test/includes/common.sh index 1fcbd9bb..b1994522 100644 --- a/test/includes/common.sh +++ b/test/includes/common.sh @@ -182,7 +182,7 @@ tomcat_wait_for_n_nodes() { echo "$(date) httpd isn't running or something is VERY wrong" exit 1 fi - NBNODES=-1 + NBNODES=$(curl -s http://localhost:8090/mod_cluster_manager -m 20 | grep "Status: OK" | awk ' { print $3} ' | wc -l) i=0 while [ ${NBNODES} != ${nodes} ] do From b368e482d08635944edc349a4d79e342511abb62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Chlup?= Date: Mon, 14 Sep 2026 16:43:36 +0200 Subject: [PATCH 02/16] test: Simplify the defaulting of test variables --- test/testsuite.sh | 28 +++++----------------------- 1 file changed, 5 insertions(+), 23 deletions(-) diff --git a/test/testsuite.sh b/test/testsuite.sh index 8ef515e9..b1f67311 100644 --- a/test/testsuite.sh +++ b/test/testsuite.sh @@ -4,30 +4,12 @@ # exits with 2 if httpd container build failed # exits with 3 if tomcat container build failed -# configuration of variables -# if you want tests to pass much faster, decrease these values -if [ -z ${FOREVER_PAUSE+x} ]; then - export FOREVER_PAUSE=3600 # sleep period length during which tomcats are run & stopped -fi -if [ -z ${TOMCAT_CYCLE_COUNT+x} ]; then - export TOMCAT_CYCLE_COUNT=100 # the number of repetitions of a test cycle -fi -if [ -z ${ITERATION_COUNT+x} ]; then - export ITERATION_COUNT=50 # the number of iteration of starting/stopping a tomcat -fi -if [ -z ${IMG+x} ]; then - export IMG=mod_proxy_cluster-testsuite-tomcat -fi -if [ -z ${HTTPD_IMG+x} ]; then - export HTTPD_IMG=mod_proxy_cluster-testsuite-httpd -fi - echo "Test parameters are:" -echo " FOREVER_PAUSE=$FOREVER_PAUSE" -echo " TOMCAT_CYCLE_COUNT=$TOMCAT_CYCLE_COUNT" -echo " ITERATION_COUNT=$ITERATION_COUNT" -echo " IMG=$IMG" -echo " HTTPD_IMG=$HTTPD_IMG" +echo " FOREVER_PAUSE=${FOREVER_PAUSE:=3600}" # sleep period length during which tomcats are run & stopped +echo " TOMCAT_CYCLE_COUNT=${TOMCAT_CYCLE_COUNT:=100}" # the number of repetitions of a test cycle +echo " ITERATION_COUNT=${ITERATION_COUNT:=50}" # the number of iteration of starting/stopping a tomcat +echo " IMG=${IMG:=mod_proxy_cluster-testsuite-tomcat}" # tomcat container image +echo " HTTPD_IMG=${HTTPD_IMG:=mod_proxy_cluster-testsuite-httpd}" # httpd with mod_proxy_cluster container image if [ ! -z ${MPC_CONF+x} ]; then echo " MPC_CONF=$MPC_CONF" fi From a7ce9ba5f7fe58fae30c091cf92c7388b96620c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Chlup?= Date: Mon, 14 Sep 2026 16:48:05 +0200 Subject: [PATCH 03/16] test: Make mod_proxy_cluster/mod_proxy_balancer tests execution conditional --- test/testsuite.sh | 87 +++++++++++++++++++++++++---------------------- 1 file changed, 47 insertions(+), 40 deletions(-) diff --git a/test/testsuite.sh b/test/testsuite.sh index b1f67311..57053eb9 100644 --- a/test/testsuite.sh +++ b/test/testsuite.sh @@ -14,6 +14,9 @@ if [ ! -z ${MPC_CONF+x} ]; then echo " MPC_CONF=$MPC_CONF" fi echo " DEBUG=${DEBUG:-Off (undefined)}" +echo " MOD_PROXY_CLUSTER_TESTS=${MOD_PROXY_CLUSTER_TESTS:=On}" +echo " MOD_PROXY_BALANCER_TESTS=${MOD_PROXY_BALANCER_TESTS:=On}" + if [ ! -d logs ]; then mkdir logs @@ -44,48 +47,52 @@ echo " Done" res=0 -# IMG name might include specific version, we have to handle that -IMG_NOVER=$(echo $IMG | cut -d: -f1) +if is_enabled "$MOD_PROXY_CLUSTER_TESTS"; then + # IMG name might include specific version, we have to handle that + IMG_NOVER=$(echo $IMG | cut -d: -f1) -for tomcat_version in "9.0" "10.1" "11.0" -do - IMG="$IMG_NOVER:$tomcat_version" tomcat_create $tomcat_version > /dev/null 2>&1 || exit 3 - IMG="$IMG_NOVER:$tomcat_version" run_test basetests.sh "Basic tests with tomcat $tomcat_version" - res=$(expr $res + $?) -done -run_test hangingtests.sh "Hanging tests" -res=$(expr $res + $?) -run_test maintests.sh "Main tests" -res=$(expr $res + $?) -run_test websocket/basic.sh "Websocket tests" -res=$(expr $res + $?) -run_test usealias/testit.sh "UseAlias" -res=$(expr $res + $?) -run_test MODCLUSTER-640/testit.sh "MODCLUSTER-640" -res=$(expr $res + $?) -run_test MODCLUSTER-734/testit.sh "MODCLUSTER-734" -res=$(expr $res + $?) -run_test MODCLUSTER-736/testit.sh "MODCLUSTER-736" -res=$(expr $res + $?) -run_test MODCLUSTER-755/testit.sh "MODCLUSTER-755" -res=$(expr $res + $?) -run_test MODCLUSTER-785/testit.sh "MODCLUSTER-785" -res=$(expr $res + $?) -run_test MODCLUSTER-794/testit.sh "MODCLUSTER-794" -res=$(expr $res + $?) + for tomcat_version in "9.0" "10.1" "11.0" + do + IMG="$IMG_NOVER:$tomcat_version" tomcat_create $tomcat_version > /dev/null 2>&1 || exit 3 + IMG="$IMG_NOVER:$tomcat_version" run_test basetests.sh "Basic tests with tomcat $tomcat_version" + res=$(expr $res + $?) + done + run_test hangingtests.sh "Hanging tests" + res=$(expr $res + $?) + run_test maintests.sh "Main tests" + res=$(expr $res + $?) + run_test websocket/basic.sh "Websocket tests" + res=$(expr $res + $?) + run_test usealias/testit.sh "UseAlias" + res=$(expr $res + $?) + run_test MODCLUSTER-640/testit.sh "MODCLUSTER-640" + res=$(expr $res + $?) + run_test MODCLUSTER-734/testit.sh "MODCLUSTER-734" + res=$(expr $res + $?) + run_test MODCLUSTER-736/testit.sh "MODCLUSTER-736" + res=$(expr $res + $?) + run_test MODCLUSTER-755/testit.sh "MODCLUSTER-755" + res=$(expr $res + $?) + run_test MODCLUSTER-785/testit.sh "MODCLUSTER-785" + res=$(expr $res + $?) + run_test MODCLUSTER-794/testit.sh "MODCLUSTER-794" + res=$(expr $res + $?) +fi -MPC_CONF=httpd/mod_lbmethod_cluster.conf run_test basetests.sh "Basic tests with mod_proxy_balancer" -res=$(expr $res + $?) -MPC_CONF=MODCLUSTER-640/mod_lbmethod_cluster.conf run_test MODCLUSTER-640/testit.sh "MODCLUSTER-640 with mod_proxy_balancer" -res=$(expr $res + $?) -MPC_CONF=MODCLUSTER-734/mod_lbmethod_cluster.conf run_test MODCLUSTER-734/testit.sh "MODCLUSTER-734 with mod_proxy_balancer" -res=$(expr $res + $?) -MPC_CONF=httpd/mod_lbmethod_cluster.conf run_test MODCLUSTER-755/testit.sh "MODCLUSTER-755 with mod_proxy_balancer" -res=$(expr $res + $?) -MPC_CONF=MODCLUSTER-785/mod_lbmethod_cluster.conf run_test MODCLUSTER-785/testit.sh "MODCLUSTER-785 with mod_proxy_balancer" -res=$(expr $res + $?) -MPC_CONF=MODCLUSTER-794/mod_lbmethod_cluster.conf run_test MODCLUSTER-794/testit.sh "MODCLUSTER-794 with mod_proxy_balancer" -res=$(expr $res + $?) +if is_enabled "$MOD_PROXY_BALANCER_TESTS"; then + MPC_CONF=httpd/mod_lbmethod_cluster.conf run_test basetests.sh "Basic tests with mod_proxy_balancer" + res=$(expr $res + $?) + MPC_CONF=MODCLUSTER-640/mod_lbmethod_cluster.conf run_test MODCLUSTER-640/testit.sh "MODCLUSTER-640 with mod_proxy_balancer" + res=$(expr $res + $?) + MPC_CONF=MODCLUSTER-734/mod_lbmethod_cluster.conf run_test MODCLUSTER-734/testit.sh "MODCLUSTER-734 with mod_proxy_balancer" + res=$(expr $res + $?) + MPC_CONF=httpd/mod_lbmethod_cluster.conf run_test MODCLUSTER-755/testit.sh "MODCLUSTER-755 with mod_proxy_balancer" + res=$(expr $res + $?) + MPC_CONF=MODCLUSTER-785/mod_lbmethod_cluster.conf run_test MODCLUSTER-785/testit.sh "MODCLUSTER-785 with mod_proxy_balancer" + res=$(expr $res + $?) + MPC_CONF=MODCLUSTER-794/mod_lbmethod_cluster.conf run_test MODCLUSTER-794/testit.sh "MODCLUSTER-794 with mod_proxy_balancer" + res=$(expr $res + $?) +fi echo -n "Cleaning containers if any..." httpd_remove > /dev/null 2>&1 From 9f063efbad65f63dbaaba456e99824b4999416c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Chlup?= Date: Mon, 14 Sep 2026 17:14:49 +0200 Subject: [PATCH 04/16] ci: Separate mod_proxy_cluster and mod_proxy_balancer tests into two jobs --- .github/workflows/ci.yml | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d981f5e4..85b562ca 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,9 +17,7 @@ on: debug: description: "Test logs are generated when on" type: choice - options: - - "on" - - "off" + options: [ "on", "off" ] default: "on" forever-pause: @@ -37,6 +35,18 @@ on: type: number default: 2 + mod_proxy_cluster: + description: "mod_proxy_cluster tests are executed" + type: choice + options: [ "on", "off" ] + default: "on" + + balancer: + description: "mod_proxy_balancer tests are executed" + type: choice + options: [ "on", "off" ] + default: "on" + jobs: cmake-fedora-latest: @@ -298,6 +308,7 @@ jobs: fail-fast: false matrix: os: [ ubuntu-latest, ubuntu-24.04-arm ] + suite: [ mod_proxy_cluster, mod_proxy_balancer ] env: IMG: local-tomcat HTTPD_IMG: local-httpd @@ -305,6 +316,8 @@ jobs: FOREVER_PAUSE: ${{ inputs.forever-pause || 100 }} ITERATION_COUNT: ${{ inputs.iteration-count || 2 }} TOMCAT_CYCLE_COUNT: ${{ inputs.tomcat-cycle-count || 2 }} + MOD_PROXY_CLUSTER_TESTS: ${{ matrix.suite == 'mod_proxy_cluster' && (inputs.mod_proxy_cluster || 'on') || 'off' }} + MOD_PROXY_BALANCER_TESTS: ${{ matrix.suite == 'mod_proxy_balancer' && (inputs.balancer || 'on') || 'off' }} steps: - name: Checkout uses: actions/checkout@v6 @@ -338,7 +351,7 @@ jobs: uses: actions/upload-artifact@v6 if: ${{ env.DEBUG == 'on' }} with: - name: Test logs ${{ matrix.os }} + name: Test logs ${{ matrix.os }} ${{ matrix.suite }} path: | test/logs/* retention-days: 7 From 216bd88f4ba8d8b6c097a84fda5151adc82fc7eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Chlup?= Date: Tue, 15 Sep 2026 09:11:13 +0200 Subject: [PATCH 05/16] test: Run Base mod_proxy_balancer tests with multiple tomcat versions too --- test/testsuite.sh | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/test/testsuite.sh b/test/testsuite.sh index 57053eb9..a2d14384 100644 --- a/test/testsuite.sh +++ b/test/testsuite.sh @@ -37,6 +37,14 @@ else httpd_create > /dev/null 2>&1 || exit 2 tomcat_create > /dev/null 2>&1 || exit 3 fi +# create all main tomcat versions for Base tests +## IMG name might include specific version, we have to handle that +IMG_NOVER=$(echo $IMG | cut -d: -f1) +for tomcat_version in "9.0" "10.1" "11.0" +do + IMG="$IMG_NOVER:$tomcat_version" tomcat_create $tomcat_version > /dev/null 2>&1 || exit 3 +done + echo " Done" # clean everything at first @@ -48,12 +56,8 @@ echo " Done" res=0 if is_enabled "$MOD_PROXY_CLUSTER_TESTS"; then - # IMG name might include specific version, we have to handle that - IMG_NOVER=$(echo $IMG | cut -d: -f1) - for tomcat_version in "9.0" "10.1" "11.0" do - IMG="$IMG_NOVER:$tomcat_version" tomcat_create $tomcat_version > /dev/null 2>&1 || exit 3 IMG="$IMG_NOVER:$tomcat_version" run_test basetests.sh "Basic tests with tomcat $tomcat_version" res=$(expr $res + $?) done @@ -80,13 +84,16 @@ if is_enabled "$MOD_PROXY_CLUSTER_TESTS"; then fi if is_enabled "$MOD_PROXY_BALANCER_TESTS"; then - MPC_CONF=httpd/mod_lbmethod_cluster.conf run_test basetests.sh "Basic tests with mod_proxy_balancer" - res=$(expr $res + $?) + for tomcat_version in "9.0" "10.1" "11.0" + do + IMG="$IMG_NOVER:$tomcat_version" MPC_CONF=httpd/mod_lbmethod_cluster.conf run_test basetests.sh "Basic tests with mod_proxy_balancer and tomcat $tomcat_version" + res=$(expr $res + $?) + done MPC_CONF=MODCLUSTER-640/mod_lbmethod_cluster.conf run_test MODCLUSTER-640/testit.sh "MODCLUSTER-640 with mod_proxy_balancer" res=$(expr $res + $?) MPC_CONF=MODCLUSTER-734/mod_lbmethod_cluster.conf run_test MODCLUSTER-734/testit.sh "MODCLUSTER-734 with mod_proxy_balancer" res=$(expr $res + $?) - MPC_CONF=httpd/mod_lbmethod_cluster.conf run_test MODCLUSTER-755/testit.sh "MODCLUSTER-755 with mod_proxy_balancer" + MPC_CONF=httpd/mod_lbmethod_cluster.conf run_test MODCLUSTER-755/testit.sh "MODCLUSTER-755 with mod_proxy_balancer" res=$(expr $res + $?) MPC_CONF=MODCLUSTER-785/mod_lbmethod_cluster.conf run_test MODCLUSTER-785/testit.sh "MODCLUSTER-785 with mod_proxy_balancer" res=$(expr $res + $?) From 4662a56787bf872404c1cd1b1f1c0a694b91911c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Chlup?= Date: Tue, 15 Sep 2026 10:05:37 +0200 Subject: [PATCH 06/16] test: Make run_test format wider --- test/includes/common.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/includes/common.sh b/test/includes/common.sh index b1994522..4f73c072 100644 --- a/test/includes/common.sh +++ b/test/includes/common.sh @@ -8,9 +8,9 @@ MPC_NAME=${MPC_NAME:-httpd-mod_proxy_cluster} run_test() { local ret=0 if [ ! -z "$2" ]; then - printf "Running %-42s ..." "$2" + printf "Running %-64s ..." "$2" else - printf "Running %-42s ..." "$1" + printf "Running %-64s ..." "$1" fi if is_enabled "$DEBUG"; then sh $1 > "logs/${2:-$1}.log" 2>&1 From 7da1d279ef2b6f37a2d1e0d0b8a51d147ef24ad4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Chlup?= Date: Wed, 30 Sep 2026 17:48:29 +0200 Subject: [PATCH 07/16] test: Separate container creation, allow to skip it --- test/includes/common.sh | 18 ++++++++++++++++++ test/testsuite.sh | 38 +++++++++++++++++++------------------- 2 files changed, 37 insertions(+), 19 deletions(-) diff --git a/test/includes/common.sh b/test/includes/common.sh index 4f73c072..63a83c10 100644 --- a/test/includes/common.sh +++ b/test/includes/common.sh @@ -47,6 +47,24 @@ is_enabled() { return 0 } +test_create_all_containers() { + if is_enabled "$DEBUG"; then + httpd_create || exit 2 + tomcat_create || exit 3 + else + httpd_create > /dev/null 2>&1 || exit 2 + tomcat_create > /dev/null 2>&1 || exit 3 + fi + # create all main tomcat versions for Base tests + ## IMG name might include specific version, we have to handle that + IMG_NOVER=$(echo $IMG | cut -d: -f1) + for tomcat_version in "9.0" "10.1" "11.0" + do + IMG="$IMG_NOVER:$tomcat_version" tomcat_create $tomcat_version > /dev/null 2>&1 || exit 3 + done +} + + ##################################################### ### H T T P D H E L P E R F U N C T I O N S ### ##################################################### diff --git a/test/testsuite.sh b/test/testsuite.sh index a2d14384..34dd160c 100644 --- a/test/testsuite.sh +++ b/test/testsuite.sh @@ -16,6 +16,7 @@ fi echo " DEBUG=${DEBUG:-Off (undefined)}" echo " MOD_PROXY_CLUSTER_TESTS=${MOD_PROXY_CLUSTER_TESTS:=On}" echo " MOD_PROXY_BALANCER_TESTS=${MOD_PROXY_BALANCER_TESTS:=On}" +echo " SKIP_CONTAINER_CREATION=${SKIP_CONTAINER_CREATION:=Off}" if [ ! -d logs ]; then @@ -24,28 +25,27 @@ fi . includes/common.sh -if [ ! -d tomcat/target ]; then - echo "Missing dependencies. Please run setup-dependencies.sh and then try again" - exit 4 -fi +IMG_NOVER=$(echo $IMG | cut -d: -f1) -echo -n "Creating docker containers..." -if is_enabled "$DEBUG"; then - httpd_create || exit 2 - tomcat_create || exit 3 +if is_enabled "$SKIP_CONTAINER_CREATION"; then + # let's just check all the containers are present + for tomcat_image in "$IMG_NOVER:latest" "$IMG_NOVER:9.0" "$IMG_NOVER:10.1" "$IMG_NOVER:11.0" + do + if ! docker image inspect $tomcat_image > /dev/null 2>&1; then + echo "tomcat image $tomcat_image is missing" + exit 3 + fi + done + if ! docker image inspect $HTTPD_IMG > /dev/null 2>&1; then + echo "httpd image $HTTPD_IMG is missing" + exit 2 + fi else - httpd_create > /dev/null 2>&1 || exit 2 - tomcat_create > /dev/null 2>&1 || exit 3 + # create all containers + echo "Creating docker containers..." + test_create_all_containers + echo "Done" fi -# create all main tomcat versions for Base tests -## IMG name might include specific version, we have to handle that -IMG_NOVER=$(echo $IMG | cut -d: -f1) -for tomcat_version in "9.0" "10.1" "11.0" -do - IMG="$IMG_NOVER:$tomcat_version" tomcat_create $tomcat_version > /dev/null 2>&1 || exit 3 -done - -echo " Done" # clean everything at first echo -n "Cleaning possibly running containers..." From 0a1af15778d5a07be96ed235a55275959358bbfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Chlup?= Date: Wed, 30 Sep 2026 18:17:13 +0200 Subject: [PATCH 08/16] ci: Rework the CI, build dependencies once then share Also have one job to gather and evaluate tests as needed --- .github/workflows/ci.yml | 118 +++++++++++++++++++++++++++++++++------ 1 file changed, 101 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 85b562ca..1b6a2dfb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -115,17 +115,17 @@ jobs: } > Containerfile podman build . - clang-format-style-check: + clang-style-checks: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v6 with: path: mod_proxy_cluster - - name: Install clang-format + - name: Install clang-format and clang-tidy run: | sudo apt-get update - sudo apt-get install -y clang-format + sudo apt-get install -y clang-format clang-tidy apache2-dev - name: Check styles run: | code=0 @@ -142,18 +142,6 @@ jobs: rm diff.txt || true # we don't fail if the file does not exist done; exit $code - - clang-tidy-naming-check: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v6 - with: - path: mod_proxy_cluster - - name: Install clang-tidy - run: | - sudo apt-get update - sudo apt-get install -y clang-tidy apache2-dev - name: Check naming conventions run: | code=0 @@ -171,6 +159,7 @@ jobs: done exit $code + make-httpd-maintainer-mode: runs-on: ubuntu-latest strategy: @@ -302,8 +291,61 @@ jobs: path: C:\Apache24\logs\ retention-days: 7 + # Both testsuites run against this one image, so that they exercise the very same + # binaries and the coverage they gather can be merged (see the merged-coverage job). + build-test-containers: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ ubuntu-latest, ubuntu-24.04-arm ] + env: + IMG: local-tomcat + HTTPD_IMG: local-httpd + steps: + - name: Checkout + uses: actions/checkout@v6 + - name: Set up JDK 17 + uses: actions/setup-java@v5 + with: + distribution: temurin + java-version: 17 + - name: Setup dependencies + run: | + sudo apt-get update -y + sudo apt-get install -y podman-docker maven git curl iproute2 wcstools zstd + sudo touch /etc/containers/nodocker + cd test + sh setup-dependencies.sh + - name: Build the test images + run: | + cd test + . includes/common.sh + test_create_all_containers + for img in $(docker image ls --format "{{.Repository}}:{{.Tag}}" | sed 's|^localhost/||'); do + if [[ "$img" != "$IMG"* ]] && [[ "$img" != "$HTTPD_IMG"* ]]; then continue; fi + echo "Saving $img image" + docker save $img | zstd -T0 -o /tmp/$(echo $img | sed 's|:|-|').tar.zst + done + - name: Preserve the test images + uses: actions/upload-artifact@v6 + with: + name: test-containers-${{ matrix.os }} + path: /tmp/*.tar.zst + retention-days: 1 + # the tests themselves need these, they don't run setup-dependencies.sh + - name: Preserve the test dependencies + uses: actions/upload-artifact@v6 + with: + name: test-dependencies-${{ matrix.os }} + path: | + test/websocket/websocket-hello-0.0.1.war + test/includes/target/test-1.0.jar + retention-days: 1 + tests: runs-on: ${{ matrix.os }} + needs: build-test-containers strategy: fail-fast: false matrix: @@ -318,6 +360,7 @@ jobs: TOMCAT_CYCLE_COUNT: ${{ inputs.tomcat-cycle-count || 2 }} MOD_PROXY_CLUSTER_TESTS: ${{ matrix.suite == 'mod_proxy_cluster' && (inputs.mod_proxy_cluster || 'on') || 'off' }} MOD_PROXY_BALANCER_TESTS: ${{ matrix.suite == 'mod_proxy_balancer' && (inputs.balancer || 'on') || 'off' }} + SKIP_CONTAINER_CREATION: 'on' steps: - name: Checkout uses: actions/checkout@v6 @@ -329,7 +372,7 @@ jobs: - name: Setup dependencies run: | sudo apt-get update -y - sudo apt-get install -y podman-docker maven git curl iproute2 wcstools + sudo apt-get install -y podman-docker maven git curl iproute2 wcstools zstd sudo touch /etc/containers/nodocker cd test sh setup-dependencies.sh @@ -343,13 +386,30 @@ jobs: [engine] events_logger = "file" EOF + - name: Get the test images built + uses: actions/download-artifact@v7 + with: + name: test-containers-${{ matrix.os }} + path: /tmp + - name: Load the test images + run: | + cd /tmp + for img in $(ls *.tar.zst); do + echo "Loading $img image" + zstd -dc $img | docker load + done + - name: Get the test dependencies built + uses: actions/download-artifact@v7 + with: + name: test-dependencies-${{ matrix.os }} + path: test - name: Run testsuite run: | cd test sh testsuite.sh - name: Preserve test logs uses: actions/upload-artifact@v6 - if: ${{ env.DEBUG == 'on' }} + if: ${{ !cancelled() && env.DEBUG == 'on' }} with: name: Test logs ${{ matrix.os }} ${{ matrix.suite }} path: | @@ -416,3 +476,27 @@ jobs: name: Doxygen docs path: doxygen-out/html/* retention-days: 30 + + gather-results: + runs-on: ubuntu-latest + # make-with-httpd-trunk is in there transitively through perl tests + needs: [ tests, perl-tests, clang-style-checks, cmake-fedora-latest, make-httpd-maintainer-mode, make-fedora-latest, doxygen, cmake-windows-latest ] + steps: + - name: Get all the test logs + uses: actions/download-artifact@v7 + with: + pattern: '*logs*' + # now delete the obtained archives and make a new one containing all the logs + - name: Delete all the logs we got + uses: geekyeggo/delete-artifact@v6 + with: + name: '*logs*' + failOnError: false + - name: Bundle the logs together + uses: actions/upload-artifact@v6 + if: always() + with: + name: Test logs + path: '*logs*' + retention-days: 7 + From 5a9c58647a223e6791be40fd65a466e02253e4f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Chlup?= Date: Thu, 1 Oct 2026 09:49:25 +0200 Subject: [PATCH 09/16] ci: Drop the setup-dependencies call from tests --- .github/workflows/ci.yml | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1b6a2dfb..1362cc90 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -364,18 +364,13 @@ jobs: steps: - name: Checkout uses: actions/checkout@v6 - - name: Set up JDK 17 - uses: actions/setup-java@v5 - with: - distribution: temurin - java-version: 17 - name: Setup dependencies run: | sudo apt-get update -y - sudo apt-get install -y podman-docker maven git curl iproute2 wcstools zstd + sudo apt-get install -y podman-docker git curl iproute2 wcstools zstd sudo touch /etc/containers/nodocker - cd test - sh setup-dependencies.sh + # create the network (usually done by setup-dependencies.sh + docker network create mod_proxy_cluster_testsuite_net > /dev/null 2>&1 || true - name: Configure Podman logging driver run: | mkdir -p ~/.config/containers From 209288493224126c83847911f9a7ba35f6ae182b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Chlup?= Date: Thu, 1 Oct 2026 09:50:30 +0200 Subject: [PATCH 10/16] test: Run setup-dependencies.sh only when containers are created --- test/testsuite.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/testsuite.sh b/test/testsuite.sh index 34dd160c..f3f49be8 100644 --- a/test/testsuite.sh +++ b/test/testsuite.sh @@ -42,6 +42,11 @@ if is_enabled "$SKIP_CONTAINER_CREATION"; then fi else # create all containers + if [ ! -d tomcat/target ]; then + echo "Missing dependencies. Please run setup-dependencies.sh and then try again" + exit 4 + fi + echo "Creating docker containers..." test_create_all_containers echo "Done" From e7adc7fb76ce94810fc63f2241d4b94227ab0d4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Chlup?= Date: Thu, 1 Oct 2026 18:35:50 +0200 Subject: [PATCH 11/16] ci: Separate Hanging tests and MODCLUSTER-736 from the rest --- .github/workflows/ci.yml | 97 +++++++++++++++++++++++++++++++++++----- 1 file changed, 85 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1362cc90..13ca7d2b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -343,6 +343,76 @@ jobs: test/includes/target/test-1.0.jar retention-days: 1 + test-extra: + name: test-extra (${{ matrix.os }}, ${{ matrix.test.name }}) + runs-on: ${{ matrix.os }} + needs: build-test-containers + strategy: + fail-fast: false + matrix: + os: [ ubuntu-latest, ubuntu-24.04-arm ] + # these tests take a lot of time, that's why we keep them separate + test: + - name: MODCLUSTER-736 + script: MODCLUSTER-736/testit.sh + + - name: Hanging tests + script: hangingtests.sh + env: + IMG: local-tomcat + HTTPD_IMG: local-httpd + DEBUG: ${{ inputs.debug || 'on' }} + FOREVER_PAUSE: ${{ inputs.forever-pause || 100 }} + ITERATION_COUNT: ${{ inputs.iteration-count || 2 }} + TOMCAT_CYCLE_COUNT: ${{ inputs.tomcat-cycle-count || 2 }} + SKIP_CONTAINER_CREATION: 'on' + steps: + - name: Checkout + uses: actions/checkout@v6 + - name: Setup dependencies + run: | + sudo apt-get update -y + sudo apt-get install -y podman-docker git curl iproute2 wcstools zstd + sudo touch /etc/containers/nodocker + # create the network (usually done by setup-dependencies.sh + docker network create mod_proxy_cluster_testsuite_net > /dev/null 2>&1 || true + - name: Configure Podman logging driver + run: | + mkdir -p ~/.config/containers + cat < ~/.config/containers/containers.conf + [containers] + log_driver = "k8s-file" + + [engine] + events_logger = "file" + EOF + - name: Get the test images built + uses: actions/download-artifact@v7 + with: + name: test-containers-${{ matrix.os }} + path: /tmp + - name: Load the test images + run: | + cd /tmp + for img in $(ls *.tar.zst); do + echo "Loading $img image" + zstd -dc $img | docker load + done + - name: Run ${{ matrix.test.name }} + run: | + cd test + mkdir logs + . includes/common.sh + run_test "${{ matrix.test.script }}" "${{ matrix.test.name }}" + - name: Preserve test logs + uses: actions/upload-artifact@v6 + if: ${{ !cancelled() && env.DEBUG == 'on' }} + with: + name: ${{ matrix.test.name }} logs ${{ matrix.os }} + path: | + test/logs/* + retention-days: 7 + tests: runs-on: ${{ matrix.os }} needs: build-test-containers @@ -398,6 +468,11 @@ jobs: with: name: test-dependencies-${{ matrix.os }} path: test + - name: Disable MODCLUSTER-736 and Hanging tests + run: | + cd test + sed -i '/MODCLUSTER-736/s|^|#|' testsuite.sh + sed -i '/Hanging tests/s|^|#|' testsuite.sh - name: Run testsuite run: | cd test @@ -475,23 +550,21 @@ jobs: gather-results: runs-on: ubuntu-latest # make-with-httpd-trunk is in there transitively through perl tests - needs: [ tests, perl-tests, clang-style-checks, cmake-fedora-latest, make-httpd-maintainer-mode, make-fedora-latest, doxygen, cmake-windows-latest ] + needs: [ tests, perl-tests, clang-style-checks, cmake-fedora-latest, make-httpd-maintainer-mode, make-fedora-latest, doxygen, cmake-windows-latest, test-extra ] steps: - - name: Get all the test logs - uses: actions/download-artifact@v7 - with: - pattern: '*logs*' - # now delete the obtained archives and make a new one containing all the logs - - name: Delete all the logs we got + - name: Delete all the containers/dependencies we no longer need uses: geekyeggo/delete-artifact@v6 with: - name: '*logs*' + name: | + test-containers* + test-dependencies* failOnError: false - - name: Bundle the logs together - uses: actions/upload-artifact@v6 - if: always() + - name: Merge all the logs + uses: actions/upload-artifact/merge@v6 with: name: Test logs - path: '*logs*' + pattern: '*logs*' + separate-directories: true + delete-merged: true retention-days: 7 From eb1577eaa141bce8d5b50f536501bde33d2f8c2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Chlup?= Date: Fri, 2 Oct 2026 09:03:27 +0200 Subject: [PATCH 12/16] test: Use $((...)) instead of expr `expr` returns 1 (a failure) when the result is 0 which may lead to some failures even though nothing bad happenned (see testsuite.sh) --- test/MODCLUSTER-736/testit.sh | 10 +++++----- test/MODCLUSTER-755/testit.sh | 6 +++--- test/MODCLUSTER-785/testit.sh | 4 ++-- test/basetests.sh | 2 +- test/includes/common.sh | 14 +++++++------- test/maintests.sh | 6 +++--- test/testsuite.sh | 34 +++++++++++++++++----------------- 7 files changed, 38 insertions(+), 38 deletions(-) diff --git a/test/MODCLUSTER-736/testit.sh b/test/MODCLUSTER-736/testit.sh index d2248669..f25bb854 100644 --- a/test/MODCLUSTER-736/testit.sh +++ b/test/MODCLUSTER-736/testit.sh @@ -25,7 +25,7 @@ runtomcatbatch() { MPC_NAME=MODCLUSTER-736 tomcat_start $i done - tomcat_count=$(expr 3 + 11 - $t) + tomcat_count=$(( 3 + 11 - $t )) tomcat_wait_for_n_nodes $tomcat_count || exit 1 for i in $(seq $t 10); do @@ -94,7 +94,7 @@ singlecycle() { echo "Timeout: tomcat$1 is not ready" exit 1 fi - i=$(expr $i + 1) + i=$(( $i + 1 )) sleep 1 done echo "Testing(0) tomcat$1 started" @@ -112,7 +112,7 @@ singlecycle() { echo "Timeout: webapp on tomcat$1 is not ready after 300 seconds" exit 1 fi - i=$(expr $i + 1) + i=$(( $i + 1 )) sleep 1 done echo "Testing(1) tomcat$1" @@ -132,7 +132,7 @@ singlecycle() { echo "Timeout: webapp is still present on tomcat$1 after 300 seconds" exit 1 fi - i=$(expr $i + 1) + i=$(( $i + 1 )) sleep 1 done tomcat_remove $1 || exit 1 @@ -210,7 +210,7 @@ runmodcluster736() { runmodcluster736=0 while true do - runmodcluster736=$(expr $runmodcluster736 + 1) + runmodcluster736=$(( $runmodcluster736 + 1 )) if [ $runmodcluster736 -gt 2 ]; then echo "Looks OK, runmodcluster736 stopping!" break diff --git a/test/MODCLUSTER-755/testit.sh b/test/MODCLUSTER-755/testit.sh index 9fe7c726..f9aae7cc 100755 --- a/test/MODCLUSTER-755/testit.sh +++ b/test/MODCLUSTER-755/testit.sh @@ -33,7 +33,7 @@ if [ "x$USE_MULTI_APP" = "xtrue" ]; then echo "The webapp are going to be 1-9000/2-9000 until count (1-9499/2-9499)" fi -for i in $(seq 9000 $(expr 9000 + $NODE_COUNT - 1)) +for i in $(seq 9000 $(( 9000 + $NODE_COUNT - 1 ))) do curl $HTTPD -H "User-Agent: ClusterListener/1.0" -X CONFIG --data "JVMRoute=appserver$i&Host=127.0.0.1&Maxattempts=1&Port=$i&StickySessionForce=No&Timeout=20&Type=ajp&ping=20" curl $HTTPD -H "User-Agent: ClusterListener/1.0" -X STATUS --data "JVMRoute=appserver$i&Load=100" @@ -51,7 +51,7 @@ done i=0 while [ true ] do - for i in $(seq 9000 $(expr 9000 + $NODE_COUNT - 1)) + for i in $(seq 9000 $(( 9000 + $NODE_COUNT - 1 ))) do curl $HTTPD -H "User-Agent: ClusterListener/1.0" -X STATUS --data "JVMRoute=appserver$i&Load=100" if [ $? -ne 0 ]; then @@ -60,7 +60,7 @@ do fi done sleep 10 - i=$(expr $i + 1) + i=$(( $i + 1 )) if [ $i -gt 100 ]; then break fi diff --git a/test/MODCLUSTER-785/testit.sh b/test/MODCLUSTER-785/testit.sh index f6dbf214..9871b2b2 100755 --- a/test/MODCLUSTER-785/testit.sh +++ b/test/MODCLUSTER-785/testit.sh @@ -67,7 +67,7 @@ do if [ ${http_code} = 200 ]; then break fi - i=$(expr $i + 1) + i=$(( $i + 1 )) if [ $i -gt 60 ]; then break fi @@ -92,7 +92,7 @@ do echo "MODCLUSTER-785 Failed! return 503" exit 1 fi - i=$(expr $i + 1) + i=$(( $i + 1 )) if [ $i -gt 60 ]; then break fi diff --git a/test/basetests.sh b/test/basetests.sh index 3ea5e1fc..fdd36154 100644 --- a/test/basetests.sh +++ b/test/basetests.sh @@ -45,7 +45,7 @@ do tomcat_shutdown 1 tomcat_wait_for_n_nodes 0 || exit 1 tomcat_remove 1 - iter=$(expr $iter + 1) + iter=$(( $iter + 1 )) done tomcat_all_remove diff --git a/test/includes/common.sh b/test/includes/common.sh index 63a83c10..9258289b 100644 --- a/test/includes/common.sh +++ b/test/includes/common.sh @@ -111,7 +111,7 @@ httpd_wait_until_ready() { curl -m 20 localhost:8090 > /dev/null 2>&1 while [ $? != 0 ]; do - i=$(expr $i + 1) + i=$(( $i + 1 )) if [ $i -gt 20 ]; then echo "$(date) Failed to run httpd container" exit 1; @@ -169,8 +169,8 @@ tomcat_start() { exit 1 fi - local DEFAULT_OFFSET=$(expr $1 - 1) - local shutport=$(expr ${SHUTDOWN_PORT:-8005} + $DEFAULT_OFFSET) + local DEFAULT_OFFSET=$(( $1 - 1 )) + local shutport=$(( ${SHUTDOWN_PORT:-8005} + $DEFAULT_OFFSET )) echo "$(date) Starting tomcat$1" nohup docker run --network=mod_proxy_cluster_testsuite_net \ @@ -207,7 +207,7 @@ tomcat_wait_for_n_nodes() { NBNODES=$(curl -s http://localhost:8090/mod_cluster_manager -m 20 | grep "Status: OK" | awk ' { print $3} ' | wc -l) sleep 10 echo "$(date) Waiting for $nodes node to be ready (nodes ready: $NBNODES)" - i=$(expr $i + 1) + i=$(( $i + 1 )) if [ $i -gt 60 ]; then echo "($date) Timeout! There are not $nodes nodes but $NBNODES instead" exit 1 @@ -290,7 +290,7 @@ tomcat_shutdown() { fi echo "$(date) shutting down tomcat$1" - echo "SHUTDOWN" | nc localhost $(expr ${SHUTDOWN_PORT:-8005} + $1 - 1) + echo "SHUTDOWN" | nc localhost $(( ${SHUTDOWN_PORT:-8005} + $1 - 1 )) } # Remove the docker image tomcat$1 @@ -370,7 +370,7 @@ tomcat_all_run_ab() { while true do tomcat_run_ab $tc || exit 1 - tc=$(expr $tc + 1) + tc=$(( $tc + 1 )) if [ $tc -gt $1 ]; then echo "$(date) abtomcats: Done!" break @@ -394,7 +394,7 @@ tomcat_all_test_app() { while true do tomcat_test_app $tc || exit 1 - tc=$(expr $tc + 1) + tc=$(( $tc + 1 )) if [ $tc -gt $1 ]; then echo "$(date) tomcat_tests $tc Done!" break diff --git a/test/maintests.sh b/test/maintests.sh index b909bbd4..fd67da8f 100644 --- a/test/maintests.sh +++ b/test/maintests.sh @@ -60,7 +60,7 @@ while [ "${NODE}" = "${NEWNODE}" ] do NEWCO=$(curl -v http://localhost:8090/testapp/test.jsp -m 20 -o /dev/null 2>&1 | grep Set-Cookie | awk '{ print $3 } ' | sed 's:;::') NEWNODE=$(echo ${NEWCO} | awk -F = '{ print $2 }' | awk -F . '{ print $2 }') - i=$(expr $i + 1) + i=$(( $i + 1 )) if [ $i -gt 40 ]; then echo "Can't find the 2 webapps" exit 1 @@ -90,7 +90,7 @@ echotestlabel "sticky: stopping one node and doing requests..." NODE=$(echo ${NEWCO} | awk -F = '{ print $2 }' | awk -F . '{ print $2 }') echo $NODE PORT=$(curl http://localhost:8090/mod_cluster_manager -m 20 | grep Node | grep $NODE | sed 's:)::' | awk -F : '{ print $3 } ') -NUMBER=$(expr ${PORT} - 8080 + 1) +NUMBER=$(( ${PORT} - 8080 + 1 )) CODE="200" i=0 while [ "$CODE" = "200" ] @@ -106,7 +106,7 @@ do # We're going to kill instead of removal because kill only tomcat proc (keeps the container in DNS) tomcat_kill $NUMBER fi - i=$(expr $i + 1) + i=$(( $i + 1 )) done if [ ${CODE} != "200" ]; then echo "Something was wrong... got: ${CODE}" diff --git a/test/testsuite.sh b/test/testsuite.sh index f3f49be8..1b92d987 100644 --- a/test/testsuite.sh +++ b/test/testsuite.sh @@ -64,46 +64,46 @@ if is_enabled "$MOD_PROXY_CLUSTER_TESTS"; then for tomcat_version in "9.0" "10.1" "11.0" do IMG="$IMG_NOVER:$tomcat_version" run_test basetests.sh "Basic tests with tomcat $tomcat_version" - res=$(expr $res + $?) + res=$(( $res + $? )) done run_test hangingtests.sh "Hanging tests" - res=$(expr $res + $?) + res=$(( $res + $? )) run_test maintests.sh "Main tests" - res=$(expr $res + $?) + res=$(( $res + $? )) run_test websocket/basic.sh "Websocket tests" - res=$(expr $res + $?) + res=$(( $res + $? )) run_test usealias/testit.sh "UseAlias" - res=$(expr $res + $?) + res=$(( $res + $? )) run_test MODCLUSTER-640/testit.sh "MODCLUSTER-640" - res=$(expr $res + $?) + res=$(( $res + $? )) run_test MODCLUSTER-734/testit.sh "MODCLUSTER-734" - res=$(expr $res + $?) + res=$(( $res + $? )) run_test MODCLUSTER-736/testit.sh "MODCLUSTER-736" - res=$(expr $res + $?) + res=$(( $res + $? )) run_test MODCLUSTER-755/testit.sh "MODCLUSTER-755" - res=$(expr $res + $?) + res=$(( $res + $? )) run_test MODCLUSTER-785/testit.sh "MODCLUSTER-785" - res=$(expr $res + $?) + res=$(( $res + $? )) run_test MODCLUSTER-794/testit.sh "MODCLUSTER-794" - res=$(expr $res + $?) + res=$(( $res + $? )) fi if is_enabled "$MOD_PROXY_BALANCER_TESTS"; then for tomcat_version in "9.0" "10.1" "11.0" do IMG="$IMG_NOVER:$tomcat_version" MPC_CONF=httpd/mod_lbmethod_cluster.conf run_test basetests.sh "Basic tests with mod_proxy_balancer and tomcat $tomcat_version" - res=$(expr $res + $?) + res=$(( $res + $? )) done MPC_CONF=MODCLUSTER-640/mod_lbmethod_cluster.conf run_test MODCLUSTER-640/testit.sh "MODCLUSTER-640 with mod_proxy_balancer" - res=$(expr $res + $?) + res=$(( $res + $? )) MPC_CONF=MODCLUSTER-734/mod_lbmethod_cluster.conf run_test MODCLUSTER-734/testit.sh "MODCLUSTER-734 with mod_proxy_balancer" - res=$(expr $res + $?) + res=$(( $res + $? )) MPC_CONF=httpd/mod_lbmethod_cluster.conf run_test MODCLUSTER-755/testit.sh "MODCLUSTER-755 with mod_proxy_balancer" - res=$(expr $res + $?) + res=$(( $res + $? )) MPC_CONF=MODCLUSTER-785/mod_lbmethod_cluster.conf run_test MODCLUSTER-785/testit.sh "MODCLUSTER-785 with mod_proxy_balancer" - res=$(expr $res + $?) + res=$(( $res + $? )) MPC_CONF=MODCLUSTER-794/mod_lbmethod_cluster.conf run_test MODCLUSTER-794/testit.sh "MODCLUSTER-794 with mod_proxy_balancer" - res=$(expr $res + $?) + res=$(( $res + $? )) fi echo -n "Cleaning containers if any..." From d292a8195c18f8879dc787ecb8d494aa47b6579b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Chlup?= Date: Fri, 2 Oct 2026 10:56:40 +0200 Subject: [PATCH 13/16] ci: Move the env vars to the top level --- .github/workflows/ci.yml | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 13ca7d2b..3374df91 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,6 +47,15 @@ on: options: [ "on", "off" ] default: "on" +env: + IMG: local-tomcat + HTTPD_IMG: local-httpd + DEBUG: ${{ inputs.debug || 'on' }} + FOREVER_PAUSE: ${{ inputs.forever-pause || 100 }} + ITERATION_COUNT: ${{ inputs.iteration-count || 2 }} + TOMCAT_CYCLE_COUNT: ${{ inputs.tomcat-cycle-count || 2 }} + SKIP_CONTAINER_CREATION: 'on' + jobs: cmake-fedora-latest: @@ -358,14 +367,6 @@ jobs: - name: Hanging tests script: hangingtests.sh - env: - IMG: local-tomcat - HTTPD_IMG: local-httpd - DEBUG: ${{ inputs.debug || 'on' }} - FOREVER_PAUSE: ${{ inputs.forever-pause || 100 }} - ITERATION_COUNT: ${{ inputs.iteration-count || 2 }} - TOMCAT_CYCLE_COUNT: ${{ inputs.tomcat-cycle-count || 2 }} - SKIP_CONTAINER_CREATION: 'on' steps: - name: Checkout uses: actions/checkout@v6 @@ -422,15 +423,8 @@ jobs: os: [ ubuntu-latest, ubuntu-24.04-arm ] suite: [ mod_proxy_cluster, mod_proxy_balancer ] env: - IMG: local-tomcat - HTTPD_IMG: local-httpd - DEBUG: ${{ inputs.debug || 'on' }} - FOREVER_PAUSE: ${{ inputs.forever-pause || 100 }} - ITERATION_COUNT: ${{ inputs.iteration-count || 2 }} - TOMCAT_CYCLE_COUNT: ${{ inputs.tomcat-cycle-count || 2 }} MOD_PROXY_CLUSTER_TESTS: ${{ matrix.suite == 'mod_proxy_cluster' && (inputs.mod_proxy_cluster || 'on') || 'off' }} MOD_PROXY_BALANCER_TESTS: ${{ matrix.suite == 'mod_proxy_balancer' && (inputs.balancer || 'on') || 'off' }} - SKIP_CONTAINER_CREATION: 'on' steps: - name: Checkout uses: actions/checkout@v6 From 5dd46705023cf45b4d9cec8696dbcce4c3f28323 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Chlup?= Date: Fri, 2 Oct 2026 11:03:17 +0200 Subject: [PATCH 14/16] test: Fix run_test when the test fails in shell with -e (GH Actions) --- test/includes/common.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/includes/common.sh b/test/includes/common.sh index 9258289b..34e9226c 100644 --- a/test/includes/common.sh +++ b/test/includes/common.sh @@ -13,11 +13,11 @@ run_test() { printf "Running %-64s ..." "$1" fi if is_enabled "$DEBUG"; then - sh $1 > "logs/${2:-$1}.log" 2>&1 + sh $1 > "logs/${2:-$1}.log" 2>&1 || ret=$? else - sh $1 > /dev/null 2>&1 + sh $1 > /dev/null 2>&1 || ret=$? fi - if [ $? = 0 ]; then + if [ $ret = 0 ]; then echo " OK" else echo " NOK" From a2fa327c5dfad323c72ff5b4fb08c5daa90cba6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Chlup?= Date: Fri, 2 Oct 2026 12:12:44 +0200 Subject: [PATCH 15/16] ci: Gather only the logs on Windows --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3374df91..a725c64a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -297,7 +297,7 @@ jobs: if: always() with: name: Windows logs for ${{ matrix.os }} - path: C:\Apache24\logs\ + path: C:\Apache24\logs\*log retention-days: 7 # Both testsuites run against this one image, so that they exercise the very same From fe43893e8ddd6fb69c38fb51cb99390a9a952d96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Chlup?= Date: Fri, 2 Oct 2026 15:30:33 +0200 Subject: [PATCH 16/16] test: Simplify MODCLUSTER-736, drop redundant/dead code --- test/MODCLUSTER-736/testit.sh | 113 ++++++---------------------------- 1 file changed, 20 insertions(+), 93 deletions(-) diff --git a/test/MODCLUSTER-736/testit.sh b/test/MODCLUSTER-736/testit.sh index f25bb854..964c37cd 100644 --- a/test/MODCLUSTER-736/testit.sh +++ b/test/MODCLUSTER-736/testit.sh @@ -26,33 +26,21 @@ runtomcatbatch() { done tomcat_count=$(( 3 + 11 - $t )) - tomcat_wait_for_n_nodes $tomcat_count || exit 1 + tomcat_wait_for_n_nodes $tomcat_count for i in $(seq $t 10); do - tomcat_start_webapp $i || exit 1 + tomcat_start_webapp $i done # test the tomcats sleep 20 tomcat_all_test_app $tomcat_count - if [ $? -ne 0 ]; then - echo "runtomcatbatch tomcat_all_test_app $tomcat_count FAILED!" - exit 1 - fi # "load test" 9 of them tomcat_all_run_ab $tomcat_count - if [ $? -ne 0 ]; then - echo "runtomcatbatch tomcat_all_run_ab $tomcat_count FAILED!" - exit 1 - fi # retest tomcat_all_test_app $tomcat_count - if [ $? -ne 0 ]; then - echo "runtomcatbatch tomcat_all_test_app $tomcat_count FAILED!" - exit 1 - fi # stop the tomcats for i in $(seq $t 10); @@ -61,10 +49,6 @@ runtomcatbatch() { done tomcat_wait_for_n_nodes 3 - if [ $? -ne 0 ]; then - echo "runtomcatbatch tomcat_wait_for_n_nodes 3 FAILED!" - exit 1 - fi # remove the tomcats for i in $(seq $t 10); @@ -79,7 +63,7 @@ runtomcatbatch() { singlecycle() { echo "singlecycle: Testing tomcat$1" R=$1 - MPC_NAME=MODCLUSTER-736 tomcat_start $1 || exit 1 + MPC_NAME=MODCLUSTER-736 tomcat_start $1 # Wait for it to start echo "Testing(0) tomcat$1 waiting..." @@ -98,7 +82,7 @@ singlecycle() { sleep 1 done echo "Testing(0) tomcat$1 started" - tomcat_start_webapp $1 || exit 1 + tomcat_start_webapp $1 echo "Testing(0) tomcat$1 with webapp" i=0 while true @@ -116,10 +100,10 @@ singlecycle() { sleep 1 done echo "Testing(1) tomcat$1" - tomcat_test_app $1 || exit 1 + tomcat_test_app $1 echo "Testing(2) tomcat$1" - tomcat_test_app $1 || exit 1 - tomcat_run_ab $1 || exit 1 + tomcat_test_app $1 + tomcat_run_ab $1 echo "Testing(3) tomcat$1" tomcat_shutdown $1 || exit 1 while true @@ -143,7 +127,7 @@ singlecycle() { looptomcatforever() { while true do - singlecycle $1 || exit 1 + singlecycle $1 done } @@ -177,14 +161,16 @@ forevertomcat() { tomcat_remove_by_name tomcat14 tomcat_remove_by_name tomcat15 tomcat_remove_by_name tomcat16 - sleep 10 + # the nodes have to be gone from the manager, otherwise the following + # tomcat_wait_for_n_nodes calls would be satisfied by these leftovers + tomcat_wait_for_n_nodes 0 } # Start and stop successively (one after another) $1 tomcats cyclestomcats() { for i in $(seq 1 $1); do echo -n "$i/$1: " - singlecycle $i || exit 1 + singlecycle $i done echo "Looks OK, Done!" } @@ -196,15 +182,15 @@ runmodcluster736() { MPC_NAME=MODCLUSTER-736 tomcat_start 2 MPC_NAME=MODCLUSTER-736 tomcat_start 3 MPC_NAME=MODCLUSTER-736 tomcat_start 4 - tomcat_wait_for_n_nodes 3 || exit 1 + tomcat_wait_for_n_nodes 3 # check them - tomcat_start_webapp 2 || exit 1 - tomcat_start_webapp 3 || exit 1 - tomcat_start_webapp 4 || exit 1 + tomcat_start_webapp 2 + tomcat_start_webapp 3 + tomcat_start_webapp 4 sleep 20 - tomcat_test_app 2 || exit 1 - tomcat_test_app 3 || exit 1 - tomcat_test_app 4 || exit 1 + tomcat_test_app 2 + tomcat_test_app 3 + tomcat_test_app 4 # start a bunch of tomcats, test, shutdown, remove and try in a loop. runmodcluster736=0 @@ -217,56 +203,23 @@ runmodcluster736() { fi # cycle the tomcats runtomcatbatch - - if [ $? -ne 0 ]; then - echo "runtomcatbatch: runmodcluster736 Failed!" - exit 1 - fi tomcat_shutdown 2 tomcat_wait_for_n_nodes 2 - if [ $? -ne 0 ]; then - echo "tomcat_wait_for_n_nodes 2: runmodcluster736 Failed!" - exit 1 - fi tomcat_remove 2 MPC_NAME=MODCLUSTER-736 tomcat_start 5 tomcat_wait_for_n_nodes 3 - if [ $? -ne 0 ]; then - echo "tomcat_wait_for_n_nodes 3: runmodcluster736 Failed!" - exit 1 - fi tomcat_start_webapp 5 - if [ $? -ne 0 ]; then - echo "tomcat_start_webapp 5: runmodcluster736 Failed!" - exit 1 - fi sleep 20 tomcat_test_app 5 - if [ $? -ne 0 ]; then - echo "tomcat_test_app 5: runmodcluster736 Failed!" - exit 1 - fi # we have 5 3 4 in shared memory # read 2 MPC_NAME=MODCLUSTER-736 tomcat_start 2 tomcat_wait_for_n_nodes 4 - if [ $? -ne 0 ]; then - echo "tomcat_wait_for_n_nodes 4: runmodcluster736 Failed!" - exit 1 - fi tomcat_start_webapp 2 - if [ $? -ne 0 ]; then - echo "tomcat_start_webapp 2: runmodcluster736 Failed!" - exit 1 - fi sleep 20 tomcat_test_app 2 - if [ $? -ne 0 ]; then - echo "tomcat_test_app 2: runmodcluster736 Failed!" - exit 1 - fi sleep 20 @@ -275,29 +228,11 @@ runmodcluster736() { tomcat_shutdown 5 tomcat_wait_for_n_nodes 3 - if [ $? -ne 0 ]; then - echo "tomcat_wait_for_n_nodes 3: runmodcluster736 Failed!" - exit 1 - fi tomcat_remove 5 tomcat_test_app 2 - if [ $? -ne 0 ]; then - echo "tomcat_test_app 2: runmodcluster736 Failed!" - exit 1 - fi - tomcat_test_app 3 - if [ $? -ne 0 ]; then - echo "tomcat_test_app 3: runmodcluster736 Failed!" - exit 1 - fi - tomcat_test_app 4 - if [ $? -ne 0 ]; then - echo "tomcat_test_app 4: runmodcluster736 Failed!" - exit 1 - fi echo "runmodcluster736 loop: $runmodcluster736 DONE" done @@ -305,7 +240,7 @@ runmodcluster736() { tomcat_shutdown 4 tomcat_shutdown 3 tomcat_shutdown 2 - tomcat_wait_for_n_nodes 0 || exit 1 + tomcat_wait_for_n_nodes 0 tomcat_remove 2 tomcat_remove 3 tomcat_remove 4 @@ -314,16 +249,8 @@ runmodcluster736() { # MODCLUSTER-736 echo "Testing MODCLUSTER-736" cyclestomcats ${TOMCAT_CYCLE_COUNT:-10} -if [ $? -ne 0 ]; then - echo "MODCLUSTER-736 cyclestomcats 100 FAILED!" - exit 1 -fi echo "cycletomcats DONE" forevertomcat -if [ $? -ne 0 ]; then - echo "MODCLUSTER-736 forevertomcat FAILED!" - exit 1 -fi echo "forevertomcat DONE" runmodcluster736 if [ $? -ne 0 ]; then