Skip to content

test(suites): port the old suites onto testkit and run them from the plan - #4774

Draft
matthewgrossman wants to merge 8 commits into
test/3954-first-testkit-lane/matthewgrossmanfrom
test/3954-migrate-suites-to-testkit/matthewgrossman
Draft

matthewgrossman wants to merge 8 commits into
test/3954-first-testkit-lane/matthewgrossmanfrom
test/3954-migrate-suites-to-testkit/matthewgrossman

Conversation

@matthewgrossman

@matthewgrossman matthewgrossman commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

Summary

Ports the old conformance, oci-image, provider-refresh, and Podman userns suites onto testkit and adds the ones the runner can provision to the cpu-tests plan, so they run in Branch E2E through the plan. This is step 4 of the test harness plan, stacked on the plan-driven runner.

It adds the new suites without removing anything: the old suites, the hand-written release lanes, and the old crates are untouched. A later PR moves the release lanes onto plans and deletes the old suites once these have run green.

The sandbox-lifecycle, file-transfer, and policy-advisor ports start from @elezar's draft #4629.

Stack

Part of a stack of four; each PR targets the one below it. The tmachine move (#4726) has merged, so the stack uses its tests/tmachine/ paths.

  1. test(testkit): add the testkit library for end-to-end suites #4724: the testkit library.
  2. test(sandbox): run a testkit suite in Branch E2E #4822: the first testkit suite, run in Branch E2E against a Docker gateway. The simplest route to testkit tests in CI.
  3. feat(runner): add the test runner, plans and tmachine Session API, and run a plan on CI #4773: the test runner, plans, and tmachine Session API, with a plan running on CI.
  4. test(suites): port the old suites onto testkit and run them from the plan #4774: ports the old suites onto testkit and adds them to the plan.

Still to come, on top of #4774: moving the release lanes onto plans and deleting the old suites, once the plan has run the ported suites green.

Related Issue

Part of #3954

Changes

  • tests/suites/conformance/sandbox: test files lifecycle, cli, persistent_workspace, file_transfer, and policy_advisor next to the existing smoke. tests/suites/conformance/sandbox-image holds the oci-image port.
  • tests/suites/features: new crates providers (Keycloak provider refresh) and podman (user-namespace tests, with fixtures copied).
  • tests/plans/cpu-tests.yaml: the conformance suites on the Ubuntu rootful Docker environment, and oci-image there too. The runner passes OPENSHELL_TEST_CONTAINER_ENGINE through a new optional env: map in the environment YAML.
  • testkit helpers for sandboxes created through the CLI: cx.track, cx.track_sandbox, cx.adopt, cx.delete_sandboxes, and cx.cli_env.
  • persistent_workspace_survives_stop_start declares requires = [persistent_workspace]. mise run e2e:testkit sets OPENSHELL_TEST_CAPABILITIES for the Docker lane.
  • A tmachine test-tools.yaml playbook installs Git in the Docker environment, which the Git filtering test needs.
  • fmt and clippy for the new crates in Branch Checks and the mise tasks. The features workspace is now in the lockfile alignment check, which re-locks the old crates there too.

Old test to new test

conformance/cli (via crates/openshell-conformance)

Old New Notes
smoke (scenario smoke: status, create, get Ready, list, exec, delete, list empty) conformance/sandbox/tests/cli.rs::cli_create_exec_list_delete Same CLI steps and assertions. conformance/sandbox/tests/smoke.rs::create_exec_delete is the SDK variant (already in the base PR).
sandbox_lifecycle stop_start_preserves_workspace (stop, exec while stopped fails, start, workspace sentinel survives, main command re-runs) conformance/sandbox/tests/persistent_workspace.rs::persistent_workspace_survives_stop_start (SDK, requires = [persistent_workspace]) and conformance/sandbox/tests/cli.rs::cli_stop_start_delete (CLI: stop, exec rejected while stopped, start, stop, delete) The old scenario's workspace sentinel check is now the SDK test; the CLI commands are covered by the CLI test. Also lifecycle.rs::restart_stopped_sandbox.
sandbox_lifecycle stopped_can_be_deleted conformance/sandbox/tests/lifecycle.rs::stopped_sandbox_can_be_deleted (SDK) Also deleted through the CLI at the end of cli_stop_start_delete.
file_transfer::round_trip conformance/sandbox/tests/file_transfer.rs::upload_download_round_trip Includes upload into existing directories, symlinked and trailing-slash destinations, large binary, single file and directory download.
file_transfer::git_filtering conformance/sandbox/tests/file_transfer.rs::upload_respects_gitignore .gitignore filtering, single file from a Git repo, ignored-only selection rejected unless --no-git-ignore. Needs git on the test host.
file_transfer::path_safety conformance/sandbox/tests/file_transfer.rs::download_stays_inside_workspace Workspace-escape rejection and dash-leading names.
policy_advisor::policy_local conformance/sandbox/tests/policy_advisor.rs::policy_local_accepts_proposals
policy_advisor::mechanistic_proposal conformance/sandbox/tests/policy_advisor.rs::denied_address_produces_draft_rule
policy_advisor::new_hostname_proposal conformance/sandbox/tests/policy_advisor.rs::denied_hostname_produces_draft_rule

New with no old counterpart (from #4629, Evan Lezar): lifecycle.rs::long_running_exec_delete, run_to_completion_exit_delete, default_command_sandbox_is_listed_ready.

features/oci-image (6 tests, all in conformance/sandbox-image/tests/oci_image.rs, same names)

Old New
custom_workdir_with_named_user same name
custom_workdir_with_numeric_user_and_private_parents same name
userless_image_uses_default_identity same name
policy_identity_overrides_root_image_user same name
default_workdir_uses_managed_workspace same name
unwritable_custom_workdir_is_rejected same name

Moved from the OpenShellRunner helper to Context (cx.cli, cx.track_sandbox, cx.adopt, cx.delete_sandboxes). It reads the engine from OPENSHELL_TEST_CONTAINER_ENGINE. Dropped: reading OPENSHELL_BIN directly (testkit resolves the CLI itself).

features/provider-refresh/keycloak (1)

Old New Notes
revoked_refresh_grant_requires_user_reauthorization features/providers/tests/refresh_keycloak.rs::revoked_refresh_grant_requires_user_reauthorization Still #![cfg(target_os = "linux")]; uses cx.cli_env for secret-from-environment. Not in a plan (needs a Keycloak service on the guest).

drivers/podman (1 + 1 unit)

Old New Notes
configured_userns_matches_podman_reference features/podman/tests/default_userns.rs::configured_userns_matches_podman_reference Not in a plan (needs per-userns gateway reconfiguration and a reference UID map). Fixtures copied to features/podman/fixtures/.
unit test adjacent_uid_ranges_match_a_combined_mapping same name, same file (plain #[test]) Runs with cargo test -p podman.

Not ported

Nothing is dropped. The old crates and the openshell-conformance crate stay until the cutover PR; the diagnostics and per-step timeouts of OpenShellRunner are replaced by testkit's and nextest's (slow-timeout in the runner profile).

Not in the plan yet

  • Podman rpm environments (rootful and rootless): they ran the same tests in the old lane and are defined, but the runner has not run them on CI. Add them after a first run. They need Git from test-tools.yaml too.
  • k3s environments: the old lane verified that the Agent Sandbox controller reconciles before the tests (k3s-ready.yaml). The runner only waits for gateway health.
  • oci-image on Podman: needs the engine name (sudo -n podman or podman) and, for rootless, XDG_RUNTIME_DIR in the runner's session.
  • providers (Keycloak): needs the keycloak Ansible role and the three OPENSHELL_E2E_OIDC_* variables; the runner has no per-suite guest setup step.
  • podman (userns): needs the gateway reconfigured per userns mode and a reference UID map; the runner provisions one gateway configuration per environment.

Testing

  • Checks appropriate to the affected code and behavior pass
    • Against a local Docker gateway: the sandbox suites pass (15/15), oci-image passes (6/6), and the Keycloak refresh test passes (1/1, with its Linux-only gate lifted temporarily). fmt, clippy, the runner tests (59), and the lockfile and alignment checks pass. The plan dry run lists the expected tests, and the Nix outputs evaluate.
    • Not run: the new suites in a tmachine VM on CI, and anything on Podman. They need Branch E2E (test:e2e).
  • Unit tests added/updated
  • E2E tests added/updated

Checklist

  • Follows Conventional Commits
  • Commits are signed off (DCO)
  • Architecture docs updated (TESTING.md, tests/plans/README.md)

🤖 Generated with Claude Code

@copy-pr-bot

copy-pr-bot Bot commented Oct 20, 2026

Copy link
Copy Markdown

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.

@matthewgrossman
matthewgrossman added this pull request to stack #4776 October 20, 2026 23:38
@github-actions

Copy link
Copy Markdown

@copy-pr-bot

copy-pr-bot Bot commented Oct 21, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@matthewgrossman
matthewgrossman force-pushed the test/3954-migrate-suites-to-testkit/matthewgrossman branch 2 times, most recently from 6d64703 to e3d9f01 Compare October 21, 2026 20:40
@matthewgrossman
matthewgrossman force-pushed the test/3954-migrate-suites-to-testkit/matthewgrossman branch from e3d9f01 to 5e2cbc5 Compare October 21, 2026 20:49
@matthewgrossman
matthewgrossman force-pushed the test/3954-migrate-suites-to-testkit/matthewgrossman branch from 5e2cbc5 to cda205f Compare October 21, 2026 23:45
@matthewgrossman
matthewgrossman force-pushed the test/3954-migrate-suites-to-testkit/matthewgrossman branch from cda205f to 7c75fbf Compare October 22, 2026 04:51
@matthewgrossman
matthewgrossman removed this pull request from stack #4776 October 22, 2026 04:51
@matthewgrossman
matthewgrossman added this pull request to stack #4824 October 22, 2026 04:51
matthewgrossman and others added 8 commits October 21, 2026 22:07
…ed sandboxes

Add cx.cli_env and Cli::run_with for commands that read a secret from the environment, and cx.track, cx.track_sandbox, cx.adopt and cx.delete_sandboxes so tests that create sandboxes through the CLI still clean up after a failure.

Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
…isor and OCI image suites to testkit

Add the lifecycle, cli, persistent_workspace, file_transfer and policy_advisor test files to the sandbox crate and a sandbox-image crate for the OCI image suite. The lifecycle, file-transfer and policy-advisor tests are adapted from #4629. persistent_workspace_survives_stop_start requires the persistent_workspace capability. The old conformance/cli crate stays until the release lanes move to plans.

Co-authored-by: Evan Lezar <elezar@nvidia.com>
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
…suites to testkit

Add providers and podman crates beside the old feature crates. Enroll the features workspace in the lockfile alignment check, which also re-locks the old crates there. The old crates and their playbooks stay until the release lanes move to plans.

Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
…s capabilities

Format and lint the sandbox-image, providers and podman crates with the other testkit suites. The e2e:testkit task sets OPENSHELL_TEST_CAPABILITIES for a Docker gateway, since tests that declare requires read it.

Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
An environment's env field is passed to the test processes next to the variables the runner already sets. Docker environments use it to name the container engine for the OCI image suite.

Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
The file-transfer suite builds a Git repository on the machine that runs the tests, and the old conformance playbook installed Git itself.

Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Run the sandbox suites on rootful Docker and rootful and rootless Podman, and the OCI image suite on rootful Docker. Document the suites, the plan and what the Keycloak and Podman userns suites still need before they can join it.

Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Plan the ported conformance suites on the Ubuntu rootful Docker environment, the
one the runner has already run on CI, and install Git only there. The Podman rpm
environments are defined and noted in the plan; add them after a first run.

Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
@matthewgrossman
matthewgrossman force-pushed the test/3954-migrate-suites-to-testkit/matthewgrossman branch from 7c75fbf to bb39723 Compare October 22, 2026 05:29
@matthewgrossman matthewgrossman changed the title test(suites): move the conformance, oci-image, provider-refresh and podman suites to testkit test(suites): port the old suites onto testkit and run them from the plan Oct 22, 2026
@matthewgrossman
matthewgrossman removed this pull request from stack #4824 October 22, 2026 05:29
@matthewgrossman
matthewgrossman added this pull request to stack #4825 October 22, 2026 05:30

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant