Skip to content

Commit eef8bec

Browse files
authored
test(e2e): run podman suite with tmachine (NVIDIA#3637)
* test(e2e): remove superseded podman userns coverage Signed-off-by: Evan Lezar <elezar@nvidia.com> * test(tmachine): run podman e2e archive Signed-off-by: Evan Lezar <elezar@nvidia.com> * test(tmachine): generate podman e2e archive inventory Signed-off-by: Evan Lezar <elezar@nvidia.com> --------- Signed-off-by: Evan Lezar <elezar@nvidia.com>
1 parent 9f60f55 commit eef8bec

11 files changed

Lines changed: 317 additions & 315 deletions

File tree

‎.github/workflows/branch-e2e.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,7 @@ jobs:
261261
test-matrix: >-
262262
[
263263
{"environment":"fedora-podman-rootful","installer":"binaries","testsuite":"driver-podman"},
264+
{"environment":"fedora-podman-rootless","installer":"binaries","testsuite":"e2e-podman"},
264265
{"environment":"fedora-podman-rootless","installer":"binaries","testsuite":"driver-podman"}
265266
]
266267

‎.github/workflows/prepare-integration-inputs.yml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@ jobs:
106106
- name: Build test archives
107107
run: nix run .#build-artifacts-test-archives
108108

109+
- name: Build test workload images
110+
run: nix run .#build-artifacts-test-images
111+
109112
- name: Upload integration inputs
110113
id: upload-integration-inputs
111114
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1

‎TESTING.md‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,31 @@ Rust tests that still apply. Run the Podman-backed Rust CLI e2e suite:
254254
mise run e2e:podman
255255
```
256256

257+
Run the portable subset in a disposable rootless Podman guest:
258+
259+
```shell
260+
nix run .#build-artifacts
261+
nix run .#tmachine -- test fedora-podman-rootless binaries e2e-podman
262+
nix run .#tmachine -- test fedora-podman-rootless binaries driver-podman
263+
```
264+
265+
Print the exact tmachine archive selection as a shell `PODMAN_CI_TESTS` array:
266+
267+
```shell
268+
nix run .#generate-podman-e2e-ci-tests
269+
```
270+
271+
The `e2e-podman` testsuite runs a nextest archive built with the corresponding
272+
Rust feature and preloads its Python workload image into the rootless Podman
273+
store. The separate `driver-podman` testsuite compares OpenShell and direct
274+
Podman user-namespace mappings for the default, `auto`, `keep-id`, and private
275+
profiles. The E2E archive excludes binaries that still depend on wrapper-owned
276+
gateway controls, host fixtures, missing guest tools, or nondeterministic relay
277+
setup. The `driver-podman` suite replaces the removed `podman_userns` E2E
278+
binary. `tests/artifacts.nix` keeps the follow-up exclusions explicit and uses
279+
the same filter for the generated inventory, so excluded binaries cannot appear
280+
as false passes or silently re-enter the archive.
281+
257282
Run the VM-backed Rust CLI e2e suite:
258283

259284
```shell

‎e2e/rust/Cargo.toml‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,6 @@ name = "podman_resource_limits"
113113
path = "tests/podman_resource_limits.rs"
114114
required-features = ["e2e-podman"]
115115

116-
[[test]]
117-
name = "podman_userns"
118-
path = "tests/podman_userns.rs"
119-
required-features = ["e2e-podman"]
120-
121116
[[test]]
122117
name = "provider_refresh_handles"
123118
path = "tests/provider_refresh_handles.rs"

‎e2e/rust/tests/live_policy_update.rs‎

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ use openshell_e2e::harness::output::{extract_field, strip_ansi};
3232
use openshell_e2e::harness::sandbox::SandboxGuard;
3333
use tempfile::NamedTempFile;
3434

35+
const SPARSE_POLICY: &str = include_str!(concat!(
36+
env!("CARGO_MANIFEST_DIR"),
37+
"/../../examples/policy-advisor/sandbox-policy.yaml"
38+
));
39+
3540
// ---------------------------------------------------------------------------
3641
// Policy YAML builders
3742
// ---------------------------------------------------------------------------
@@ -126,6 +131,15 @@ landlock:
126131
Ok(file)
127132
}
128133

134+
fn write_sparse_policy() -> Result<NamedTempFile, String> {
135+
let mut file = NamedTempFile::new().map_err(|e| format!("create temp policy file: {e}"))?;
136+
file.write_all(SPARSE_POLICY.as_bytes())
137+
.map_err(|e| format!("write temp policy file: {e}"))?;
138+
file.flush()
139+
.map_err(|e| format!("flush temp policy file: {e}"))?;
140+
Ok(file)
141+
}
142+
129143
// ---------------------------------------------------------------------------
130144
// CLI helpers
131145
// ---------------------------------------------------------------------------
@@ -629,18 +643,18 @@ async fn live_policy_update_from_empty_network_policies() {
629643
/// no revision remaining `Pending` once the acknowledgement lands.
630644
#[tokio::test]
631645
async fn initial_sparse_policy_is_acknowledged_as_loaded() {
632-
// Repo-relative path to the sparse network-only policy fixture.
633-
let sparse_policy = concat!(
634-
env!("CARGO_MANIFEST_DIR"),
635-
"/../../examples/policy-advisor/sandbox-policy.yaml"
636-
);
646+
let sparse_policy = write_sparse_policy().expect("write sparse policy fixture");
647+
let sparse_policy_path = sparse_policy
648+
.path()
649+
.to_str()
650+
.expect("sparse policy path is not UTF-8");
637651

638652
let mut guard = SandboxGuard::create_keep_with_args(
639653
&[
640654
"--name",
641655
"e2e-sparse-enrich",
642656
"--policy",
643-
sparse_policy,
657+
sparse_policy_path,
644658
"--no-tty",
645659
],
646660
&["sh", "-c", "echo Ready && sleep infinity"],

0 commit comments

Comments
 (0)