Skip to content

Commit 82d8d1c

Browse files
test(podman): leave shared OCI identity checks to the oci-image suite
The oci-image feature suite covers the sandbox identity seen by the main process and sandbox exec on Docker and Podman. The Podman e2e keeps the checks only it can make: the pinned image ID and the isolated workload/supervisor container pair. Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
1 parent b67d006 commit 82d8d1c

1 file changed

Lines changed: 11 additions & 39 deletions

File tree

‎e2e/rust/tests/podman_oci_identity.rs‎

Lines changed: 11 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,21 @@
33

44
#![cfg(feature = "e2e-podman")]
55

6-
//! Podman-specific E2E coverage for OCI identity inspection and immutable-image
7-
//! launch.
6+
//! Podman-specific E2E coverage for immutable-image launch and the isolated
7+
//! workload/supervisor container pair.
88
//!
99
//! The test builds an image through the selected Podman engine, creates a
10-
//! sandbox from its mutable tag, and verifies both the child identity and the
11-
//! image ID recorded on the real sandbox container. This exercises the Podman
12-
//! API inspect → protected metadata → create path rather than only its unit
13-
//! serialization boundaries. Workspace behavior shared with Docker is covered
14-
//! by the `oci-image` feature suite in `tests/suites/features`.
10+
//! sandbox from its mutable tag, and inspects the real Podman containers: the
11+
//! image ID recorded on the workload, each container's user, the supervisor's
12+
//! capabilities, networking, and mounts. This exercises the Podman API
13+
//! inspect → protected metadata → create path rather than only its unit
14+
//! serialization boundaries. The sandbox identity and workspace seen by the
15+
//! main process and `sandbox exec` are shared with Docker and covered by the
16+
//! `oci-image` feature suite in `tests/suites/features`.
1517
1618
use std::process::Stdio;
1719

1820
use openshell_e2e::harness::container::{ContainerEngine, is_e2e_driver};
19-
use openshell_e2e::harness::output::strip_ansi;
2021
use openshell_e2e::harness::sandbox::SandboxGuard;
2122

2223
const BASE_IMAGE: &str = "nvcr.io/nvidia/base/ubuntu:24.04";
@@ -199,42 +200,13 @@ async fn podman_uses_oci_identity_and_inspected_image_id() {
199200
std::fs::write(policy.path(), OCI_FALLBACK_POLICY).expect("write OCI fallback policy");
200201
let policy_path = policy.path().to_str().expect("policy path is UTF-8");
201202
let mut sandbox = SandboxGuard::create_keep_with_args(
202-
&[
203-
"--from",
204-
&image.tag,
205-
"--policy",
206-
policy_path,
207-
"--no-tty",
208-
],
209-
&[
210-
"sh",
211-
"-c",
212-
"set -eu; printf 'direct-identity=%s:%s\n' \"$(id -u)\" \"$(id -g)\"; echo podman-oci-identity-ready; sleep infinity",
213-
],
203+
&["--from", &image.tag, "--policy", policy_path, "--no-tty"],
204+
&["sh", "-c", "echo podman-oci-identity-ready; sleep infinity"],
214205
READY_MARKER,
215206
)
216207
.await
217208
.expect("create sandbox from Podman-built OCI identity image");
218209

219-
let direct_output = strip_ansi(&sandbox.create_output);
220-
assert!(
221-
direct_output.contains("direct-identity=2345:2346"),
222-
"expected direct child identity {OCI_UID}:{OCI_GID}:\n{direct_output}"
223-
);
224-
225-
let ssh_output = sandbox
226-
.exec(&[
227-
"sh",
228-
"-c",
229-
"test \"$(id -u):$(id -g)\" = 2345:2346; echo podman-ssh-identity-ok",
230-
])
231-
.await
232-
.expect("SSH child should use Podman OCI identity");
233-
assert!(
234-
ssh_output.contains("podman-ssh-identity-ok"),
235-
"expected SSH identity marker:\n{ssh_output}"
236-
);
237-
238210
let container_id =
239211
sandbox_container_id(&image.engine, &sandbox.name).expect("find Podman sandbox container");
240212
let launched_image_id = run_engine(

0 commit comments

Comments
 (0)