fix(quic-interop): skip /setup.sh in smoke mode (it breaks Docker-bridge DNS)

The base image's /setup.sh configures routing for the runner's ns-3 sim
*and* points the container's DNS resolver at the sim's nameserver. When
we source it inside `make smoke` (which uses a plain Docker bridge
network without the sim), DNS resolution for the bridge container names
breaks: the JVM client can't resolve `amethyst-quic-interop-smoke-picoquic`
and aborts before any QUIC traffic.

Adds a SMOKE_MODE=1 env var; run_endpoint.sh skips /setup.sh entirely
when it's set. The Makefile smoke target sets it. Inside the runner
(unset, default), /setup.sh runs as before.

https://claude.ai/code/session_01HcvfQq1ttPV9PkRoJb4nyT
This commit is contained in:
Claude
2026-05-06 22:58:59 +00:00
parent 86b6c609a6
commit d8e17207b6
2 changed files with 12 additions and 7 deletions
+1
View File
@@ -38,6 +38,7 @@ smoke: docker smoke-down
@echo "picoquic up on $(SMOKE_PICOQUIC):4433 (in $(SMOKE_NET))"
docker run --rm --name $(SMOKE_CLIENT) \
--network $(SMOKE_NET) \
-e SMOKE_MODE=1 \
-e ROLE=client \
-e TESTCASE=handshake \
-e REQUESTS="https://$(SMOKE_PICOQUIC):4433/" \
+11 -7
View File
@@ -2,15 +2,19 @@
# quic-interop-runner endpoint entry point.
#
# The base image (martenseemann/quic-network-simulator-endpoint) provides
# /setup.sh, which configures routing for the runner's ns-3 sim. We try
# to source it but tolerate failure so smoke tests outside the runner
# (without --privileged / the sim's network) still launch the JVM client.
# Inside the runner, /setup.sh succeeds because the runner provides the
# necessary capabilities.
# /setup.sh, which configures routing for the runner's ns-3 sim. We source
# it inside the runner — but for `make smoke` runs against a plain Docker
# bridge network, sourcing /setup.sh succeeds AND breaks DNS resolution
# (it points the resolver at the sim's nameserver which doesn't exist
# in smoke mode). Set SMOKE_MODE=1 to skip /setup.sh entirely.
set -uo pipefail
# shellcheck disable=SC1091
source /setup.sh 2>/dev/null || echo "(setup.sh skipped — running outside the runner sim)" >&2
if [ "${SMOKE_MODE:-0}" = "1" ]; then
echo "(smoke mode — skipping /setup.sh, using container default networking)" >&2
else
# shellcheck disable=SC1091
source /setup.sh 2>/dev/null || echo "(setup.sh skipped — running outside the runner sim)" >&2
fi
set -e