Skip to content

test: judge only systemd warnings about the unit under test - #390

Closed
oddessentials wants to merge 1 commit into
mainfrom
fix/systemd-verify-other-units
Closed

oddessentials wants to merge 1 commit into
mainfrom
fix/systemd-verify-other-units

Conversation

@oddessentials

Copy link
Copy Markdown
Owner

Summary

The test systemd reads the unit as written required systemd-analyze verify to print nothing on stderr. Verifying a unit also loads the machine's own units and prints their warnings. The Ubuntu 26.04 runner image, which ubuntu-latest is moving to, ships units that set the removed CPUAccounting= option, so the test failed there with warnings such as:

/usr/lib/systemd/system/xfs_scrub_all.service:26: Support for option CPUAccounting= has been removed and it is ignored

The test now leaves out only warnings that name another unit's file. Warnings about the unit under test, any other stderr output, any stdout and a non-zero exit still fail it. A new test pins that filtering.

Testing

  • In a local Ubuntu 26.04 container, verifying the unit the old way reproduced the warnings, and the changed test passes.
  • tests/systemd-service.test.mjs passes on Windows, where the systemd test itself is skipped.

🤖 Generated with Claude Code

systemd-analyze verify also loads the machine's own units and prints their
warnings. The Ubuntu 26.04 runner image ships units that set the removed
CPUAccounting= option, so the check for an empty stderr failed there.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@oddessentials

Copy link
Copy Markdown
Owner Author

Folded into #389 so the fix and the feature are one PR.

@oddessentials
oddessentials deleted the fix/systemd-verify-other-units branch November 12, 2026 05:44
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