Skip to content

Commit 9311e8b

Browse files
committed
test(e2e): add rootless podman nix vm lane
Signed-off-by: Evan Lezar <elezar@nvidia.com>
1 parent 9f88f8f commit 9311e8b

12 files changed

Lines changed: 192 additions & 41 deletions

File tree

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

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,54 @@ jobs:
129129
OPENSHELL_MCP_CONFORMANCE_CLIENT_IMAGE: ${{ format('openshell-mcp-conformance-client:{0}', inputs.image-tag) }}
130130
run: ${{ matrix.cmd }}
131131

132+
e2e-podman-rootless:
133+
name: E2E (rust-podman-rootless, Ubuntu 26.04 Nix VM)
134+
# Run rootless Podman inside a Nix-managed Ubuntu guest so Podman, pasta,
135+
# and user-namespace setup are provisioned by versioned repository tooling
136+
# rather than mutable hosted-runner packages.
137+
runs-on: ubuntu-26.04
138+
timeout-minutes: 60
139+
env:
140+
MISE_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
141+
steps:
142+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
143+
with:
144+
ref: ${{ inputs['checkout-ref'] || github.sha }}
145+
persist-credentials: false
146+
147+
- uses: cachix/install-nix-action@13d8dd58da0234aa297dedd986986ccb8e7f3e24 # v31.11.1
148+
with:
149+
github_access_token: ${{ secrets.GITHUB_TOKEN }}
150+
151+
- uses: cachix/cachix-action@5f2d7c5294214f71b873db4b969586b980625e71 # v17
152+
with:
153+
name: openshell
154+
155+
- name: Install mise
156+
run: |
157+
curl https://mise.run | MISE_VERSION=v2026.4.25 sh
158+
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
159+
echo "$HOME/.local/share/mise/shims" >> "$GITHUB_PATH"
160+
161+
- name: Install tools
162+
run: mise install --locked
163+
164+
- name: Install system dependencies
165+
run: |
166+
sudo apt-get update
167+
sudo apt-get install -y --no-install-recommends \
168+
build-essential \
169+
clang \
170+
cmake \
171+
libclang-dev \
172+
libssl-dev \
173+
libz3-dev \
174+
openssh-client \
175+
pkg-config
176+
177+
- name: Run rootless Podman E2E
178+
run: mise run --no-deps --skip-deps e2e:podman:rootless
179+
132180
e2e-vm:
133181
name: E2E (rust-vm-${{ matrix.suite }})
134182
# libkrun needs KVM, so this job must run directly on a GitHub-hosted

‎TESTING.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,12 @@ Run the Podman-backed Rust CLI e2e suite:
175175
mise run e2e:podman
176176
```
177177

178+
Run the rootless Podman smoke suite in an Ubuntu 26.04 Nix test guest:
179+
180+
```shell
181+
mise run e2e:podman:rootless
182+
```
183+
178184
Run the VM-backed Rust CLI e2e suite:
179185

180186
```shell

