Skip to content

Commit 0ff81fa

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 75ec2cd commit 0ff81fa

7 files changed

Lines changed: 780 additions & 5 deletions

File tree

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ jobs:
8080
{"environment":"fedora-podman-rootless","installer":"rpm","family":"conformance","package":"conformance","gateway":"openshell","runner":"ubuntu-24.04"},
8181
{"environment":"ubuntu-k3s","installer":"k3s","family":"conformance","package":"conformance","gateway":"tmachine","runner":"ubuntu-24.04"},
8282
{"environment":"ubuntu-k3s","installer":"k3s-ha","family":"conformance","package":"conformance","gateway":"tmachine","runner":"ubuntu-24.04"},
83+
{"environment":"ubuntu-docker-rootful-cdi","installer":"deb","family":"features","package":"cdi","gateway":"openshell","runner":"ubuntu-24.04"},
84+
{"environment":"fedora-podman-rootful-cdi","installer":"rpm","family":"features","package":"cdi","gateway":"openshell","runner":"ubuntu-24.04"},
85+
{"environment":"fedora-podman-rootless-cdi","installer":"rpm","family":"features","package":"cdi","gateway":"openshell","runner":"ubuntu-24.04"},
8386
{"environment":"ubuntu-docker-rootful-keycloak","installer":"deb","family":"features","package":"keycloak-provider-refresh","gateway":"openshell","runner":"ubuntu-24.04"},
8487
{"environment":"ubuntu-docker-rootful","installer":"deb","family":"features","package":"oci-image","gateway":"openshell","runner":"ubuntu-24.04"},
8588
{"environment":"fedora-podman-rootful","installer":"rpm","family":"features","package":"oci-image","gateway":"openshell","runner":"ubuntu-24.04"},

‎TESTING.md‎

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -332,11 +332,19 @@ nix run .#openshell-test-runner -- run \
332332
```
333333

334334
A suite that needs setup beyond a container engine runs in a feature
335-
environment, named `<base>-<feature>`, such as `ubuntu-docker-rootful-keycloak`. `features` in `tests/tmachine/config.nix`
336-
lists each feature's setup playbooks, the inputs they read, and the bases it
337-
supports.
335+
environment, named `<base>-<feature>`, such as `ubuntu-docker-rootful-keycloak`
336+
or `ubuntu-docker-rootful-cdi`. `features` in `tests/tmachine/config.nix` lists
337+
each feature's setup playbooks, the inputs they read, and the bases it supports.
338338
To add one, add an entry there and use the generated environment name in the
339-
suite's row in `.github/workflows/e2e-suites.yml`.
339+
suite's row in `.github/workflows/e2e-suites.yml`. The CDI suite
340+
(`tests/suites/features/cdi`) runs in `ubuntu-docker-rootful-cdi`, which creates
341+
hardware-free CDI devices and the host files they reference. The environment
342+
tells the suite where its scenarios are with `OPENSHELL_TEST_CDI_SCENARIOS`, the
343+
path of a document that names the device kind, each scenario and the checks it
344+
expects. Any environment that creates matching devices and sets the variable
345+
can run the suite. The expectations characterize the sandbox's behavior today,
346+
not a specification, and the `echo-socket` check needs `perl` in the workload
347+
image, which the default image has.
340348

341349
### Python E2E (`e2e/python/`)
342350

‎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 = ["host-gateway", "keycloak-provider-refresh", "kubernetes-updates", "oci-image"]
6+
members = ["cdi", "host-gateway", "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)