Skip to content

test(release): systemd unit starts and serves - #229

Open
aarushlohit wants to merge 4 commits into
optiqor:mainfrom
aarushlohit:codex/systemd-unit-starts-and-serves
Open

test(release): systemd unit starts and serves#229
aarushlohit wants to merge 4 commits into
optiqor:mainfrom
aarushlohit:codex/systemd-unit-starts-and-serves

Conversation

@aarushlohit

Copy link
Copy Markdown

What Changed

Adds release-focused integration coverage for the bare-metal startup path.

  • adds a daemon runtime integration test that starts kerno start, waits for /healthz, and verifies clean SIGTERM shutdown
  • adds a systemd-container integration test that installs the real unit into /etc/systemd/system, copies the built binary to /usr/bin/kerno, runs systemctl start kerno, verifies the unit reaches active, checks /healthz, and confirms systemctl stop returns the unit to inactive
  • captures systemctl status and journalctl output on failure for faster diagnosis

Why

Fixes #155.

The package-install checks verify that the systemd unit is present, but they do not prove that the unit's ExecStart path and runtime wiring actually work. This change closes that gap by validating the installed unit in a real systemd-capable container, while keeping the test inside the existing Go integration suite instead of adding a host-level CI job.

Impact

  • catches unit/runtime drift such as broken ExecStart paths
  • validates the bare-metal service startup path end to end
  • stays aligned with the repo's existing internal/integration testing model

Validation

  • go test ./... -count=1
  • go test ./internal/integration -tags integration -run TestStartCommandServesHealthAndStopsCleanly -count=1
  • go test ./internal/integration -tags integration -run TestSystemdUnitStartsAndServesHealthz -count=1

Signed-off-by: Aarush Lohit <141929019+aarushlohit@users.noreply.github.com>
Signed-off-by: Aarush Lohit <141929019+aarushlohit@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown

🚀 First PR — welcome aboard!

A few things to expect:

  1. CI: every PR runs build + race tests + lint + (eventually) the kernel matrix. If something fails, the log will tell you exactly which gate.
  2. DCO: every commit needs Signed-off-by:git commit -s adds it automatically.
  3. Conventional Commits: PR titles like feat(doctor): add new rule or fix(bpf): handle X. We squash-merge by default.
  4. Review: a maintainer will review within 72 hours. Suggestions are conversations, not orders — push back if something doesn't fit your context.

If you get stuck, reply here or jump to Discussions. We want this PR to land.

@github-actions github-actions Bot added level:advanced 200+ lines or 6+ files (auto-applied) testing Tests and test coverage labels Jun 27, 2026
@aarushlohit
aarushlohit marked this pull request as ready for review June 27, 2026 12:52
@aarushlohit
aarushlohit requested a review from btwshivam as a code owner June 27, 2026 12:52
@aarushlohit

Copy link
Copy Markdown
Author

@optiqor

… root

- go.mod: promote github.com/docker/docker from indirect to direct
  (directly imported in systemd_service_test.go)
- integrationRepoRoot: replace runtime.Caller with os.Getwd +
  upward walk-to-go.mod (fixes 'chdir' failure under -trimpath on CI)
@aarushlohit

Copy link
Copy Markdown
Author

@optiqor kindly review it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

level:advanced 200+ lines or 6+ files (auto-applied) testing Tests and test coverage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(release): systemd unit starts and serves

1 participant