|
3 | 3 |
|
4 | 4 | #![cfg(feature = "e2e-podman")] |
5 | 5 |
|
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. |
8 | 8 | //! |
9 | 9 | //! 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`. |
15 | 17 |
|
16 | 18 | use std::process::Stdio; |
17 | 19 |
|
18 | 20 | use openshell_e2e::harness::container::{ContainerEngine, is_e2e_driver}; |
19 | | -use openshell_e2e::harness::output::strip_ansi; |
20 | 21 | use openshell_e2e::harness::sandbox::SandboxGuard; |
21 | 22 |
|
22 | 23 | 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() { |
199 | 200 | std::fs::write(policy.path(), OCI_FALLBACK_POLICY).expect("write OCI fallback policy"); |
200 | 201 | let policy_path = policy.path().to_str().expect("policy path is UTF-8"); |
201 | 202 | 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"], |
214 | 205 | READY_MARKER, |
215 | 206 | ) |
216 | 207 | .await |
217 | 208 | .expect("create sandbox from Podman-built OCI identity image"); |
218 | 209 |
|
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 | | - |
238 | 210 | let container_id = |
239 | 211 | sandbox_container_id(&image.engine, &sandbox.name).expect("find Podman sandbox container"); |
240 | 212 | let launched_image_id = run_engine( |
|
0 commit comments