‎e2e/run.sh‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ if [ -n "${vm}" ] || [ "${#with_configurations[@]}" -gt 0 ]; then
158158
if [ "${gateway_driver}" = podman ]; then
159159
vm=fedora
160160
else
161-
vm=ubuntu
161+
vm=ubuntu-24-04
162162
fi
163163
fi
164164
fi
@@ -171,8 +171,8 @@ if [ "${mode}" = vm ]; then
171171
die "invalid VM configuration name: ${configuration}"
172172
fi
173173
done
174-
if [ "${gateway_driver}" = podman ] && [ "${vm}" = ubuntu ]; then
175-
die "the Ubuntu 24.04 guest lacks the Podman 5 pasta helper required for sandbox callbacks; use --vm fedora --with podman"
174+
if [ "${gateway_driver}" = podman ] && [ "${vm}" = ubuntu-24-04 ]; then
175+
die "the Ubuntu 24.04 guest lacks the Podman 5 pasta helper required for sandbox callbacks; use --vm ubuntu-26-04 --with podman"
176176
fi
177177
if ! command -v nix >/dev/null 2>&1; then
178178
die "Nix is required for VM mode"
@@ -231,14 +231,14 @@ target_dir="$(e2e_cargo_target_dir "${ROOT}" mise x -- cargo)"
231231
ensure_build_nofile_limit
232232
233233
echo "==> Building native host openshell CLI"
234-
mise x -- cargo build "${cargo_jobs[@]}" -p openshell-cli --bin openshell
234+
mise x -- cargo build "${cargo_jobs[@]+"${cargo_jobs[@]}"}" -p openshell-cli --bin openshell
235235
host_cli_bin="${target_dir}/debug/openshell"
236236
237237
echo "==> Preparing ${linux_musl_target} build target"
238238
mise x -- rustup target add "${linux_musl_target}" >/dev/null
239239
240240
echo "==> Building Linux openshell-sandbox (${linux_musl_target})"
241-
mise x -- cargo zigbuild "${cargo_jobs[@]}" \
241+
mise x -- cargo zigbuild "${cargo_jobs[@]+"${cargo_jobs[@]}"}" \
242242
--release \
243243
--target "${linux_musl_target}" \
244244
-p openshell-sandbox \
@@ -249,7 +249,7 @@ host_gateway_bin=
249249
guest_gateway_bin=
250250
if [ "${mode}" = host ]; then
251251
echo "==> Building native host openshell-gateway"
252-
mise x -- cargo build "${cargo_jobs[@]}" \
252+
mise x -- cargo build "${cargo_jobs[@]+"${cargo_jobs[@]}"}" \
253253
-p openshell-server \
254254
--bin openshell-gateway \
255255
--features bundled-z3
@@ -265,7 +265,7 @@ else
265265
"${linux_gateway_zig_target}" \
266266
"${target_dir}/zig-gnu-wrapper/e2e"
267267
)"
268-
mise x -- cargo zigbuild "${cargo_jobs[@]}" \
268+
mise x -- cargo zigbuild "${cargo_jobs[@]+"${cargo_jobs[@]}"}" \
269269
--release \
270270
--target "${linux_gateway_zig_target}" \
271271
-p openshell-server \

‎nix/test-guest/README.md‎

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,14 @@ nix/test-guest/
3333
├── cache-lib.sh
3434
├── cache-seal.sh
3535
├── distros/
36-
│ ├── ubuntu.nix
36+
│ ├── ubuntu-24-04.nix
37+
│ ├── ubuntu-26-04.nix
3738
│ ├── centos.nix
3839
│ ├── fedora.nix
3940
│ └── rocky.nix
4041
└── configuration/
4142
├── docker.yml
43+
├── podman-rootless.yml
4244
├── podman.yml
4345
└── selinux.yml
4446
```
@@ -56,17 +58,18 @@ The root [`flake.nix`](../../flake.nix) exposes this directory as the `test-gues
5658

5759
## Supported configurations
5860

59-
| Distro | Docker | Podman | SELinux | Package format |
60-
| --- | --- | --- | --- | --- |
61-
| Ubuntu 24.04 | Yes | Yes | No | `.deb` |
62-
| CentOS Stream 10 | No | Yes | Yes | `.rpm` |
63-
| Fedora 44 | No | Yes | Yes | `.rpm` |
64-
| Rocky Linux 9 | Yes | Yes | Yes | `.rpm` |
61+
| Distro | Docker | Podman | Rootless Podman | SELinux | Package format |
62+
| --- | --- | --- | --- | --- | --- |
63+
| Ubuntu 24.04 | Yes | Yes | No | No | `.deb` |
64+
| Ubuntu 26.04 | Yes | Yes | Yes | No | `.deb` |
65+
| CentOS Stream 10 | No | Yes | No | Yes | `.rpm` |
66+
| Fedora 44 | No | Yes | No | Yes | `.rpm` |
67+
| Rocky Linux 9 | Yes | Yes | No | Yes | `.rpm` |
6568

6669
The Ubuntu 24.04 Podman configuration is available for runtime and packaging
6770
checks, but its Podman 4 release does not provide the `pasta` rootless network
68-
helper required by OpenShell sandbox callbacks. OpenShell Podman E2E runs use
69-
the Fedora guest, which provides Podman 5 and `pasta`.
71+
helper required by OpenShell sandbox callbacks. Rootless Podman E2E uses the
72+
Ubuntu 26.04 guest with `--with podman-rootless`.
7073

7174
List the available distros and configurations:
7275

