From 35161b9b6dc7329923bcef109abaf42076588e74 Mon Sep 17 00:00:00 2001 From: Stefan Saenger Date: Wed, 15 Jul 2026 14:14:07 +0200 Subject: [PATCH] fix: resolve 3 in-container test failures in CI compose run 1. REST 404 "Unknown host: prosody": the tester reaches prosody by service name (http://prosody:5280), so aiohttp sends Host: prosody, which Prosody rejects as an unknown vhost. The auto host-header heuristic only overrides for IP/localhost. Set REST_HOST_HEADER= example.com explicitly in the tester env so HTTP routing lands on the example.com VirtualHost that serves mod_http_rest /rest. 2. healthcheck.sh not found: the static test_04_infra checks resolve ../config/healthcheck.sh (= /config/healthcheck.sh) but the tester image only ships /tests. Mount ./config:/config:ro so the path resolves inside the container. 3. telnet non-loopback banner: read only 256 bytes, capturing just the ASCII-art top and never the literal "Prosody" text. Bump to 1024 to match test_04_infra.test_telnet_banner, which passes with the larger read. Part-of: --- docker-compose.yml | 9 +++++++++ tests/test_11_smokes.py | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 866f59f..4982022 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -98,8 +98,17 @@ services: PG_PASSWORD: prosody PG_DB: prosody MOCK_URL: http://mocks:8080 # for side-effect assertions + # The tester reaches prosody directly by service name (http://prosody:5280), + # so aiohttp sends Host: prosody — which Prosody rejects as an unknown + # vhost (404 "Unknown host"). Send the real XMPP domain so HTTP routing + # lands on the example.com VirtualHost that serves mod_http_rest /rest. + REST_HOST_HEADER: example.com volumes: - ./tests:/tests + # Surface the repo config/ dir so static tests (test_04_infra + # healthcheck source checks) can resolve ../config/healthcheck.sh + # from inside the container. + - ./config:/config:ro volumes: pgdata: diff --git a/tests/test_11_smokes.py b/tests/test_11_smokes.py index be0927c..d41fca4 100644 --- a/tests/test_11_smokes.py +++ b/tests/test_11_smokes.py @@ -163,7 +163,7 @@ class TestAdminTelnetNonLoopback: reader, writer = await asyncio.wait_for( asyncio.open_connection(host, port), timeout=5 ) - data = await asyncio.wait_for(reader.read(256), timeout=5) + data = await asyncio.wait_for(reader.read(1024), timeout=5) writer.close() await writer.wait_closed() except (OSError, asyncio.TimeoutError) as e: