Skip to content

Commit 2f44036

Browse files
committed
test(conformance): verify Snap status in Ubuntu VM
Signed-off-by: Evan Lezar <elezar@nvidia.com>
1 parent 602ec36 commit 2f44036

3 files changed

Lines changed: 112 additions & 22 deletions

File tree

‎.github/workflows/conformance.yml‎

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,37 @@ jobs:
101101
checkout-ref: ${{ github.sha }}
102102
secrets: inherit
103103

104+
build-sandbox:
105+
needs: version
106+
permissions:
107+
contents: read
108+
uses: ./.github/workflows/build-binaries.yml
109+
with:
110+
package: openshell-sandbox
111+
binary: openshell-sandbox
112+
triple: x86_64-unknown-linux-musl
113+
runner: linux-amd64-cpu8
114+
dev-shell: .#devShells.x86_64-linux.musl
115+
cargo-version: ${{ needs.version.outputs.cargo }}
116+
checkout-ref: ${{ github.sha }}
117+
secrets: inherit
118+
119+
build-snap:
120+
needs: [build-cli, build-gateway, build-sandbox]
121+
permissions:
122+
actions: read
123+
contents: read
124+
packages: read
125+
uses: ./.github/workflows/build-snap.yml
126+
with:
127+
checkout-ref: ${{ github.sha }}
128+
artifact-layout: raw
129+
arch: amd64
130+
runner: linux-amd64-cpu8
131+
cli-artifact-name: openshell-x86_64-unknown-linux-musl
132+
gateway-artifact-name: openshell-gateway-x86_64-unknown-linux-gnu
133+
supervisor-artifact-name: openshell-sandbox-x86_64-unknown-linux-musl
134+
104135
build-rpm:
105136
needs: [version, build-cli, build-gateway]
106137
permissions:
@@ -181,3 +212,56 @@ jobs:
181212
--provision gateway-rootless-podman \
182213
--provision openshell-rpm-gateway-upgrade \
183214
-- /tmp/openshell-conformance run --plan /tmp/conformance-plan.toml
215+
216+
ubuntu-snap:
217+
name: Ubuntu Snap with Docker Snap
218+
needs: build-snap
219+
runs-on: ubuntu-24.04
220+
timeout-minutes: 45
221+
permissions:
222+
actions: read
223+
contents: read
224+
steps:
225+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
226+
with:
227+
persist-credentials: false
228+
229+
- name: Enable KVM access
230+
run: |
231+
set -euo pipefail
232+
if [[ ! -c /dev/kvm ]]; then
233+
echo "::error::The runner did not expose /dev/kvm"
234+
exit 1
235+
fi
236+
sudo chmod 0666 /dev/kvm
237+
exec 3<>/dev/kvm
238+
exec 3>&-
239+
240+
- uses: ./.github/actions/setup-nix
241+
242+
- name: Download Snap artifact
243+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
244+
with:
245+
name: snap-linux-amd64
246+
path: snap-input
247+
248+
- name: Install Snap and verify gateway status
249+
shell: bash
250+
run: |
251+
set -euo pipefail
252+
shopt -s nullglob
253+
snaps=(snap-input/*.snap)
254+
if [[ ${#snaps[@]} -ne 1 ]]; then
255+
echo "expected one Snap artifact" >&2
256+
printf 'Snap artifacts:\n' >&2
257+
printf ' %s\n' snap-input/* >&2
258+
exit 1
259+
fi
260+
261+
OPENSHELL_TEST_GUEST_CACHE_DISABLE=1 nix run .#test-guest -- \
262+
--distro ubuntu-24-04 \
263+
--with snapd \
264+
--with docker-snap \
265+
--copy "${snaps[0]}:/var/lib/openshell-conformance/candidate/openshell.snap" \
266+
--provision openshell-snap \
267+
-- true

‎architecture/build.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,12 @@ restart, while the scenario remains responsible for black-box sandbox
263263
continuity checks. The plan exposes opaque executable paths and timeouts rather
264264
than driver or package-manager configuration; target setup owns those details.
265265

266+
The conformance workflow also builds a branch Snap for an Ubuntu QEMU guest.
267+
The guest installs snapd and Docker Snap, installs the unsigned candidate,
268+
connects its required interfaces, registers the local gateway, and verifies
269+
`openshell status`. Sandbox smoke conformance remains separate from this
270+
package-installation check.
271+
266272
## Python Wheel Packaging
267273

268274
The generated protobuf/gRPC stubs under `python/openshell/_proto/` are gitignored

‎nix/test-guest/README.md‎

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -70,18 +70,18 @@ The root [`flake.nix`](../../flake.nix) exposes this directory as the `test-gues
7070

7171
## Supported configurations
7272

73-
| Distro | Docker | Rootless Podman | SELinux | Package format |
74-
| --- | --- | --- | --- | --- |
75-
| Ubuntu 24.04 | Yes | No | No | `.deb` |
76-
| Ubuntu 26.04 | Yes | Yes | No | `.deb` |
77-
| CentOS Stream 10 | No | No | Yes | `.rpm` |
78-
| Fedora 44 | No | Yes | Yes | `.rpm` |
79-
| Rocky Linux 9 | Yes | No | Yes | `.rpm` |
73+
| Distro | Docker package | Docker Snap | Rootless Podman | SELinux | Package format |
74+
| --- | --- | --- | --- | --- | --- |
75+
| Ubuntu 24.04 | Yes | Yes | No | No | `.deb` |
76+
| Ubuntu 26.04 | Yes | Yes | Yes | No | `.deb` |
77+
| CentOS Stream 10 | No | No | No | Yes | `.rpm` |
78+
| Fedora 44 | No | No | Yes | Yes | `.rpm` |
79+
| Rocky Linux 9 | Yes | No | No | Yes | `.rpm` |
8080

8181
The `snapd` configuration is available for Ubuntu and prepares snapd for
82-
local Snap lifecycle experiments. It does not install Docker, because the Snap
83-
gateway reproduction uses the Docker **Snap** and its `docker:docker-daemon`
84-
interface rather than the host-package Docker configuration.
82+
local Snap lifecycle experiments. Add `docker-snap` after `snapd` to install
83+
the Docker **Snap** and model the `docker:docker-daemon` interface used by the
84+
OpenShell Snap. This is separate from the host-package Docker configuration.
8585

8686
`podman-rootless` configures the explicit rootless Podman guest setup used by
8787
OpenShell tests. It supports Fedora and Ubuntu 26.04 or later. Ubuntu adds the
@@ -331,27 +331,26 @@ nix run .#test-guest -- \
331331
-- openshell --version
332332
```
333333

334-
## Reproduce Snap gateway startup
334+
## Verify Snap gateway status
335335

336-
The gateway Snap must be native to the guest architecture. Copy an existing
337-
Snap artifact and the reproduction script into a prepared Ubuntu guest, then
338-
run the script as root. It follows the Release Canary ordering exactly: install
339-
the Snap, connect Docker/log/system interfaces, and immediately query the
340-
gateway. On each failure it prints snapd and gateway journals.
336+
The candidate Snap must be native to the guest architecture. The `openshell-snap`
337+
provisioner installs it, connects the Docker/log/system interfaces, registers the
338+
local gateway, and waits for `openshell status`, matching the Release Canary
339+
validation flow.
341340

342341
```shell
343342
nix run .#test-guest -- \
344343
--distro ubuntu-24-04 \
345344
--with snapd \
345+
--with docker-snap \
346346
--keep \
347-
--copy ./openshell_*.snap:/tmp/openshell.snap \
348-
--copy ./nix/test-guest/scripts/snap-gateway-repro.sh:/usr/local/bin/snap-gateway-repro \
349-
-- sudo /usr/local/bin/snap-gateway-repro /tmp/openshell.snap 10 30
347+
--copy ./openshell_*.snap:/var/lib/openshell-conformance/candidate/openshell.snap \
348+
--provision openshell-snap \
349+
-- true
350350
```
351351

352352
`--keep` retains the overlay and serial log when diagnosing a failure. The
353-
runner prints their location after shutdown. The final `30` accepts automatic
354-
recovery for up to 30 seconds; omit it to require the canary's immediate check.
353+
runner prints their location after shutdown.
355354

356355

357356
The destination must be an absolute guest path. Use bare octal permission bits
@@ -361,7 +360,8 @@ from `000` through `777` for explicit modes.
361360

362361
```text
363362
--distro NAME Base distro: ubuntu-24-04, ubuntu-26-04, centos, fedora, or rocky
364-
--with NAME Apply docker, podman-rootless, selinux, or snapd; repeatable
363+
--with NAME Apply docker, docker-snap, podman-rootless, selinux, or snapd; repeatable
364+
--provision NAME Apply a post-artifact system provisioner; repeatable
365365
--install PATH Install a .deb or .rpm package; repeatable
366366
--copy SRC:DEST[:MODE]
367367
Copy a regular file into the guest; use MODE when provided,

0 commit comments

Comments
 (0)