@@ -79,13 +82,13 @@ nix run .#test-guest -- --list
7982
Boot a base Ubuntu VM:
8083

8184
```shell
82-
nix run .#test-guest -- --distro ubuntu
85+
nix run .#test-guest -- --distro ubuntu-24-04
8386
```
8487

8588
Apply the Docker configuration before opening the SSH session:
8689

8790
```shell
88-
nix run .#test-guest -- --distro ubuntu --with docker
91+
nix run .#test-guest -- --distro ubuntu-24-04 --with docker
8992
```
9093

9194
Other combinations use the same interface:
@@ -94,13 +97,14 @@ Other combinations use the same interface:
9497
nix run .#test-guest -- --distro rocky --with docker
9598
nix run .#test-guest -- --distro centos --with podman
9699
nix run .#test-guest -- --distro fedora --with podman
100+
nix run .#test-guest -- --distro ubuntu-26-04 --with podman-rootless
97101
```
98102

99103
Configurations are repeatable:
100104

101105
```shell
102106
nix run .#test-guest -- \
103-
--distro ubuntu \
107+
--distro ubuntu-24-04 \
104108
--with docker \
105109
--with podman
106110
```
@@ -131,7 +135,7 @@ The `test-guest-cache` app ensures a prepared disk exists for one exact distro,
131135

132136
```shell
133137
nix run .#test-guest-cache -- \
134-
--distro ubuntu \
138+
--distro ubuntu-24-04 \
135139
--with docker
136140
```
137141

@@ -140,7 +144,7 @@ backing cache:
140144

141145
```shell
142146
nix run .#test-guest-cache -- \
143-
--distro ubuntu \
147+
--distro ubuntu-24-04 \
144148
--with docker \
145149
--repository ghcr.io/nvidia/openshell/test-guest-cache \
146150
--digest sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef
@@ -150,7 +154,7 @@ The command never publishes implicitly. Add `--push` after authenticating ORAS t
150154

151155
```shell
152156
nix run .#test-guest-cache -- \
153-
--distro ubuntu \
157+
--distro ubuntu-24-04 \
154158
--with docker \
155159
--repository ghcr.io/nvidia/openshell/test-guest-cache \
156160
--push
@@ -177,7 +181,7 @@ The default cache directory is `${XDG_CACHE_HOME:-$HOME/.cache}/openshell/test-g
177181
Cache command options:
178182

179183
```text
180-
--distro NAME Base distro: ubuntu, centos, fedora, or rocky
184+
--distro NAME Base distro: ubuntu-24-04, ubuntu-26-04, centos, fedora, or rocky
181185
--with NAME Apply docker, podman, or selinux; repeatable
182186
--repository REF OCI repository without a tag
183187
--digest DIGEST Trusted OCI manifest digest required for pulls
@@ -202,7 +206,7 @@ Install the package in an Ubuntu VM and run a command:
202206

203207
```shell
204208
nix run .#test-guest -- \
205-
--distro ubuntu \
209+
--distro ubuntu-24-04 \
206210
--with docker \
207211
--install artifacts/openshell_0.0.0-local_arm64.deb \
208212
-- openshell --version
@@ -218,7 +222,7 @@ Use `--copy SOURCE:DEST` to install an executable without creating a package:
218222

219223
```shell
220224
nix run .#test-guest -- \
221-
--distro ubuntu \
225+
--distro ubuntu-24-04 \
222226
--copy ./openshell:/usr/local/bin/openshell \
223227
-- openshell --version
224228
```
@@ -228,7 +232,7 @@ The destination must be an absolute guest path. Copied files are installed with
228232
## Runner options
229233

