Skip to content

Discover every spored systemd unit in the unit gates (#946) - #958

Merged
scttfrdmn merged 1 commit into
mainfrom
fix/946
Oct 16, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
fix/946

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

Fixes #946.

TestSporedUnit_NoPrivateTmp checked a fixed list (pkg/launcher/bootstrap.go, scripts/spored.service) and never saw the two units cmd/app.go writes (web-app and DCV paths). Per CLAUDE.md gate rule 4 it now discovers the set:

  • walks the module; every file named spored.service and every heredoc that writes /etc/systemd/system/spored.service is a unit (4 found today: app.go x2, bootstrap.go, scripts/spored.service)
  • any other redirect/tee/cp/install to that path that the parser can't read fails the gate rather than slipping past it
  • fails if discovery finds nothing
  • rejects any truthy PrivateTmp= (yes/1/on/true), not only the literal PrivateTmp=true; comment lines ignored
  • new TestSporedUnit_AfterNetworkOnline: every unit must have After= and Wants= network-online.target (the Stopped instances: 'spawn status' SSHes to ::1 (localhost) and fails; compute from earlier runs is dropped after restart; stop message says TTL pauses but it doesn't #928 shutdown flush relies on it)
  • TestDiscoverSporedUnits_FindsKnownEmitters is a floor on discovery so a regex that silently stops matching can't turn the gates into no-ops

No unit violated either rule, so no unit changed.

Watched it fail (reverts that compile)

  • PrivateTmp=true added to the DCV unit in cmd/app.go: new gate FAILS (spored unit at cmd/app.go:862: line 877 sets "PrivateTmp=true"); the old test against the same revert PASSES, which is the bug.
  • After=network-online.target removed from the web-app unit: TestSporedUnit_AfterNetworkOnline FAILS.
  • web-app emitter rewritten as cat <<'EOFSPORED' > /etc/systemd/system/spored.service: FAILS (unparseable emitter + discovery floor).
  • discovery forced empty (skip cmd/pkg/scripts): FAILS found no spored systemd unit ... discovery is broken.

Checks

make check: only failure is the known Docker-only TestGenerateWrapper_ChownFixesCrossUIDStickyUnlink_Docker (pkg/taskproto). make check-nested: all 9 nested modules clean.

TestSporedUnit_NoPrivateTmp scanned a hand-written list of two files and
missed the two units cmd/app.go writes. Discover every spored.service file
and every heredoc writing /etc/systemd/system/spored.service, fail on an
empty or unparseable discovery, reject any truthy PrivateTmp=, and add
TestSporedUnit_AfterNetworkOnline for the ordering #928 relies on.

(#946)
@scttfrdmn
scttfrdmn merged commit 58d1ecd into main Oct 16, 2026
7 checks passed
@scttfrdmn
scttfrdmn deleted the fix/946 branch October 16, 2026 16:17
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.

TestSporedUnit_NoPrivateTmp checks a hand-written file list and misses the two spored units in cmd/app.go

1 participant