Repository navigation
Commit eee2b9f
authored
test(conformance): port the credential gating e2e tests (#5318)
* feat(testkit): create a sandbox with a policy, an image, and providers
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
* test(conformance): port the credential gating e2e tests
Port the six credential gating scenarios from e2e/rust/tests/credential_gating.rs
into a conformance suite. Each test imports its own provider profile and
creates a provider under a run-unique name, creates sandboxes from the
Python test image through the CLI, and reaches probe servers on the host
through host.openshell.internal.
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
* test(e2e): provide the Python test image to host-lane conformance
The conformance suite now creates sandboxes from testkit::python_image().
Docker and Podman runners build openshell/e2e-python:dev also in
e2e-conformance-only mode, and the Kubernetes and VM runners default
OPENSHELL_TEST_PYTHON_IMAGE to the pullable uv Python image.
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
* test(e2e): remove the credential gating tests ported to conformance
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
* test(testkit): add policy helpers, provider install, and YAML files
Add testkit::policy (a base policy from base-policy.yaml, allow(), and
Endpoint settings), install_provider(), YamlFile, ExecOutput::success(),
and PYTHON_BINARIES, so suites build policies and providers the same way.
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
* test(support): add host servers that record what sandboxes send
Add host-server-support with HttpRecorder and WebSocketRecorder, servers on
the test host that sandboxes reach through host.openshell.internal. Move the
host-gateway feature test onto them and onto testkit's base policy.
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
* test(conformance): build credential gating on shared test support
Use testkit's policy helpers and install_provider and host-server-support's
recorders, and assert on the requests that reached the host server instead
of verdicts the sandbox clients print.
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
* fix(e2e): pass the host gateway IP to the external Kubernetes driver
The external-driver lane renders server.hostGatewayIP, but only the
in-process driver reads it from the gateway TOML. The standalone driver
takes OPENSHELL_HOST_GATEWAY_IP, which the post-renderer never set, so
sandbox policy DNS refused host.openshell.internal on that lane.
Copy the chart's rendered value into the driver container when present.
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
* test(testkit): default python_image() to a public pinned image
Conformance has to run against any gateway, and the unpublished
openshell/e2e-python:dev image only exists where a lane built or loaded
it. Default to the pinned uv Python image, which any gateway can pull,
and keep OPENSHELL_TEST_PYTHON_IMAGE as the override.
Host lanes no longer build the workload image for conformance. The base
test policy names no workload user, so drivers use a default non-root
user on images without one, and host_gateway runs python3 from PATH.
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
* test(conformance): tighten credential gating checks from review
- The WebSocket recorder reads frames until the connection ends, and the
test waits for that before checking that no binary frame arrived.
- The HTTP recorder keeps the request head and body apart. The REST tests
compare the body exactly and check the secret appears nowhere, and
failure messages redact it.
- testkit errors keep the gateway's gRPC status code, and the admission
test checks for FailedPrecondition.
- The policy create request destructures the SDK spec, so a new field
fails to compile instead of being dropped.
- host_gateway no longer retries its connection.
- Docs state that conformance requires sandboxes to reach the test
machine as host.openshell.internal.
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
* test(testkit): restore openshell/e2e-python:dev as the default test image
The tmachine installers load it and the Docker and Podman lanes build it,
so those lanes don't pull an image inside a test's timeout or lose curl,
git and openssl. The Kubernetes and VM lanes keep using the pinned public
image through OPENSHELL_TEST_PYTHON_IMAGE, and the base test policy names
the sandbox user again. Running conformance against any gateway without
an override is left to a follow-up.
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
* test(conformance): add a positive control to the WebSocket denial test
The test passed whenever no binary frame reached upstream, whatever the
reason. It now first sends the same frame from a sandbox without the
provider and requires that it arrives, so the denial check can fail.
Unit tests check that WebSocketRecorder sees a binary frame after a long
text frame, and none among text frames.
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
* docs(testing): link the remote-cluster follow-up for credential gating
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
* refactor(test-support): derive the WebSocket accept key with tungstenite
Use tungstenite's derive_accept_key instead of hashing with sha1 and
base64 directly, and split host-server into http.rs and websocket.rs.
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
* fix(e2e): fail the external-driver render when the host gateway alias is missing
The post-renderer copied the host gateway IP whenever the chart rendered
any hostAliases. It now matches the host.openshell.internal entry, and
fails if the lane set server.hostGatewayIP but no such entry rendered.
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
* test(testkit): split provider install into profile import and provider create
import_profile reads the profile's id from its YAML and returns it, and
create_provider takes the provider name and type separately, so the
provider name no longer has to match the profile id. install_provider
does both. Document that policy::allow merges binaries under one name
and that an override Python image must use a PYTHON_BINARIES path.
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
* refactor(testkit): make the provider helpers Context methods
testkit creates things through Context methods, such as cx.sandbox(..)
and cx.on_cleanup(..), so import_profile, create_provider and
install_provider become cx methods instead of free functions.
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
---------
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>1 parent f62fa13 commit eee2b9f
39 files changed
Lines changed: 2289 additions & 1244 deletions
File tree
- e2e
- helm-plugins/openshell-external-compute-driver
- host-gateway
- rust
- tests
- support
- tasks
- tests
- suites
- conformance
- src
- drivers/podman
- features
- host-gateway
- tests
- support
- host-server
- src
- testkit
- testkit
- src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
438 | 438 | | |
439 | 439 | | |
440 | 440 | | |
441 | | - | |
442 | | - | |
443 | | - | |
444 | | - | |
445 | | - | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
446 | 449 | | |
447 | 450 | | |
448 | 451 | | |
| |||
670 | 673 | | |
671 | 674 | | |
672 | 675 | | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
673 | 680 | | |
674 | 681 | | |
675 | 682 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
19 | 33 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
204 | 204 | | |
205 | 205 | | |
206 | 206 | | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | 207 | | |
213 | 208 | | |
214 | 209 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
58 | | - | |
59 | | - | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| 83 | + | |
83 | 84 | | |
84 | 85 | | |
85 | 86 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
29 | 28 | | |
30 | 29 | | |
31 | 30 | | |
| |||
117 | 116 | | |
118 | 117 | | |
119 | 118 | | |
120 | | - | |
121 | | - | |
122 | | - | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
123 | 122 | | |
124 | 123 | | |
125 | 124 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
463 | 463 | | |
464 | 464 | | |
465 | 465 | | |
466 | | - | |
| 466 | + | |
| 467 | + | |
467 | 468 | | |
468 | 469 | | |
469 | 470 | | |
| |||
0 commit comments