Skip to content

resource/power: allow named PDUDaemon ports - #1979

Merged
Emantor merged 3 commits into
labgrid-project:masterfrom
analogdevicesinc:fix-pdu-naming
Oct 14, 2026
Merged

Emantor merged 3 commits into
labgrid-project:masterfrom
analogdevicesinc:fix-pdu-naming

Conversation

@ozan956

@ozan956 ozan956 commented Oct 5, 2026 •

Copy link
Copy Markdown
Member

PDUDaemon has supported non-numeric port identifiers since release v1.1.1 (see pdudaemon/pdudaemon@b30c3327). PDUDaemonPort.index was previously restricted to int, which rejected named ports (e.g. "outlet-a") with a ValueError. This changes index to a str, normalizing both numeric and named identifiers to strings so existing numeric configurations keep working unchanged while named ports are now accepted.

Verified by:

  • Added TestPDUDaemonPort::test_index, covering both a numeric (1 -> "1") and a named ("outlet-a" -> "outlet-a") port identifier.
  • Ran the full tests/test_powerdriver.py suite (34 passed, 4 skipped).

Checklist

  • Documentation for the feature
  • Tests for the feature
  • The arguments and description in doc/configuration.rst have been updated
  • Add a section on how to use the feature to doc/usage.rst
  • Add a section on how to use the feature to doc/development.rst
  • PR has been tested
  • Man pages have been regenerated

Fixes #1778

PDUDaemon supports non-numeric port identifiers since Release v1.1.1.
Normalize all port identifiers to strings to preserve compatibility with
numeric configurations.

Fixes: labgrid-project#1778
Link: pdudaemon/pdudaemon@b30c332
Signed-off-by: Ozan Durgut <ozan.durgut@analog.com>
Add test for numeric and non-numeric port index normalization.

Signed-off-by: Ozan Durgut <ozan.durgut@analog.com>
Signed-off-by: Ozan Durgut <ozan.durgut@analog.com>
@codecov

codecov Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 63.9%. Comparing base (fb6e23a) to head (255a13a).
⚠️ Report is 8 commits behind head on master.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff            @@
##           master   #1979     +/-   ##
========================================
+ Coverage    62.1%   63.9%   +1.8%     
========================================
  Files         186     188      +2     
  Lines       15096   16035    +939     
========================================
+ Hits         9378   10258    +880     
- Misses       5718    5777     +59     
Flag Coverage Δ
3.10 63.8% <100.0%> (+1.8%) ⬆️
3.11 63.9% <100.0%> (+1.8%) ⬆️
3.12 63.9% <100.0%> (+1.8%) ⬆️
3.13 63.8% <100.0%> (+1.8%) ⬆️
3.14 63.8% <100.0%> (+1.8%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@Emantor Emantor left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically that is an API change, in practice I hope this won't be a problem since the converter should take care of it, so LGTM.

@ozan956 ozan956 closed this Oct 10, 2026
@ozan956
ozan956 deleted the fix-pdu-naming branch October 10, 2026 14:03
@ozan956
ozan956 restored the fix-pdu-naming branch October 10, 2026 14:14
@ozan956 ozan956 reopened this Oct 10, 2026
@Emantor
Emantor merged commit 8cf2e20 into labgrid-project:master Oct 14, 2026
18 checks passed
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.

PDUDaemonPort does not allow non-numeric port identifiers

2 participants