Repository navigation
test(e2e): run the edge tunnel test over TLS - #4486
politerealism wants to merge 1 commit into
Conversation
ws_tunnel_status_through_edge_proxy returned early, and so reported success, whenever it could not set up its own preconditions. It could not in any lane that starts its own gateway, so it never exercised the WebSocket tunnel: - It looked for the gateway URL on a `gateway info` line that mentions "endpoint" or "gateway", but the URL is printed on the `Server:` line. - It required a plaintext endpoint, but the CLI only tunnels over https://, and those lanes register an mTLS gateway at an https:// endpoint. Read the endpoint from the registered gateway metadata instead of scraping `gateway info`. For a gateway with a registered CA, trust it by pointing the CLI at it with SSL_CERT_FILE, since the tunnel client uses the system trust store; otherwise use the system store. Fail, instead of returning early, when the gateway is unhealthy or not https://, and require the CLI's debug log to show the completed WebSocket handshake so a status that bypassed the tunnel cannot pass. The test needs a gateway with the WebSocket tunnel enabled, so move it behind a new e2e-edge-tunnel feature that the docker and podman lanes enable. The Kubernetes and VM lanes cannot exercise it and no longer compile it. Contributes to ai-openshell#3712 Signed-off-by: politerealism <burdcat17@gmail.com>
7933fb4 to
c55df65
Compare
|
@elezar a few things I'd like your eyes on, in case you have time.
|
|
This pull request has had no activity for 14 days and is now marked stale. |
|
Thanks for tracking down the false pass here. The early returns reporting success, the One thing before you spend more time on a rebase: Two options:
We'd cover the Docker and macOS runs you couldn't do either way. Which do you prefer? |
Summary
ws_tunnel_status_through_edge_proxyreturned early, and so reported success, whenever it could not set up its own preconditions. In every lane that starts its own gateway it could not, so it never exercised the WebSocket tunnel. This makes it work against a TLS gateway, makes it fail when it can't, and moves it behind a feature flag so it only runs where the gateway supports it.Related Issue
Contributes to #3712. No separate issue: this is a test-only change that fixes a false pass.
Changes
gateway info. The old lookup never matched, because the URL is on theServer:line.https://, so the old plaintext requirement could never have exercised the tunnel. The test now needs anhttps://gateway and fails with a clear message otherwise.SSL_CERT_FILE, because the tunnel client uses the system trust store. With no registered CA it uses the system store.WebSocket connected to edge, so a healthystatusthat bypassed the tunnel cannot pass. This is the one place that depends on a diagnostic line, which RFC 0016 discourages for conformance tests.e2e-edge-tunnelfeature, enabled bye2e-dockerande2e-podman. Kubernetes and VM can't exercise the test, so they no longer compile it.gateway_status_reports_healthystill runs everywhere.Testing
mise run pre-commitpassesOPENSHELL_E2E_PODMAN_TEST=edge_tunnel_e2e mise run e2e:podmanon rootless Podman with a TLS gateway and the tunnel enabled: both tests inedge_tunnel_e2epass.UnknownIssuerwhen the CA isn't trusted, fails at the health precondition for a bad gateway, still passes with an inheritedRUST_LOG=warn, and a directstatuswithout the tunnel exits 0 but has no handshake line.SSL_CERT_FILEis read before the platform store in the locked rustls-native-certs (0.8.3), so it should behave the same on macOS.Checklist