Skip to content

Validate deadman arming and make sysfs writes safe and reversible - #65

Merged
timkpaine merged 1 commit into
mainfrom
tkp/review-followups
Oct 7, 2026
Merged

timkpaine merged 1 commit into
mainfrom
tkp/review-followups

Conversation

@timkpaine

Copy link
Copy Markdown
Member

Follow-ups from the review of #64 (merged while the review ran).

  • arm confirms the timer with a query that must answer: a failed query after systemd-run is a DeadmanError, not "probably armed". is_armed keeps its conservative default for the pre-arm and disarm checks.
  • --pattern "" (an empty shell variable) matched every lspci line; empty patterns are refused.
  • Attribute writes open with O_NOFOLLOW and refuse a power directory that is a symlink, so a valid-looking device under a caller-supplied --sysfs-root cannot redirect a root write. The device entry itself is a symlink on a real sysfs by design and stays allowed.
  • A write that fails part-way (permission, device gone) restores the attributes already changed and reports what it restored; the failure is a RuntimePmError with exit 1, not a traceback.
  • Option ordering: the subparsers accept arm --timeout N, the form dau-build uses; --timeout N arm no longer parses. Stated here rather than supported.

…thout following links, and roll back a failed plan

Follow-ups from the review of the previous change: a status query that
fails after systemd-run is not 'probably armed'; an empty --pattern matched
every lspci line; an attribute that is a symlink is not written through;
a write that fails part-way restores the attributes already changed.

Signed-off-by: Tim Paine <3105306+timkpaine@users.noreply.github.com>
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Test Results

43 tests  +4   43 ✅ +4   0s ⏱️ ±0s
 1 suites ±0    0 💤 ±0 
 1 files   ±0    0 ❌ ±0 

Results for commit 813e258. ± Comparison against base commit 91d67ef.

@codecov

codecov Bot commented Oct 7, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.65217% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.32%. Comparing base (91d67ef) to head (813e258).

Files with missing lines Patch % Lines
dau_utils/pci_runtime_pm.py 89.18% 3 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #65      +/-   ##
==========================================
+ Coverage   94.14%   94.32%   +0.17%     
==========================================
  Files           6        6              
  Lines         495      581      +86     
  Branches       39       47       +8     
==========================================
+ Hits          466      548      +82     
- Misses         26       29       +3     
- Partials        3        4       +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@timkpaine
timkpaine merged commit 9540d4c into main Oct 7, 2026
4 checks passed
@timkpaine
timkpaine deleted the tkp/review-followups branch October 7, 2026 12:33
@timkpaine timkpaine changed the title Confirm an arm positively, refuse empty patterns, write attributes without following links, and roll back a failed plan Validate deadman arming and make sysfs writes safe and reversible Oct 8, 2026
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