230234
```text
231-
--distro NAME Base distro: ubuntu, centos, fedora, or rocky
235+
--distro NAME Base distro: ubuntu-24-04, ubuntu-26-04, centos, fedora, or rocky
232236
--with NAME Apply docker, podman, or selinux; repeatable
233237
--install PATH Install a .deb or .rpm package; repeatable
234238
--copy SRC:DEST Copy an executable into the guest; repeatable

‎nix/test-guest/cache.sh‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ Usage:
1212
nix run .#test-guest-cache -- --distro DISTRO [OPTIONS]
1313
1414
Options:
15-
--distro NAME Base distro: ubuntu, centos, fedora, or rocky
16-
--with NAME Apply a configuration; repeatable (docker, podman, selinux)
15+
--distro NAME Base distro: ubuntu-24-04, ubuntu-26-04, centos, fedora, or rocky
16+
--with NAME Apply a configuration; repeatable (docker, podman, podman-rootless, selinux)
1717
--repository REF OCI repository without a tag
1818
--digest DIGEST Trusted OCI manifest digest required for pulls
1919
--cache-dir PATH Override the local prepared-disk cache directory
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
---
2+
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
# PROTOTYPE: Configure rootless Podman in a disposable test guest.
6+
7+
- name: Configure rootless Podman
8+
hosts: test_vm
9+
become: true
10+
gather_facts: true
11+
12+
tasks:
13+
- name: Validate rootless Podman support
14+
ansible.builtin.assert:
15+
that:
16+
- ansible_facts.distribution == "Ubuntu"
17+
- ansible_facts.distribution_version is version("26.04", ">=")
18+
fail_msg: >-
19+
Rootless Podman requires Ubuntu 26.04 or newer, not
20+
{{ ansible_facts.distribution }} {{ ansible_facts.distribution_version }}.
21+
22+
- name: Refresh Ubuntu package metadata
23+
ansible.builtin.apt:
24+
update_cache: true
25+
26+
- name: Install Ubuntu rootless Podman
27+
ansible.builtin.apt:
28+
name:
29+
- fuse-overlayfs
30+
- passt
31+
- podman
32+
- uidmap
33+
state: present
34+
35+
- name: Enable the rootless Podman API socket
36+
ansible.builtin.systemd_service:
37+
name: podman.socket
38+
scope: user
39+
enabled: true
40+
state: started
41+
become: false
42+
43+
- name: Verify rootless Podman
44+
ansible.builtin.command:
45+
cmd: podman info
46+
become: false
47+
changed_when: false
48+
49+
- name: Verify rootless Podman mode
50+
ansible.builtin.command:
51+
argv:
52+
- podman
53+
- info
54+
- --format
55+
- "{% raw %}{{.Host.Security.Rootless}}{% endraw %}"
56+
become: false
57+
changed_when: false
58+
register: podman_rootless
59+
failed_when: podman_rootless.stdout != "true"
60+
61+
- name: Verify rootless Podman uses pasta
62+
ansible.builtin.command:
63+
argv:
64+
- podman
65+
- info
66+
- --format
67+
- "{% raw %}{{.Host.RootlessNetworkCmd}}{% endraw %}"
68+
become: false
69+
changed_when: false
70+
register: podman_rootless_network
71+
failed_when: podman_rootless_network.stdout != "pasta"

‎nix/test-guest/configuration/podman.yml‎

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,7 @@
2727
name: podman
2828
state: present
2929

30-
- name: Enable the rootless Podman API socket
31-
ansible.builtin.systemd_service:
32-
name: podman.socket
33-
scope: user
34-
enabled: true
35-
state: started
36-
become: false
37-
38-
- name: Verify rootless Podman
30+
- name: Verify Podman
3931
ansible.builtin.command:
4032
cmd: podman info
41-
become: false
4233
changed_when: false

‎nix/test-guest/default.nix‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ let
1818
if isAarch64 then "${qemu}/bin/qemu-system-aarch64" else "${qemu}/bin/qemu-system-x86_64";
1919

2020
distros = {
21-
ubuntu = import ./distros/ubuntu.nix { inherit pkgs architecture; };
21+
ubuntu-24-04 = import ./distros/ubuntu-24-04.nix { inherit pkgs architecture; };
22+
ubuntu-26-04 = import ./distros/ubuntu-26-04.nix { inherit pkgs architecture; };
2223
centos = import ./distros/centos.nix { inherit pkgs architecture; };
2324
fedora = import ./distros/fedora.nix { inherit pkgs architecture; };
2425
rocky = import ./distros/rocky.nix { inherit pkgs architecture; };
@@ -27,6 +28,7 @@ let
2728
configurations = {
2829
docker = ./configuration/docker.yml;
2930
podman = ./configuration/podman.yml;
31+
podman-rootless = ./configuration/podman-rootless.yml;
3032
selinux = ./configuration/selinux.yml;
3133
};
3234

0 commit comments

Comments
 (0)