Repository navigation
Restrict deadman and runtime-PM targets and add command timeouts - #64
Merged
Merged
Conversation
…y call, and say what the README shows The deadman only creates, stops or resets units in its own dau-deadman namespace; every systemd call runs sudo -n with a timeout; a missing command, a failed systemd-run, a hang or a timer that did not come up is a DeadmanError; arm confirms the timer is active; status returns systemctl's exit code; the CLI uses subparsers and shell-quotes its dry-run output. The runtime-PM tool takes PCI addresses only (the one form that stays inside the sysfs root), refuses device and pattern together or lspci text without a pattern, checks every attribute before the first write, bounds lspci, and says on stderr when a pattern matched nothing. README: requirements, installation, sudo on the runtime-PM examples, the armed() failure-semantics note, the timeout as policy, neutral patterns; a test runs every documented command as a dry run and README changes run CI. Classifiers match CI, check-types is in make checks, the template test and the orphan coverage omit are gone. Signed-off-by: Tim Paine <3105306+timkpaine@users.noreply.github.com>
Contributor
Test Results39 tests +14 39 ✅ +14 0s ⏱️ ±0s Results for commit c89eb03. ± Comparison against base commit 35945bc. This pull request removes 6 and adds 20 tests. Note that renamed tests count towards both. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #64 +/- ##
==========================================
+ Coverage 92.83% 94.14% +1.30%
==========================================
Files 6 6
Lines 307 495 +188
Branches 25 39 +14
==========================================
+ Hits 285 466 +181
- Misses 18 26 +8
+ Partials 4 3 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The dau-utils readiness review found two privileged-target defects and a set of fail-closed gaps. This is the whole set; nothing is left for a decision.
Deadman
--unitis restricted to the tool's namespace (dau-deadmanordau-deadman-<suffix>);disarm --unit sshdplanned to stop sshd.systemctlandsystemd-runcall runssudo -nwith a 15 s timeout. A missing command, a failedsystemd-run, a hang, or a timer that did not come up after scheduling surfaces asDeadmanError; a query that cannot be answered counts as armed, as before.armconfirms the timer is active before reporting armed.statusreturns systemctl's exit code.disarm --timeoutandstatus --dry-runare refused; dry-run output isshlex.joined and the disarm execution runs the same commands the dry run prints.Runtime PM
dddd:bb:dd.f). sysfs device entries are symlinks, so a resolved-path check cannot confine a write on a real host; the name is the confinement, and the docstring says so.--deviceand--patternare mutually exclusive and one is required;--lspci-outputwithout--patternis refused.lspcihas a timeout and its absence names pciutils.RuntimePmWriteaccepts only the four values the two knobs take.dau-build's hardware plans call
arm --timeout N,hold --device <bdf>andhold --pattern ...as separate commands; all three still compose.Docs and gates
sudoon the runtime-PM examples, thearmed()note (it disarms on an exception, which a hardware plan must not), the timeout labelled as policy, neutral patterns in place of the bench's; the PyPI badge and template note are gone.test_readme.pyruns every documented command in its dry-run form; README changes run CI.check-typesis inmake checks; the template test and the orphan coverage omit are deleted; the lspci fixture uses synthetic ids; the module docstring names no board.