Repository navigation
test(conformance): port sandbox lifecycle and API e2e tests to testkit - #5431
Open
matthewgrossman wants to merge 9 commits into
Open
matthewgrossman wants to merge 9 commits into
matthewgrossman wants to merge 9 commits into
Conversation
Member
Author
|
/ok to test c2eceee |
|
Label |
Member
Author
|
/ok to test 45180d0 |
Member
Author
|
/ok to test e3b0f27 |
Member
Author
|
/ok to test 73e5bff |
Member
Author
|
/ok to test caff38c |
Member
Author
|
/ok to test 2cefa9a |
matthewgrossman
force-pushed
the
test/5425-port-sandbox-lifecycle/matthewgrossman
branch
from
November 10, 2026 05:45
2cefa9a to
1ce77a5
Compare
matthewgrossman
changed the base branch from
main
to
test/5296-credential-gating-pilot/matthewgrossman
November 10, 2026 05:45
Member
Author
|
/ok to test 1ce77a5 |
|
🌿 Preview your docs: https://nvidia-preview-pr-5431.docs.buildwithfern.com/openshell |
7 tasks done
Base automatically changed from
test/5296-credential-gating-pilot/matthewgrossman
to
main
November 10, 2026 09:44
Move the driver-agnostic sandbox lifecycle, labels, templates, settings, image, process, Landlock and upload tests from e2e/rust to the conformance suite, the Podman OCI identity test to the podman driver suite, and the doctor, proxy-preflight and WebSocket tunnel checks to crate tests. Move the live-Internet benchmark to mise run perf:live-internet. Delete the legacy files and their references. Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
…d test image helpers Add cx.cli_sandbox (with policy files), ExecOutput::success, cx.sandbox_details, cx.wait_absent and Engine::build_test_image, use them in the ported lifecycle tests, and replace the duplicate policy file, sandbox get and test image code in the host-gateway, oci-image and podman suites. Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Replace hand-written exit-code checks in the smoke, lifecycle, persistent_workspace, file_transfer and policy_advisor suites. Polls and checks that expect a failure keep reading the exit code. Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
…e helpers Add SandboxBuilder::create_ready, ExecOutput::expect_stdout, Sandbox::poll_exec, Context::delete_and_expect_absent and testkit::with_deadline, and convert std::io::Error into testkit::Error so I/O results take .context directly. Use them across the conformance suite, which also gets shared template, global-setting and label-list helpers and a split on-failure restart poll. Make Engine::build_image private so callers go through build_test_image, which removes the image. Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
…proxy Replace the hand-written WebSocket bridge with openshell_sdk::edge_tunnel::start_tunnel_proxy, so the test covers the client half of the tunnel and its edge-token headers as well as the router. Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Move expect_listed, expect_absent, wait_absent and the CLI's sandbox get JSON (now get_json) from Context onto Sandbox, and drop delete_and_expect_absent. Give ExecOutput failure() and CliOutput expect_stdout(), so both outputs offer the same checks. Put with_deadline's description first, like poll_until. Make CliSandboxBuilder::run consume the builder like create, and rename its policy setter to policy_yaml. Update the testkit README's list of what a test can do. Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Replace CliSandboxBuilder's private PolicyFile with testkit::YamlFile, and drop YamlFile's map_err calls now that I/O errors convert into testkit::Error. CliOutput::success now includes stdout in its failure message, like ExecOutput::success, since many commands report errors there. Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
…ting changes Add SandboxBuilder::image and CliSandboxBuilder::create_ready, so both builders set an image and wait for Ready the same way. Convert tonic::Status into testkit::Error, keeping its code, so gRPC results take .context() directly, and drop Error::from_status. Create the host-gateway sandbox with cx.sandbox(..).image(..).policy(..) instead of a hand-written CLI create. In credential gating, use create_ready and poll_exec. Drop the remaining map_err calls on I/O results in host-server-support. Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
elezar
force-pushed
the
test/5425-port-sandbox-lifecycle/matthewgrossman
branch
from
November 10, 2026 10:44
1ce77a5 to
f8b1ced
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Moves the driver-agnostic sandbox lifecycle and API tests from
e2e/rustto testkit so they run on every conformance row, moves the rest to the podman driver suite or crate tests, and deletes the legacy files. PR1 of the #5297 plan.Related Issue
Closes #5425
Part of #5281
Changes
tests/suites/conformance/src/:image,labels,templates,settings,process,filesystem_policy. New tests inlifecycle.rsandfile_transfer.rs. The suite table intests/suites/conformance/README.mdis updated.tests/suites/drivers/podman/tests/oci_identity.rs: supervisor container identity and capabilities.crates/openshell-cli/tests/doctor_integration.rs(uses a fakedockeronPATH),crates/openshell-gateway/tests/proxy_config_preflight.rs, andproduction_gateway_listener_serves_grpc_through_websocket_tunnelincrates/openshell-server/src/lib.rs.mise run perf:live-internet(tasks/scripts/live_internet_perf.pydrives it, andlive_internet_perf_round.pyis the legacy benchmark body, moved unchanged apart from ruff fixes).CliOutput::message()moved fromfile_transfer.rsintotests/testkit/testkit/src/cli.rs.cx.cli_sandbox(suffix)→CliSandboxBuilder(.image(),.policy_yaml(yaml),.args(),.command();.create()detaches and adopts,.run()returns the attachedCliOutput). It tracks the sandbox before the CLI runs and passes--no-tty.SandboxBuilder::create_ready(): create, then wait for Ready.Sandbox:poll_exec(what, timeout, command, ready)reruns an exec every 250 ms untilreadyaccepts its output;get_json()issandbox get --output json;wait_absent(timeout)waits for the gateway to remove the sandbox by itself, then checks get and list.ExecOutputandCliOutput:success(),failure()andexpect_stdout(expected).ExecOutput.commandnames the exec in their messages, and a failedsuccess()reports stdout and stderr.testkit::YamlFile: YAML in a temporary.yamlfile for CLI commands that read one.CliSandboxBuilder::policy_yamluses it. It matches theYamlFilein test(conformance): port the credential gating e2e tests #5318.testkit::with_deadline(what, timeout, future): a named deadline shorter than a step's own.std::io::Errorconverts intotestkit::Error, so I/O results take.context()directly. The.map_err(Error::from_error)calls on I/O results in testkit,tests/supportand the features suites are gone.Engine::build_test_image(cx, name, containerfile)incontainer-engine-support: buildslocalhost/openshell-test-<name>:<run id>and removes it on cleanup.Engine::build_imageis now private, so callers can't skip the cleanup.cx.expect_listed(&sandbox, phase)andcx.expect_absent(&sandbox)are nowsandbox.expect_listed(phase)andsandbox.expect_absent(). The testkit README lists the current API.PolicyFilecopies and hand-writtensandbox create/sandbox getcalls inhost-gatewayandoci-image, the image build/cleanup inoci-imageand podmanoci_identity, and the create in podmanuserns.host-gatewaydrops itstempfiledependency andoci-imagedrops itsserde_jsondependency. The proposed CLI-delete cleanup helper was skipped because no test in this PR uses it.ExecOutput::success()also replaces the hand-written exit-code checks in the existingsmoke,lifecycle,persistent_workspace,file_transferandpolicy_advisorconformance tests. Polls and checks that expect a failure still readexit_code.templates.rs,settings.rsandlabels.rsalso get small local helpers (create_template,set_global_setting/delete_global_setting,listed_names).[[test]]entries,PODMAN_CI_TESTS,e2e-vm.sh,TESTING.md, and--enable-websocket-tunneline2e/with-{docker,podman}-gateway.sh, which onlyedge_tunnel_e2eused. Also removed the now-deadSandboxGuard::create_with_gateway_default.sandbox_lifecycle.rskeeps its other tests for PR4 (test(e2e): port CLI-driven exec, attach and SSH host identity tests from e2e/rust #5426). Whichever of PR1/PR4 merges last deletes it.docker_corporate_proxy.rsandvm_corporate_proxy.rs. Whichever of PR1/PR6 merges last deletesdocker_corporate_proxy.rs.vm_corporate_proxy.rsstays until PR9.Outcome per legacy test
sandbox_lifecycle::sandbox_stop_start_preserves_workspacepersistent_workspace_survives_stop_start. "Stop whileconnectis open" moves to PR4.sandbox_lifecycle::sandbox_can_be_deleted_while_stoppedlifecycle::stopped_sandbox_can_be_deletedsandbox_lifecycle::sandbox_exec_outlives_startup_recovery_deadlinelifecycle::exec_outlives_startup_recovery_deadlinesandbox_lifecycle::detached_canonical_main_{exit_zero_reaches_completed,nonzero_exit_reaches_error}lifecycle::main_exit_after_ready_sets_final_phasesandbox_lifecycle::canonical_main_and_exec_receive_declared_environment+canonical_tty_main_uses_sandbox_environmentlifecycle::canonical_main_environmentsandbox_lifecycle::detached_main_exit_during_provisioning_is_classified_as_workload_resultlifecycle::main_exit_during_provisioning_is_workload_resultsandbox_lifecycle::on_failure_policy_replaces_runtime_and_preserves_workspacelifecycle::on_failure_policy_restarts_main_and_keeps_workspaceephemeral_cleanup::detached_ephemeral_{success,failure}_removes_sandbox_and_driver_resourceslifecycle::detached_no_keep_sandbox_is_removed_after_main_exitslandlock::hard_requirement_accepts_enriched_device_pathfilesystem_policy::hard_requirement_accepts_added_device_pathslandlock::{best_effort,hard_requirement}_rejects_replaced_policy_{path,ancestor}(4)filesystem_policy::replaced_policy_path_rejects_next_launchcore_dump_hardening::sandbox_processes_disable_core_dumpsprocess::core_dumps_are_disableddefault_image::sandbox_from_default_imagelifecycle::default_command_sandbox_is_listed_readydefault_image::sandbox_from_explicit_nvidia_ubuntu_imageimage::explicit_image_is_usedsandbox_labels::sandbox_labels_are_stored_and_filterablelabels::labels_are_stored_and_filter_listsandbox_templates::sandbox_create_from_template_uses_reusable_workloadtemplates::sandbox_from_template_uses_its_workloadsandbox_templates::get-after-delete, duplicate name, missing template (3)templates::template_crud_errorssettings_management::settings_global_override_round_tripsettings::sandbox_setting_round_trip+settings::global_setting_overrides_sandbox_scopeupload_backpressure::large_upload_preserves_content_and_metadata_outside_workdirfile_transfer::large_upload_backpressure+ the outside-workdir metadata case infile_transferpodman_oci_identity::podman_supervisor_runs_as_oci_identity_without_capabilitiesdrivers/podmanoci_identity::supervisor_runs_as_oci_identity_without_capabilitiesdocker_preflight::doctor_check_fails_without_docker+doctor_check_output_shows_docker_labeldoctor_check_fails_without_docker_on_path(+doctor_check_fails_fast_when_docker_info_fails)docker_preflight::doctor_check_passes_with_dockerdoctor_check_passes_when_docker_info_succeedsdocker_preflight::doctor_check_error_includes_guidancedocker_corporate_proxy::…rejects_incoherent_configuration+vm_corporate_proxy::…rejects_incoherent_configurationproxy_config_preflight.rs(docker, podman, vm)docker_corporate_proxy::proxy_settings_are_inserted_before_nested_driver_tablesedge_tunnel_e2e::gateway_status_reports_healthyedge_tunnel_e2e::ws_tunnel_status_through_edge_proxyproduction_gateway_listener_serves_grpc_through_websocket_tunnelinternet_network_perf::benchmark_complete_internet_pathlive_internet_traffic_perf::benchmark_live_internet_agent_trafficmise run perf:live-internetDecisions and defaults applied
large_upload_backpressureruns on every conformance row.sandbox_setting_round_tripnow clears the global value first, as the legacy test did.openshell_sdk::edge_tunnel::start_tunnel_proxy, a newopenshell-serverdev-dependency) through the production listener,/_ws_tunnel, and the Health RPC. It fails when the tunnel is off.config preflight(category=malformed, file unchanged) and realopenshell-gateway --configstartup, because only startup names the offending keys.--policyYAML. Their policy sets noprocessidentity, so they run as the image'sUSER. The default test image has nosandboxuser. Rows without Landlock failhard_requirement, and they should.--no-keeptest releases both sandboxes before waiting, with a 60 s limit.Testing
mise run e2e:testkit(local Docker gateway): all 31 conformance tests pass. The lifecycle and settings suites were rerun after the timeout and settings fixes.ExecOutput::success()sweep: the full conformance suite on a Docker gateway, 31/31 (the#[ignore]d bug(sandbox): on Kubernetes, deleting a sandbox waits out the pods' termination grace period #5025 test is skipped, as on main)oci-imageandhost-gatewayfeature suites (7/7)cli,lifecycle,process,templates,image,filesystem_policy), plus theoci-imageandhost-gatewayfeature suites on a Docker gateway (7/7)cargo testfor the new crate tests on macOS:openshell-serverWebSocket tunnel test,doctor_integration,proxy_config_preflight-D warningsand fmt: openshell-server, -cli, -gateway, the conformance, podman and features suites,tests/support, testkit,e2e/rustmise run rust:lockfiles:checkruff check/formatfor the benchmark scripts. One direct-mode round of the benchmark ran.oci_identityanduserns(migrated to the helpers) on the userns rows: CIChecklist