Skip to content

Commit f4004a2

Browse files
committed
test(features): add the CDI suite with the read-only baseline scenario
Add the cdi features package, which creates a sandbox that selects one CDI scenario device on the gateway's Docker or Podman compute driver and checks what the workload sees against the scenario's published expectations. The first test covers a mount under a directory the sandbox already makes read-only, and the merge of spec and device edits. Run the suite in ubuntu-docker-rootful-cdi with the deb installer, and in fedora-podman-rootful-cdi and fedora-podman-rootless-cdi with the rpm installer. Signed-off-by: Evan Lezar <elezar@nvidia.com>
1 parent 79c8085 commit f4004a2

7 files changed

Lines changed: 683 additions & 5 deletions

File tree

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ jobs:
7373
{"environment":"fedora-podman-rootless","installer":"rpm","family":"conformance","package":"conformance","gateway":"openshell","runner":"ubuntu-24.04"},
7474
{"environment":"ubuntu-k3s","installer":"k3s","family":"conformance","package":"conformance","gateway":"tmachine","runner":"ubuntu-24.04"},
7575
{"environment":"ubuntu-k3s","installer":"k3s-ha","family":"conformance","package":"conformance","gateway":"tmachine","runner":"ubuntu-24.04"},
76+
{"environment":"ubuntu-docker-rootful-cdi","installer":"deb","family":"features","package":"cdi","gateway":"openshell","runner":"ubuntu-24.04"},
77+
{"environment":"fedora-podman-rootful-cdi","installer":"rpm","family":"features","package":"cdi","gateway":"openshell","runner":"ubuntu-24.04"},
78+
{"environment":"fedora-podman-rootless-cdi","installer":"rpm","family":"features","package":"cdi","gateway":"openshell","runner":"ubuntu-24.04"},
7679
{"environment":"ubuntu-docker-rootful-keycloak","installer":"deb","family":"features","package":"keycloak-provider-refresh","gateway":"openshell","runner":"ubuntu-24.04"},
7780
{"environment":"ubuntu-docker-rootful","installer":"deb","family":"features","package":"oci-image","gateway":"openshell","runner":"ubuntu-24.04"},
7881
{"environment":"fedora-podman-rootful","installer":"rpm","family":"features","package":"oci-image","gateway":"openshell","runner":"ubuntu-24.04"},

‎TESTING.md‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -318,11 +318,13 @@ nix run .#openshell-test-runner -- \
318318
```
319319

320320
A suite that needs setup beyond a container engine runs in a feature
321-
environment, named `<base>-<feature>`, such as `ubuntu-docker-rootful-keycloak`. `features` in `tests/tmachine/config.nix`
322-
lists each feature's setup playbooks, the inputs they read, and the bases it
323-
supports.
321+
environment, named `<base>-<feature>`, such as `ubuntu-docker-rootful-keycloak`
322+
or `ubuntu-docker-rootful-cdi`. `features` in `tests/tmachine/config.nix` lists
323+
each feature's setup playbooks, the inputs they read, and the bases it supports.
324324
To add one, add an entry there and use the generated environment name in the
325-
suite's row in `.github/workflows/e2e-suites.yml`.
325+
suite's row in `.github/workflows/e2e-suites.yml`. The CDI suite
326+
(`tests/suites/features/cdi`) runs in `ubuntu-docker-rootful-cdi`, which creates
327+
hardware-free CDI devices and the host files they reference.
326328

327329
### Python E2E (`e2e/python/`)
328330

‎tests/suites/features/Cargo.lock‎

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎tests/suites/features/Cargo.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33

44
[workspace]
55
resolver = "2"
6-
members = ["keycloak-provider-refresh", "kubernetes-updates", "oci-image"]
6+
members = ["cdi", "keycloak-provider-refresh", "kubernetes-updates", "oci-image"]
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
[package]
5+
name = "cdi"
6+
description = "Features suite: CDI device injection"
7+
version = "0.0.0"
8+
edition = "2024"
9+
rust-version = "1.94"
10+
license = "Apache-2.0"
11+
repository = "https://github.com/NVIDIA/OpenShell"
12+
publish = false
13+
14+
[dependencies]
15+
openshell-testkit = { path = "../../../testkit/testkit" }
16+
serde_json = "1"

0 commit comments

Comments
 (0)