Skip to content

test(e2e): port corporate-proxy tests from e2e/rust to features/corporate-proxy - #5786

Draft
matthewgrossman wants to merge 15 commits into
test/5728-share-environment-helpers/matthewgrossmanfrom
test/5730-port-corporate-proxy-tests/matthewgrossman
Draft

matthewgrossman wants to merge 15 commits into
test/5728-share-environment-helpers/matthewgrossmanfrom
test/5730-port-corporate-proxy-tests/matthewgrossman

Conversation

@matthewgrossman

@matthewgrossman matthewgrossman commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Summary

Port the Docker and Podman corporate-proxy e2e tests to a testkit feature suite, features/corporate-proxy. It runs on a new static <base>-corporate-proxy tmachine environment. That environment runs one corporate proxy that does Basic auth, serves TLS and intercepts TLS, and points the gateway's driver at it.

Related Issue

Closes #5730
Part of #5281

Stacks on #5780 (#5728), whose branch is merged in. That brings in the host-server TLS servers and fixed listen port, the gateway_overrides role and the environment contract table.

Changes

  • tests/tmachine: new corporate_proxy role, corporate-proxy.yaml playbook and corporate-proxy feature on the Docker and Podman bases.
    • The proxy is one asyncio script (files/corporate-proxy.py, Python 3.11+), run as a systemd service with its own CA from openssl.
    • It requires Basic auth, serves its listener over TLS and intercepts the TLS in every tunnel.
    • It logs each CONNECT as a JSON line.
    • The gateway settings go through gateway_overrides: https_proxy, proxy_auth_file, proxy_ca_bundle, and a port-qualified no_proxy.
    • The playbook publishes OPENSHELL_TEST_CORPORATE_PROXY_{URL,CA_CERT,BYPASS_PORT,LOG}.
  • tests/support/corporate-proxy: new fixture that reads those variables and parses the proxy's log after a cursor.
  • tests/support/container-engine: Engine::secret_exists, for the Podman secret check.
  • tests/suites/features/corporate-proxy, two tests:
    • approved_egress_uses_authenticated_proxy:
      • the approved request goes through the proxy, authenticated, with a validated IP as the CONNECT target;
      • the denied request never reaches the proxy;
      • the bypass port is dialed direct;
      • on Podman, the sandbox's openshell-proxy-auth-<id> secret exists while it runs and is gone after delete.
    • intercepting_proxy_ca_is_trusted_by_supervisor_and_workload: the supervisor (on the inspected endpoint) and the workload (on the tls: skip endpoint) both trust the proxy's re-signed certificates, and the denied request never reaches the proxy.
  • .github/workflows/e2e-suites.yml: rows for ubuntu-docker-rootful-corporate-proxy and fedora-podman-rootful-corporate-proxy.
  • Deleted e2e/rust/tests/docker_corporate_proxy.rs and podman_corporate_proxy.rs, plus their references in e2e/rust/Cargo.toml, e2e-podman.sh, tests/tmachine/artifacts.nix and TESTING.md.

Behavior changes from the legacy tests

  • Proxy setup: the legacy tests used a plain http:// proxy with proxy_auth_allow_insecure. The suite now uses one https:// proxy with Basic auth and proxy_ca_bundle, so allow_insecure is not needed. The http:// proxy scheme is no longer tested on its own.
  • Interception: it now runs on Podman as well as Docker, and the proxy intercepts every tunnel, not just in a separate test.
  • Raw endpoint port: the interception test's raw (tls: skip) endpoint uses its own random port. The bypass port is always in no_proxy, so it can't serve as that endpoint.
  • Podman secret check: it stays at the end of the egress test, as in the legacy Podman test.
  • Deleted test: proxy_settings_are_inserted_before_nested_driver_tables is deleted, not moved. It tested the legacy file's own TOML-editing helper, not gateway code.
  • Rootless Podman: has no row. Sandbox creation fails there because Podman can't relabel the root-owned proxy CA that the driver bind-mounts with z. Tracked in test(features): corporate-proxy sandboxes fail to start on rootless Podman: proxy CA relabel denied #5795.

