Skip to content

test(testkit): share TLS host servers, a gateway settings role and the environment contract table #5728

Open

Description

@matthewgrossman

User Story

As a maintainer porting the gateway-configuration and OIDC tests out of e2e/rust in parallel, I want the helpers those ports share to exist before they start, so each port doesn't write its own copy and we don't need another extraction PR like #5691.

Description

The next three ports (gateway configuration without restart, corporate proxy, OIDC) need three things in common. None of them waits on an open decision in #5297.

  1. TLS for host test servers. tests/support/host-server serves plain HTTP only. Add a test CA and TLS servers signed by it, built on openshell-crypto (not the openssl CLI):

    • TestCa::new() for a CA the test owns;
    • TestCa::from_env() for the environment's additional CA (OPENSHELL_TEST_ADDITIONAL_CA_{CERT,KEY}), failing if either is missing;
    • ca.leaf(&[names]) for a server certificate;
    • a TLS variant of the HTTP recorder (the test(e2e): decide which e2e/rust tests to port and in what order #5297 plan calls these tls and tls_env_ca).

    Users: provider_readiness, stable_external_placeholders and additional_ca (trust checks), and the corporate-proxy TLS upstreams.

  2. One tmachine role for gateway settings. Test environments add gateway settings to /etc/openshell-test/gateway-overrides.toml in two ways today: test(conformance): run the conformance suite against a gateway that pushes configuration #5622's config-push.yaml edits a marked block (blockinfile), and test(e2e): port Docker and Podman driver feature tests from e2e/rust #5695's driver-config.yaml replaces the file (copy). Five new environments (OIDC, OTLP, SPIFFE, additional CA, corporate proxy) need the same. Add a gateway_overrides role that takes a name and TOML content and writes a marked block. When feat(gateway): merge drop-in configs over the base file #5489 lands, only the role changes, to write a gateway.d/ drop-in. Move the existing writers in main to the role.

  3. The tests/support contract table. The PR6 and PR7 Definitions of Done require a row for each new environment variable, but the table doesn't exist. Add tests/support/README.md with one row per OPENSHELL_TEST_* variable on main: name, which environment sets it, which helper reads it, and what it means. Include the convention for tests that bind an address the environment chose: the environment publishes OPENSHELL_TEST_<SERVICE>_LISTEN and the test binds it.

Context

Definition of Done

  • tests/support/host-server serves TLS with a test-owned CA and with the environment's additional CA, with unit tests.
  • A gateway_overrides tmachine role exists, and the existing override writers on main use it.
  • tests/support/README.md lists every OPENSHELL_TEST_* variable on main, and TESTING.md links to it.
  • Existing E2E rows still pass.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

topic:testingUnit, integration, regression, conformance, E2E tests, coverage, flakes, and test infrastructure.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions