Skip to content

test: run the cocoon and process engine scripts against shimmed tools - #754

Open
CMGS wants to merge 1 commit into
masterfrom
test/engine-scripts
Open

test: run the cocoon and process engine scripts against shimmed tools#754
CMGS wants to merge 1 commit into
masterfrom
test/engine-scripts

Conversation

@CMGS

@CMGS CMGS commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Test debt from the 2026-09 audit: the shell scripts embedded in the cocoon and process engines had no execution coverage. Each test runs one script under /bin/sh with shims for cocoon, oras, systemctl, mountpoint, mount, umount, tar, sleep, sed and journalctl on PATH; the shims log their calls and fail on demand, and the test asserts the call sequence, the exit code and what is left on disk.

cocoon: record (both copies, durable first, nothing published when the durable write fails), start (inspect around the boot, NotExistsCode for a lost vm), refresh (console socket and PID rewritten in place), address (retries until the guest agent answers, 90 attempts then gives up), remove (forced and graceful, an already-dropped vm tolerated, a refused remove keeps the records), suspend (snapshot replaced), resume (restore by copy, snapshot kept on failure), stop (flags passed through), inspect, wait (refuses a vm cocoon does not have), import (parts reassembled once, nothing imported after a failed pull), the oras probe, and follow (journal ends with the guest).

process: meta (mount state and record), start (stale unit stopped, overlay mounted or kept, raw workload without one, a unit that will not stop fails the start), stop (kill only when forced, tolerated on a dropped unit), remove (overlay unmounted, dir and record gone), inspect, wait (polls until the unit leaves running), list, pull (bundle unpacked, digest recorded, nothing recorded when the registry refuses), create (bundle pulled or seeded from the cache, raw workload gets no overlay, a failed pull drops the dir), exist (freeze, capture, thaw even when the capture fails, own mount left alone), follow and chdir.

Tests only, no production change. Gates: build, vet, full tests, lint, fmt-check, asl on linux and darwin green; the scripts target Linux nodes, so the Linux CI run is the evidence that counts.

The embedded shell scripts had no execution coverage. Each test runs
a script under /bin/sh with cocoon, oras, systemctl, mount, tar and
journalctl shims on PATH that log their calls and fail on demand,
then asserts the call sequence, the exit code and what is left on
disk: both record copies and their durable-first order, the guest
address retry count, the snapshot replace on suspend, the thaw after
a failed capture, the overlay mount and unmount pairing, the pull
that leaves no digest behind, and the journal follow that ends with
the unit or the guest.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant