Skip to content

Commit 8b678f2

Browse files
test(drivers/docker): add a Docker driver suite with stop-is-terminal and ephemeral cleanup
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
1 parent ce30b0f commit 8b678f2

12 files changed

Lines changed: 5048 additions & 15 deletions

File tree

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,7 @@ jobs:
294294
cargo fmt --manifest-path tests/tmachine/Cargo.toml --all -- --check
295295
cargo fmt --manifest-path tests/runner/Cargo.toml --all -- --check
296296
cargo fmt --manifest-path tests/suites/conformance/Cargo.toml --all -- --check
297+
cargo fmt --manifest-path tests/suites/drivers/docker/Cargo.toml --all -- --check
297298
cargo fmt --manifest-path tests/suites/drivers/podman/Cargo.toml --all -- --check
298299
cargo fmt --manifest-path tests/suites/features/Cargo.toml --all -- --check
299300
cargo fmt --manifest-path tests/support/Cargo.toml --all -- --check
@@ -359,6 +360,7 @@ jobs:
359360
cargo clippy --locked --manifest-path tests/tmachine/Cargo.toml --all-targets -- -D warnings
360361
cargo clippy --locked --manifest-path tests/runner/Cargo.toml --all-targets -- -D warnings
361362
cargo clippy --locked --manifest-path tests/suites/conformance/Cargo.toml --workspace --all-targets -- -D warnings
363+
cargo clippy --locked --manifest-path tests/suites/drivers/docker/Cargo.toml --workspace --all-targets -- -D warnings
362364
cargo clippy --locked --manifest-path tests/suites/drivers/podman/Cargo.toml --workspace --all-targets -- -D warnings
363365
cargo clippy --locked --manifest-path tests/suites/features/Cargo.toml --workspace --all-targets -- -D warnings
364366
cargo clippy --locked --manifest-path tests/support/Cargo.toml --all-targets -- -D warnings

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ jobs:
247247
set -euo pipefail
248248
# Retry dependency preparation, then build once.
249249
nix build --no-link .#openshell-test-runner || nix build --no-link .#openshell-test-runner
250-
for family in features drivers/podman; do
250+
for family in features drivers/docker drivers/podman; do
251251
nix run .#openshell-test-runner -- build \
252252
--family "$family" --out "artifacts/e2e-bundles/${family//\//-}"
253253
done
@@ -257,6 +257,12 @@ jobs:
257257
path: artifacts/e2e-bundles/features
258258
retention-days: 5
259259
if-no-files-found: error
260+
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
261+
with:
262+
name: openshell-e2e-bundle-drivers-docker-x86_64-unknown-linux-musl
263+
path: artifacts/e2e-bundles/drivers-docker
264+
retention-days: 5
265+
if-no-files-found: error
260266
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
261267
with:
262268
name: openshell-e2e-bundle-drivers-podman-x86_64-unknown-linux-musl

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
# results. With `prebuilt`, the rows run what the caller built once for the
1111
# run instead: conformance rows the static `openshell-conformance`, the other
1212
# rows their family's test bundle. The `family` input selects the rows of one
13-
# family, including the workspaces under it (drivers selects drivers/podman);
14-
# leave it empty to run every row.
13+
# family, including the workspaces under it (drivers selects drivers/docker
14+
# and drivers/podman); leave it empty to run every row.
1515

1616
name: E2E Suites
1717

@@ -111,6 +111,7 @@ jobs:
111111
{"environment":"ubuntu-docker-rootful","installer":"deb","family":"features","package":"connect-ssh-supervision","gateway":"openshell","runner":"ubuntu-24.04"},
112112
{"environment":"fedora-podman-rootful-keycloak","installer":"rpm","family":"features","package":"keycloak-provider-refresh","gateway":"openshell","runner":"ubuntu-24.04"},
113113
{"environment":"fedora-podman-rootless-keycloak","installer":"rpm","family":"features","package":"keycloak-provider-refresh","gateway":"openshell","runner":"ubuntu-24.04"},
114+
{"environment":"ubuntu-docker-rootful","installer":"deb","family":"drivers/docker","gateway":"openshell","runner":"ubuntu-24.04"},
114115
{"environment":"fedora-podman-rootful-userns-default","installer":"rpm","family":"drivers/podman","gateway":"openshell","runner":"ubuntu-24.04"},
115116
{"environment":"fedora-podman-rootful-userns-auto","installer":"rpm","family":"drivers/podman","gateway":"openshell","runner":"ubuntu-24.04"},
116117
{"environment":"fedora-podman-rootful-userns-keep-id","installer":"rpm","family":"drivers/podman","gateway":"openshell","runner":"ubuntu-24.04"},

‎.github/workflows/rust-cache.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ jobs:
9696
run: |
9797
set -euo pipefail
9898
nix build --no-link .#openshell-test-runner || nix build --no-link .#openshell-test-runner
99-
for family in features drivers/podman; do
99+
for family in features drivers/docker drivers/podman; do
100100
nix run .#openshell-test-runner -- build \
101101
--family "$family" --out "$RUNNER_TEMP/e2e-bundles/${family//\//-}"
102102
done

‎CI.md‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -176,11 +176,11 @@ selected. DEB and RPM packages build only when integration qualification is sele
176176
the DEB on Ubuntu with Docker and installs the CLI and gateway RPMs on Fedora with
177177
rootful and rootless Podman. These lanes run conformance using the matching runtime
178178
images. Release Dev, Release, and Pre-release use the same package installers.
179-
The feature suites (`tests/suites/features`) and the Podman driver suite
180-
(`tests/suites/drivers/podman`) run the same way, on the package installers; the
181-
driver suite's environments merge their Podman settings into the packaged
182-
gateway's configuration (see `TESTING.md`). The `e2e-podman` lane runs on the
183-
RPM installer as well. The driver suite and `e2e-podman` run
179+
The feature suites (`tests/suites/features`) and the Docker and Podman driver
180+
suites (`tests/suites/drivers/{docker,podman}`) run the same way, on the package
181+
installers; the Podman driver suite's environments merge their Podman settings
182+
into the packaged gateway's configuration (see `TESTING.md`). The `e2e-podman`
183+
lane runs on the RPM installer as well. The driver suites and `e2e-podman` run
184184
only in `Branch E2E Checks`. The manual Integration Tests workflow runs the
185185
remaining tmachine testsuites, such as `e2e-podman`, and downloads the packages
186186
selected by its matrix.

‎TESTING.md‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -581,9 +581,12 @@ Driver suites live in `tests/suites/drivers/<driver>`, with the package named
581581
after the driver. Each driver suite is its own workspace with its own lockfile,
582582
so a change to one driver's tests or dependencies doesn't touch another's. Add
583583
a new one to the `rust:format`, `rust:format:check` and `rust:lint` tasks, the
584-
matching lines in `branch-checks.yml`, and `ALIGNED_WORKSPACES`. The Podman
585-
driver suite (`tests/suites/drivers/podman`) compares OpenShell and direct
586-
Podman user-namespace mappings.
584+
matching lines in `branch-checks.yml`, `ALIGNED_WORKSPACES`, and the bundle
585+
builds in `branch-e2e.yml` and `rust-cache.yml`. The Docker and Podman driver
586+
suites (`tests/suites/drivers/{docker,podman}`) check what the driver does with
587+
a sandbox's containers when its workload stops or an ephemeral sandbox
588+
finishes. The Podman suite also compares OpenShell and direct Podman
589+
user-namespace mappings.
587590
Each `fedora-podman-{rootful,rootless}-userns-<mode>` environment configures
588591
the gateway with one mode (`default`, `auto`, `keep-id` or `private`) and works
589592
with every installer; CI runs it with `rpm`:

‎tasks/rust.toml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ run = [
4040
"cargo clippy --manifest-path tests/tmachine/Cargo.toml --all-targets -- -D warnings",
4141
"cargo clippy --manifest-path tests/runner/Cargo.toml --all-targets -- -D warnings",
4242
"cargo clippy --manifest-path tests/suites/conformance/Cargo.toml --workspace --all-targets -- -D warnings",
43+
"cargo clippy --manifest-path tests/suites/drivers/docker/Cargo.toml --workspace --all-targets -- -D warnings",
4344
"cargo clippy --manifest-path tests/suites/drivers/podman/Cargo.toml --workspace --all-targets -- -D warnings",
4445
"cargo clippy --manifest-path tests/suites/features/Cargo.toml --workspace --all-targets -- -D warnings",
4546
"cargo clippy --manifest-path tests/support/Cargo.toml --all-targets -- -D warnings",
@@ -59,6 +60,7 @@ run = [
5960
"cargo fmt --manifest-path tests/tmachine/Cargo.toml --all",
6061
"cargo fmt --manifest-path tests/runner/Cargo.toml --all",
6162
"cargo fmt --manifest-path tests/suites/conformance/Cargo.toml --all",
63+
"cargo fmt --manifest-path tests/suites/drivers/docker/Cargo.toml --all",
6264
"cargo fmt --manifest-path tests/suites/drivers/podman/Cargo.toml --all",
6365
"cargo fmt --manifest-path tests/suites/features/Cargo.toml --all",
6466
"cargo fmt --manifest-path tests/support/Cargo.toml --all",
@@ -77,6 +79,7 @@ run = [
7779
"cargo fmt --manifest-path tests/tmachine/Cargo.toml --all -- --check",
7880
"cargo fmt --manifest-path tests/runner/Cargo.toml --all -- --check",
7981
"cargo fmt --manifest-path tests/suites/conformance/Cargo.toml --all -- --check",
82+
"cargo fmt --manifest-path tests/suites/drivers/docker/Cargo.toml --all -- --check",
8083
"cargo fmt --manifest-path tests/suites/drivers/podman/Cargo.toml --all -- --check",
8184
"cargo fmt --manifest-path tests/suites/features/Cargo.toml --all -- --check",
8285
"cargo fmt --manifest-path tests/support/Cargo.toml --all -- --check",

‎tasks/scripts/check_cargo_lockfile_alignment.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
"tests/support",
3939
"tests/testkit",
4040
"tests/suites/conformance",
41+
"tests/suites/drivers/docker",
4142
"tests/suites/drivers/podman",
4243
"tests/suites/features",
4344
)

‎tests/suites/conformance/src/lifecycle.rs‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -395,9 +395,11 @@ const EPHEMERAL_CLEANUP_TIMEOUT: Duration = Duration::from_secs(60);
395395
/// command exits, whether the command succeeds or fails.
396396
///
397397
/// This checks only what the gateway shows: get and list stop returning the
398-
/// sandbox. Conformance can't see driver resources, so the check that the
399-
/// driver removed its containers, pods or VM state stays in the legacy
400-
/// `e2e/rust/tests/ephemeral_cleanup.rs` until the driver suites replace it.
398+
/// sandbox. Conformance can't see driver resources: the Docker and Podman
399+
/// driver suites (`tests/suites/drivers/{docker,podman}`) check that the
400+
/// driver removed its containers, and the legacy
401+
/// `e2e/rust/tests/ephemeral_cleanup.rs` still checks Kubernetes pods and VM
402+
/// state.
401403
#[testkit::test]
402404
async fn detached_no_keep_sandbox_is_removed_after_main_exits(cx: &mut Context) -> testkit::Result {
403405
let mut sandboxes = Vec::new();

0 commit comments

Comments
 (0)