Testing

  • cargo fmt, cargo clippy -D warnings and unit tests for corporate-proxy-support, container-engine-support and the corporate-proxy suite (--list shows both tests).
  • I ran the proxy locally (Python 3.14) with the role's own certificate commands. It gave the expected intercepted, 407 (missing and wrong auth), 502 and client_tls_failed results, and the role's readiness check passes. ruff and ansible-lint are clean for the new files.
  • cargo check for e2e/rust with e2e-docker,e2e-podman after the deletions.
  • The CI e2e rows haven't run yet.
  • E2E tests added/updated

Checklist

  • Follows Conventional Commits
  • Commits are signed off (DCO)

Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
…settings

Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
…ting proxy

Run one corporate proxy in the guest that serves TLS, requires Basic auth and
intercepts the TLS in every tunnel with its own CA. It merges the three
fixture proxies from the legacy corporate-proxy tests into one asyncio
service, since TLS inside the listener's TLS needs asyncio's start_tls.

Point the gateway's driver at it through the gateway_overrides role, with a
port-qualified no_proxy entry, and publish
OPENSHELL_TEST_CORPORATE_PROXY_{URL,CA_CERT,BYPASS_PORT,LOG}.

Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
…ONNECT log

Read OPENSHELL_TEST_CORPORATE_PROXY_* and parse the proxy's JSON-lines log
from a cursor, so a test sees only the CONNECTs its own sandbox made.

Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
…ers/matthewgrossman' into test/5730-port-corporate-proxy-tests/matthewgrossman

Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
…ariable

Follow the environment contract's OPENSHELL_TEST_<SERVICE>_LISTEN name for
an address the environment picks and a test binds.

Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Check sandbox egress through the environment's corporate proxy: approved
requests are proxied with credentials and a validated IP target, denied ones
never reach the proxy, the no_proxy port is dialed direct, and on Podman the
per-sandbox credentials secret goes away with the sandbox. A second test
checks that the supervisor and the workload both trust the intercepting
proxy's CA.

Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
…ments

Add features/corporate-proxy rows for the rootful Docker and the rootful and
rootless Podman corporate-proxy environments, and list the environment's
OPENSHELL_TEST_CORPORATE_PROXY_* variables in the contract table.

Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
features/corporate-proxy replaces them. Their TOML-editing helper test
checked only the file's own helper, so it goes with the file.

Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
@copy-pr-bot

copy-pr-bot Bot commented Nov 20, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@github-actions github-actions Bot added the state:accepted A maintainer decided OpenShell should pursue this issue label Nov 20, 2026
@matthewgrossman
matthewgrossman force-pushed the test/5728-share-environment-helpers/matthewgrossman branch from d1cf453 to 8005863 Compare November 20, 2026 05:50
…matthewgrossman

Take #5728's side for the files it owns, and publish the bypass port as
OPENSHELL_TEST_CORPORATE_PROXY_BYPASS_PORT, following its renamed
OPENSHELL_TEST_<SERVICE>_PORT convention.

Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
@matthewgrossman

Copy link
Copy Markdown
Member Author

/ok to test 7272553

@matthewgrossman matthewgrossman added the test:e2e Requires end-to-end coverage label Nov 20, 2026
@github-actions

Copy link
Copy Markdown

Label test:e2e applied for 7272553. Open the existing run and click Re-run all jobs to execute with the label set. The run will execute the standard E2E suite after building the required gateway, sandbox, and supervisor images once. The matching required CI gate status on this PR will flip green automatically once the run finishes.

Sandbox creation fails there because Podman can't relabel the root-owned
proxy CA bind mount. Tracked in #5795.

Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
@matthewgrossman

Copy link
Copy Markdown
Member Author

/ok to test b483569

…ers/matthewgrossman' into test/5730-port-corporate-proxy-tests/matthewgrossman

Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

state:accepted A maintainer decided OpenShell should pursue this issue test:e2e Requires end-to-end coverage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant