Repository navigation
test(e2e): port provider tests from e2e/rust to testkit - #5657
matthewgrossman wants to merge 18 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. |
|
/ok to test b70615f |
|
Label |
|
/ok to test c7af9e2 |
|
/ok to test b9d5b3e |
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com> #5657 makes the same install_provider change in that file along with its typed profile, so this branch leaves it unchanged to avoid a conflict.
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com> #5657 makes the same install_provider change in that file along with its typed profile, so this branch leaves it unchanged to avoid a conflict.
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>
Move provider_files and provider_auto_create from e2e/rust into a providers conformance suite. The auto-create test imports a run-unique profile instead of relying on a globally imported claude-code profile, so it no longer changes shared gateway state. Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Requests go to the gateway's endpoint with the service URL's host as the Host header, which is how the gateway routes service traffic. Over TLS the client trusts the gateway CA and presents the registered gateway's client certificate, through openshell-crypto's rustls configuration. Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
… suite Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
…mage 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>
b9d5b3e to
b5ef866
Compare
|
/ok to test b5ef866 |
…er-tests/matthewgrossman Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
…lder::providers Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
|
/ok to test d79cc8a |
…-openshell#5691) * test(testkit): add providers, run_python, last_json, policy readers and binaries_yaml Shared helpers for suites that run client scripts in a sandbox: attach providers from the sandbox builder, run a Python script and read its JSON result, read a sandbox's policy revisions and active policy, and write a binaries list into hand-written policy YAML. Signed-off-by: Matthew Grossman <mgrossman@nvidia.com> * test(host-server): add TEST_HOST Signed-off-by: Matthew Grossman <mgrossman@nvidia.com> * test(support): add sandbox-clients crate with connect and http probes A shared home for the clients tests run inside a sandbox. One probe script connects, optionally sends bytes, and reads until the connection ends; connect(), http() and http_raw() run it and return typed results. HTTP parsing happens in Rust and is unit-tested. Requests send Connection: close by default, and raw sends stop after two idle seconds, so a keep-alive server can't stall a read. Signed-off-by: Matthew Grossman <mgrossman@nvidia.com> * test(features): use shared helpers in host-gateway The test uses TEST_HOST and the sandbox-clients http probe in place of its own Python client. Its main changes from sh -c "exec sleep infinity" to sleep infinity, which leaves the same final process. Signed-off-by: Matthew Grossman <mgrossman@nvidia.com> * test(suites): drop ready_sandbox wrappers and unify long-running commands Tests create a long-running sandbox with the builder chain directly instead of a per-file ready_sandbox helper. The cli and policy-advisor mains change from sh -c "exec sleep infinity" to sleep infinity, which leaves the same final process. connect-ssh-supervision keeps its sh -lc mains. Signed-off-by: Matthew Grossman <mgrossman@nvidia.com> * docs(testkit): list the shared sandbox helpers Signed-off-by: Matthew Grossman <mgrossman@nvidia.com> * test(suites): use shared sandbox and provider helpers in cli, cdi and keycloak tests The cli tests read sandbox get JSON through Sandbox::get_json, the cdi scenario creates its sandbox with cli_sandbox, and the keycloak refresh test installs its provider with install_provider instead of importing the profile and creating the provider by hand. Signed-off-by: Matthew Grossman <mgrossman@nvidia.com> * test: trim unit tests for the shared sandbox helpers The e2e suites exercise the helpers. Keep only the HTTP parser tests for chunked bodies and non-HTTP bytes, which no e2e test reaches yet. Signed-off-by: Matthew Grossman <mgrossman@nvidia.com> * test(features): leave the keycloak refresh test to ai-openshell#5657 Signed-off-by: Matthew Grossman <mgrossman@nvidia.com> ai-openshell#5657 makes the same install_provider change in that file along with its typed profile, so this branch leaves it unchanged to avoid a conflict. * test(testkit): fail early on sandbox names the gateway rejects The gateway limits sandbox names to 19 characters, which leaves 5 for a suffix after test-<run-id>-. cx.sandbox, cx.cli_sandbox and cx.track now panic at the test's call with that explanation, instead of the test failing later with the gateway's validation error. Context::name is unchanged, since provider and profile names have no such limit. Signed-off-by: Matthew Grossman <mgrossman@nvidia.com> * docs(testkit): document how to write a sandbox client The testkit README now explains why clients run in the sandbox, the contract a client script follows, and when a script moves to sandbox-clients. tcp_probe.py points to it, sandbox-clients says it holds network clients only, TESTING.md points Rust tests to run_python, and run_python suggests python_image() when the sandbox has no python3. Signed-off-by: Matthew Grossman <mgrossman@nvidia.com> * test(conformance): use the shared TEST_HOST in credential gating Signed-off-by: Matthew Grossman <mgrossman@nvidia.com> * fix(support): report DNS failures from the connect probe as dns, not errno Signed-off-by: Matthew Grossman <mgrossman@nvidia.com> * refactor(support): drop the unused is_dns_failure helper Signed-off-by: Matthew Grossman <mgrossman@nvidia.com> * refactor(support): parse HTTP replies with httparse Signed-off-by: Matthew Grossman <mgrossman@nvidia.com> * fix(support): report a stalled send from the connect probe as a timeout Signed-off-by: Matthew Grossman <mgrossman@nvidia.com> * docs(testkit): link the sandbox client guide and the server name limit Signed-off-by: Matthew Grossman <mgrossman@nvidia.com> --------- Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
…er-tests/matthewgrossman Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
|
/ok to test f468936 |
…er-tests/matthewgrossman Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
…file Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Compatibility review (advisory)New or updated breaking changes; see the full report for all findings. 1. configuration — No explicit risk acceptance foundRelease images and built-in runtime image defaults move from ghcr.io/nvidia/openshell to quay.io/ai-openshell without continued GHCR release/latest publication.
2. cli — No explicit risk acceptance foundStable and prerelease workflows previously updated Snap Store channels, but publish-snap and publish-prerelease-snap now unconditionally skip.
3. rust-sdk — No explicit risk acceptance foundThe exhaustive raw::proto::ProviderCredentialRefreshStrategy enum gains GithubAppInstallation beyond its baseline seven variants.
4. api-behavior — No explicit risk acceptance foundGateway mutation OCSF status_detail changes from rejected:<code>/error:<code> to an optional three-part value such as rejected:aborted:RESOURCE_VERSION_CONFLICT.
Review details
Advisory review; publication gates are unchanged. |
…er-tests/matthewgrossman Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Summary
Port the provider tests from
e2e/rustto testkit and delete the legacy files. The provider files and auto-create tests join the conformance suite. The service bearer passthrough test moves to a newfeatures/service-exposuresuite.Related Issue
Closes #5656
Part of #5281
Stack
Targets
main, which now includes #5691. The provider files test attaches its provider with #5691'sSandboxBuilder::providers(..), and the auto-create sandbox runssleep infinity. The other #5691 helpers don't apply: the service-exposure server is the sandbox's main process, which sandbox-clients probes can't be, and no test runs Python scripts, names the host gateway, or writes policy YAML by hand.Changes
create_providerandinstall_providerreturn aProviderBuilder. Chain.config(key, value)to pass--config; existing calls are unchanged.cx.service_get(url, headers)requests an exposed sandbox service through the gateway endpoint, with the service URL's authority asHost. It uses the gateway's mTLS bundle when the gateway has one, so tmachine environments need no extra routing.testkit::Profileandtestkit::Credentialbuild provider profiles in Rust instead offormat!YAML. Setters are named after the profile YAML fields, endpoints usepolicy::Endpoint(which gainsenforce()andpath()), andprofile.to_yaml()renders through openshell-providers, the CLI's export path. Unit tests compare built profiles with the YAML they name.Profile::file(path, env_var, content)setsfiles.providers.rsandfeatures/keycloak-provider-refreshuse it;credential_gating.rsis converted in test(e2e): port network, L7 and policy-update tests from e2e/rust to conformance #5665.providers.rsportsprovider_file_open_update_and_detachandauto_created_provider_credential_available_in_sandbox.service-exposurepackage withbearer_passthrough_preserves_authorization_header, plus rows in.github/workflows/e2e-suites.yml.provider_files.rs,provider_auto_create.rs,service_bearer_passthrough.rs, their[[test]]entries, theprovider_auto_createentry intests/tmachine/artifacts.nix, and the now-unusedrustlsandtokio-rustlse2e dependencies.Differences from the legacy tests
provider_filesran on Docker only, and tmachine lanes skippedprovider_auto_create. Service exposure runs on deb docker and rpm podman (rootful and rootless). Legacy ran it on Docker only. It doesn't run on k3s: since feat(helm)!: require opt-in for gateway service routing #5672 the Helm chart turns gateway service routing off, and tmachine's k3s installers can't turn it back on. The test passed on k3s and k3s-ha before feat(helm)!: require opt-in for gateway service routing #5672.providers/*.yamlglobally and usedclaude-code. The port imports its own run-unique profile and passes the credential through the CLI environment. That removes the global import that deferred this move in test(conformance): migrate workspace, upload, and template e2e tests #4246.examples/provider-managed-files/acme-config.yaml; the port builds the sameclient.tomlfile withtestkit::Profile, so the conformance suite doesn't depend on the examples folder. It keeps the legacy path,/run/openshell/providers/<provider>/client.toml, and every assertion.Testing
cargo fmt --checkandcargo clippy -D warningsfor testkit, conformance, features, ande2e/rustservicetestsfeatures/service-exposurerows, all threefeatures/keycloak-provider-refreshrows, and the legacy lanes in run 44773388355). The provider conformance tests pass locally against a Docker gateway.Checklist