Skip to content

Commit da4604b

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

3 files changed

Lines changed: 111 additions & 22 deletions

File tree

‎.github/workflows/conformance.yml‎

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,36 @@ 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+
arch: amd64
129+
runner: linux-amd64-cpu8
130+
cli-artifact-name: openshell-x86_64-unknown-linux-musl
131+
gateway-artifact-name: openshell-gateway-x86_64-unknown-linux-gnu
132+
supervisor-artifact-name: openshell-sandbox-x86_64-unknown-linux-musl
133+
104134
build-rpm:
105135
needs: [version, build-cli, build-gateway]
106136
permissions:
@@ -181,3 +211,56 @@ jobs:
181211
--provision gateway-rootless-podman \
182212
--provision openshell-rpm-gateway-upgrade \
183213
-- /tmp/openshell-conformance run --plan /tmp/conformance-plan.toml
214+
215+
ubuntu-snap:
216+
name: Ubuntu Snap with Docker Snap
217+
needs: build-snap
218+
runs-on: ubuntu-24.04
219+
timeout-minutes: 45
220+
permissions:
221+
actions: read
222+
contents: read
223+
steps:
224+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
225+
with:
226+
persist-credentials: false
227+
228+
- name: Enable KVM access
229+
run: |
230+
set -euo pipefail
231+
if [[ ! -c /dev/kvm ]]; then
232+
echo "::error::The runner did not expose /dev/kvm"
233+
exit 1
234+
fi
235+
sudo chmod 0666 /dev/kvm
236+
exec 3<>/dev/kvm
237+
exec 3>&-
238+
239+
- uses: ./.github/actions/setup-nix
240+
241+
- name: Download Snap artifact
242+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
243+
with:
244+
name: snap-linux-amd64
245+
path: snap-input
246+
247+
- name: Install Snap and verify gateway status
248+
shell: bash
249+
run: |
250+
set -euo pipefail
251+
shopt -s nullglob
252+
snaps=(snap-input/*.snap)
253+
if [[ ${#snaps[@]} -ne 1 ]]; then
254+
echo "expected one Snap artifact" >&2
255+
printf 'Snap artifacts:\n' >&2
256+
printf ' %s\n' snap-input/* >&2
257+
exit 1
258+
fi
259+
260+
OPENSHELL_TEST_GUEST_CACHE_DISABLE=1 nix run .#test-guest -- \
261+
--distro ubuntu-24-04 \
262+
--with snapd \
263+
--with docker-snap \
264+
--copy "${snaps[0]}:/var/lib/openshell-conformance/candidate/openshell.snap" \
265+
--provision openshell-snap \
266+
-- 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)