Repository navigation
Description
Part of #5900. Follow-up from the Envoy backend review (#5907).
Goal
Add automated end-to-end coverage that exercises the Envoy backend against a real MCP server, so egress/ingress enforcement is validated behaviorally — not just via unit tests and envoy --mode validate.
Approach: parametrize the existing suite
test/e2e/network_isolation_test.go already covers exactly the right scenarios against the default Squid backend:
- inbound + outbound restrictions (allowed host reachable, blocked URL → error)
- gateway IP denied by default, reachable with
--allow-docker-gateway - gateway deny→allow rule transition
Rather than duplicate the file, parametrize the behavioral tests over {squid, envoy} by threading TOOLHIVE_NETWORK_PROXY=envoy into the shared startFetchServer / verifyNetworkRestrictions helpers via the existing .WithEnv(...) mechanism. Keep backend-specific config-shape assertions separate: the current squidConf(...) inspection stays Squid-only; add the Envoy equivalent asserting on the generated bootstrap JSON if desired.
Key coverage to guarantee
- Allowed host reachable through the Envoy egress; denied host blocked.
- Bridge gateway IP denied by default; reachable only with
--allow-docker-gateway. This is the regression guard for the inert-destination_ipbug fixed in Add Envoy network-proxy backend behind TOOLHIVE_NETWORK_PROXY=envoy #5907 — the one gap that unit tests + config validation could not catch. -
host.docker.internal/gateway.docker.internalblocked by default (incl. an uppercase-authority case). - Ingress: the isolated non-stdio workload reaches
running(proves the reverse proxy resolves the MCP upstream).
Harness work required
- Gate the Envoy variant so it only runs where the Envoy image is available/pullable (the e2e runners currently pull only squid/dnsmasq/fetch); skip or pre-pull otherwise.
- Add flake tolerance for startup: isolated Envoy workloads take longer to become ready, and starting several at once has already shown 60s-readiness flakiness.
Why separate from #5907
The backend PR is already large; this needs its own harness plumbing (env-var threading, image gating, flake handling) and review. It also pairs naturally with #5905 (making Envoy the default) — behavioral e2e should be green before flipping the default.
Activity
Parametrize network-isolation e2e over squid and envoy backends
Parametrize network-isolation e2e over squid and envoy backends
Move Envoy isolation e2e to a dedicated file
Add Envoy network-isolation e2e tests (#5918)
Parametrize network-isolation e2e over squid and envoy backends
Move Envoy isolation e2e to a dedicated file
Parametrize network-isolation e2e over squid and envoy backends
Move Envoy isolation e2e to a dedicated file
Parametrize network-isolation e2e over squid and envoy backends
Move Envoy isolation e2e to a dedicated file