Skip to content

Conversation

@jajik
Copy link
Member

@jajik jajik commented Nov 11, 2025

This is a bigger PR but because of the nature of changes, there is not much what to do about it (I've already dropped some changes for future PRs).

The main thing is that host network is no longer used in containerized tests. This allows us to use DNS, isolate tests to a different network (minimizing conflicts with other running services).

In points:

  • uses docker/podman custom network instead of host network
  • leverages DNS instead of IPs/localhost
  • separates UseAlias test from maintests (and UseAlias is not enabled by default in the rest of the tests)
  • reworks and improves containers provisioning (gets rid of some old limitations, makes configurable things that make sense, drops support for things we were not using)
  • minor tweaks and fixes (POSIX operators, drop unnecessary/failing commands, tweak log levels, fix typos, etc.)

close #348

@jajik jajik requested review from rhusar and removed request for rhusar November 11, 2025 13:34
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reasons for keeping these comments in here, while I understand the motivation for cleanup, is that when a new version of Tomcat is released, it's easier to compare the two server.xml files and adapt to what has changed.

jajik added 12 commits November 13, 2025 10:46
Set HostNameLookups On to get hostname in %{REMOTE_HOST}, no IP

Drop hardcoded IP addresses, no localhost (except client <-> proxy)

Tomcat container now does not exit when tomcat process is stopped

Minor files & format clean ups
Containers are now using custom docker network with DNS

Containers are now using their container names instead of localhost/IPs

Parameters/Options now reflect the actual usage
Shift tomcat ports where conflicts might lead to random test failures

Code and format clean ups
Also test a little bit more than before

UseAlias is not enabled by default in the rest of the testsuite now
Unfortunately, custom podman networks do not support rDNS so tomcat
requests are handled by their IP. This causes our `Require host` to
not work which leads to test failures.

Upon httpd container start, we try to detect podman and if needed,
we change `Require host` to `Require ip`.
Copy link
Member

@jfclere jfclere left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem is more the mix of variable set + call of function on the same line and variable set in several line and then the call of the function. We should use a single one and prefer a single line set + calls (more easy to maintain.


MPC_CONF=${MPC_CONF:-MODCLUSTER-734/mod_proxy_cluster.conf}
MPC_NAME=MODCLUSTER-734 httpd_start
MPC_NAME=MODCLUSTER-734
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That looks wrong to me...
MPC_NAME=MODCLUSTER-734 httpd_start
the httpd_start will have MPC_NAME MODCLUSTER-734
MPC_NAME=MODCLUSTER-734
httpd_start
MPC_NAME will be the default value mod_proxy_cluster
I don't think we want that!
There are many places with that modification that looks wrong to me.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well that "works" because we source the script containing httpd_start, but that will fail for any script we call without sourcing it...

Copy link
Member Author

@jajik jajik Nov 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason for setting it on a separate line is that then it's set for the whole file.

foo() {
    echo "VALUE is ${VALUE:-default}"
}

foo
VALUE=test
foo
VALUE=demo foo
foo

will print

VALUE is default
VALUE is test
VALUE is demo
VALUE is test

The tomcat_start function uses MPC_NAME so that tomcat knows which host corresponds to the proxy. Alternatively we could set the variable for each tomcat_start & other commands that use it, but this looked more elegant to me.

EDIT: Added default to the example.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved the declaration on the same line in 16daf05 until we set everything clearly at the beginning in the future.

Before all configuration variables will be moved at the beginning.
@jajik jajik requested a review from jfclere November 13, 2025 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use custom docker network instead of host in the testsuite

3 participants