Summary
Running go test ./cmd/... -run 'TestSystemStartupCmd_SystemdBranchDeclined|TestSystemStartupCommand|TestSystemUnstartupCommand' on a real Alpine/OpenRC machine (non-root, normal user) fails all three tests. Found via the new cross-distro e2e test matrix harness (see the test/matrix.yml PR) actually running go test ./cmd ./internal/... against a real OpenRC target for the first time -- previously this only ran on systemd distros or macOS.
Root cause
These tests branch only on runtime.GOOS != "linux" vs linux, treating all Linux as systemd. OpenRC is a second real Linux init system this repo supports (see runtime-detection code, test-openrc-orb Make target) but these three tests never account for it as a third branch:
TestSystemStartupCmd_SystemdBranchDeclined (cmd/system_test.go:940) -- only skips on runtime.GOOS != "linux"
TestSystemUnstartupCmd_SystemdBranchDeclined -- same pattern
TestSystemStartupCommand (cmd/system_test.go:1580) -- doc comment explicitly reasons about darwin vs "non-darwin" assuming systemd, never OpenRC
On Alpine/OpenRC, eos system startup's real runtime-detection path apparently probes /etc/init.d/ (a system-wide path) before ever reaching the $HOME/.config/systemd permission check these tests are built around, so the assertions never match:
```
--- FAIL: TestSystemStartupCmd_SystemdBranchDeclined (0.07s)
system_test.go:954: expected startup to return nil when the unit-file prompt is declined, got: command failed
--- FAIL: TestSystemStartupCommand (0.07s)
system_test.go:1613: expected 'creating user systemd directory' error, got: error checking destination file: directory "/etc/init.d/" does not appear to be writable: open /etc/init.d/.write-check-2270715003: permission denied
--- FAIL: TestSystemUnstartupCommand (0.07s)
system_test.go:1629: expected ErrCommandFailed, got:
```
Why this went unnoticed
Nobody had run the general (non-openrc-scoped) go test ./cmd/... suite against a real OpenRC machine before -- test-openrc-orb only runs a narrow -run 'Openrc|OpenRC|DetectActiveSystemRuntime' subset, and these three tests' names don't match that filter, so they were never exercised there either.
Fix direction (not yet investigated in depth)
Either:
- Add an explicit OpenRC skip/branch to all three tests (mirroring the systemd-vs-darwin split already present), or
- If OpenRC startup wiring genuinely should behave differently here, assert the OpenRC-appropriate outcome instead of skipping.
Needs someone to trace the actual ensureRuntime/startup-detection code path on OpenRC to pick the right fix.
Summary
Running
go test ./cmd/... -run 'TestSystemStartupCmd_SystemdBranchDeclined|TestSystemStartupCommand|TestSystemUnstartupCommand'on a real Alpine/OpenRC machine (non-root, normal user) fails all three tests. Found via the new cross-distro e2e test matrix harness (see the test/matrix.yml PR) actually runninggo test ./cmd ./internal/...against a real OpenRC target for the first time -- previously this only ran on systemd distros or macOS.Root cause
These tests branch only on
runtime.GOOS != "linux"vs linux, treating all Linux as systemd. OpenRC is a second real Linux init system this repo supports (see runtime-detection code,test-openrc-orbMake target) but these three tests never account for it as a third branch:TestSystemStartupCmd_SystemdBranchDeclined(cmd/system_test.go:940) -- only skips onruntime.GOOS != "linux"TestSystemUnstartupCmd_SystemdBranchDeclined-- same patternTestSystemStartupCommand(cmd/system_test.go:1580) -- doc comment explicitly reasons about darwin vs "non-darwin" assuming systemd, never OpenRCOn Alpine/OpenRC,
eos system startup's real runtime-detection path apparently probes/etc/init.d/(a system-wide path) before ever reaching the$HOME/.config/systemdpermission check these tests are built around, so the assertions never match:```
--- FAIL: TestSystemStartupCmd_SystemdBranchDeclined (0.07s)
system_test.go:954: expected startup to return nil when the unit-file prompt is declined, got: command failed
--- FAIL: TestSystemStartupCommand (0.07s)
system_test.go:1613: expected 'creating user systemd directory' error, got: error checking destination file: directory "/etc/init.d/" does not appear to be writable: open /etc/init.d/.write-check-2270715003: permission denied
--- FAIL: TestSystemUnstartupCommand (0.07s)
system_test.go:1629: expected ErrCommandFailed, got:
```
Why this went unnoticed
Nobody had run the general (non-openrc-scoped)
go test ./cmd/...suite against a real OpenRC machine before --test-openrc-orbonly runs a narrow-run 'Openrc|OpenRC|DetectActiveSystemRuntime'subset, and these three tests' names don't match that filter, so they were never exercised there either.Fix direction (not yet investigated in depth)
Either:
Needs someone to trace the actual
ensureRuntime/startup-detection code path on OpenRC to pick the right fix.