Repository navigation
test(testkit): share environment and provider helpers across E2E ports - #5780
matthewgrossman wants to merge 12 commits into
Conversation
|
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. |
d1cf453 to
8005863
Compare
|
Label |
|
/ok to test 8005863 |
…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>
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>
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
…an empty file Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Add the authority key identifier to server certificates, which strict verifiers such as Python 3.13 require, time out TLS handshakes, report CA load failures as such, and keep test CA files in temporary directories. The contract table now names environment-chosen ports OPENSHELL_TEST_<SERVICE>_PORT, matching HttpRecorder's port option. Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
09028e6 to
f718748
Compare
|
Rebased onto The rebase keeps the shared accept loop and the nextest worker counts from |
…tting The host servers bind 0.0.0.0, so a fixed-port recorder accepts IPv4 but not IPv6 connections. Say so in the environment contract instead of promising every host address. Name the additional CA setting by its full key, openshell.supervisor.network.additional_ca_bundle, so an environment configures the right table. Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
create_provider and install_provider return a builder that creates the provider when awaited, so tests can chain .config(key, value) for provider create --config. Existing callers are unchanged. Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Summary
These helpers let the E2E ports develop in parallel without duplicating fixture setup or depending on each other’s tests.
no_proxybypass port. GitHub App (#5907) and the later additional-CA trust port can reuse the TLS fixture.gateway_overridestmachine role. Write or remove a named block of gateway TOML.ProfileandCredentialbuild provider profiles in Rust;ProviderBuildersets provider configuration while keeping credential values out of CLI arguments.tests/support/README.md). Document who sets each test input, who reads it, and what it means, including the fixed-port convention.Related Issue
Closes #5728
Closes #5928
Part of #5281
Changes
tests/support/README.md: one row for each variable an environment, the runner or CI sets for tests to read, includingOPENSHELL_TEST_UNSUPPORTEDfrom feat(testkit): run conformance as one program and add unsupported-test entries #5755. It also says the otherOPENSHELL_TEST_*names are internal test hooks, and gives theOPENSHELL_TEST_<SERVICE>_PORTrule for ports the environment chooses (the test binds the port on every IPv4 host address; the host servers do not listen on IPv6). The runner-setOPENSHELL_GATEWAYandOPENSHELL_BINlink to testkit's docs.TESTING.mdlinks to it.roles/gateway_overrides: takesgateway_overrides_nameandgateway_overrides_contentand writes a marked block per name in/etc/openshell-test/gateway-overrides.toml, so writers keep each other's settings.gateway_overrides_state: absentremoves one name's block and keeps the rest. Content must start with a table header. When feat(gateway): merge drop-in configs over the base file #5489 lands, only this role changes. The installers skip an empty overrides file.The three override writers on
mainnow use the role:playbooks/drivers/podman/userns.yaml, thecdi_fixturesrole and theopenshell_external_driverrole. All three used to replace the whole file, and the external-driver role runs during install, after environment setup. The usernsdefaultmode now removes only its own block; it used to delete the whole file. test(conformance): run the conformance suite against a gateway that pushes configuration #5622 (config-push.yaml) and test(e2e): port Docker and Podman driver feature tests from e2e/rust #5695 (driver-config.yaml) switch to the role when they rebase.merge_gateway_toml_test.py: covers a file with several marked blocks, and two blocks that declare the same table, which fails.tests/support/host-serverTLS, built onopenshell-cryptoandtokio-rustls:TestCa::from_filesrejects a key that doesn't match the certificate.TestCa::new()makes a CA only the test knows.TestCa::from_env()loads the environment's additional CA from the files thatOPENSHELL_TEST_ADDITIONAL_CA_CERTandOPENSHELL_TEST_ADDITIONAL_CA_KEYname, and fails if either is unset.TestCa::from_filesandca.cert_pem()are also there.ca.leaf(&[names])returns anIdentity(certificate and key PEM). A name that parses as an IP address becomes an IP entry.HttpRecorder::serve_tls(&identity, handler)andstart_tls(&identity, body)are the TLS versions ofserveandstart. The connection code now takes any stream, so plain HTTP, TLS and the WebSocket recorder share it.HttpRecorder::builder()picks the port and TLS:.port(port)listens on a given port (a random free port stays the default), and.tls(&identity)serves TLS.start,serve,start_tlsandserve_tlsare shorthands for it. test(e2e): port corporate-proxy tests from e2e/rust to features/corporate-proxy #5730's bypass upstream bindsOPENSHELL_TEST_CORPORATE_PROXY_BYPASS_PORTthis way.tests/testkit: typedProfileandCredentialbuilders render provider YAML, andProviderBuildersets provider configuration without changing cleanup or how credentials are passed. Credential gating and Keycloak refresh use the new builders without changing their assertions. The provider and service-exposure ports stay in test(e2e): port provider tests from e2e/rust to testkit #5657.Testing
Testkit library tests (48 passed), plus locked Clippy and formatting across testkit, support, conformance, continuity, features, and Podman drivers on the combined head.
Live credential-gating and Keycloak refresh E2E on the combined head.
uv run --with pytest pytest tests/tmachine/ansible/roles/openshell_gateway/files/merge_gateway_toml_test.py(13 passed)ansible-playbook --syntax-checkondrivers/podman/userns.yaml,cdi.yaml,openshell-deb.yamlThe role and
drivers/podman/userns.yamlrun as root in a Linux container: blocks for several names coexist, re-writing a name replaces its block,defaultafterprivateremoves only the userns block,defaulton a fresh guest creates no file, and content without a table header failsExisting E2E rows (CDI, Podman userns, external driver) still pass: needs Branch E2E (
test:e2e)cargo test -p host-server-support(19 passed). The new TLS tests check that a client trusting the CA gets an answer by DNS name and by IP, that another name or another CA is rejected, thatfrom_envloads CA files and fails naming the missing variable, that a chosen port is used and a taken one fails naming it, that a CA key from another CA is rejected at load time, and that server certificates carry the authority key identifier (strict verifiers such as Python 3.13+ require it)cargo fmt --checkandcargo clippy --all-targets -D warningsontests/support,tests/suites/conformanceandtests/suites/features;check_cargo_lockfile_alignment.pyChecklist