Skip to content

Conversation

@DanielKriz
Copy link
Contributor

Description
We are using the Aten PE6216 PDU on our testfleet and we want to use labgrid for test management. This PDU is not present in labgrid power drivers or in the pdudaemon project, hence we have to add it.

I did test it on our test fleet with few very simple tests:

import time

def test_power_on(target):
    pwd = target.get_driver('NetworkPowerDriver')
    pwd.on()
    time.sleep(10.0)
    assert pwd.get() == True

def test_power_cycle(target):
    pwd = target.get_driver('NetworkPowerDriver')
    pwd.cycle()
    time.sleep(10.0)
    assert pwd.get() == True

def test_power_off(target):
    pwd = target.get_driver('NetworkPowerDriver')
    pwd.off()
    time.sleep(10.0)
    assert pwd.get() == False

(PDU takes some time to change states as it has built-in delay between changes (althrough they can be turned of with 'no-wait' option in the HTTP request))

Checklist

  • Documentation for the feature
  • Tests for the feature
  • The arguments and description in doc/configuration.rst have been updated
  • PR has been tested

@Bastian-Krause
Copy link
Member

Bastian-Krause commented Feb 5, 2024

Thanks for taking the time to contribute to labgrid! PR looks good to me.

(PDU takes some time to change states as it has built-in delay between changes (althrough they can be turned of with 'no-wait' option in the HTTP request))

I can't find the 'no-wait' option in that pdf. Could you explain why you decided against using this option?

@Bastian-Krause Bastian-Krause self-assigned this Feb 5, 2024
@Bastian-Krause Bastian-Krause added the needs author info Requires more information from the PR/Issue author label Mar 14, 2024
@codecov
Copy link

codecov bot commented Mar 14, 2024

Codecov Report

❌ Patch coverage is 40.90909% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 45.2%. Comparing base (caf7833) to head (a2557a5).
⚠️ Report is 2 commits behind head on master.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
labgrid/driver/power/pe6216.py 40.9% 13 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           master   #1324     +/-   ##
========================================
- Coverage    45.2%   45.2%   -0.1%     
========================================
  Files         173     174      +1     
  Lines       13721   13743     +22     
========================================
+ Hits         6203    6212      +9     
- Misses       7518    7531     +13     
Flag Coverage Δ
3.10 45.2% <40.9%> (-0.1%) ⬇️
3.11 45.2% <40.9%> (-0.1%) ⬇️
3.12 45.2% <40.9%> (-0.1%) ⬇️
3.13 45.1% <40.9%> (-0.1%) ⬇️
3.14 45.1% <40.9%> (-0.1%) ⬇️
3.9 45.2% <40.9%> (-0.1%) ⬇️

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

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

@DanielKriz
Copy link
Contributor Author

I am sorry for such a late reply. I made a mistake, it is not a no-wait (that is just our internal name), in the documentation it is called on_immediate and off_immediate.

I have decided against this option because it is safeguarding the DUTs against rapid switching of power, that might occur with immediate mode. I think that in more cases a lot of people would then implement such wait manually (with time.sleep or something like that) as the safety is from my point of view more important than speed. (And PE6216 this feature built-in).

Probably the best and most flexible solution would be some kind of option, that could be put inside the labgrid configuration, but I am not sure if there is any support in labgrid for that right now.

@DanielKriz
Copy link
Contributor Author

Hello, I would like to ask about the state of this pull request? What should I do to make it accepted?

Is the problem the coverage? Could you give me some pointers about how should I approach it? I am not really sure how to test power drivers.

@DanielKriz DanielKriz force-pushed the feature/aten_pe6216_power_driver branch from b6f8d65 to bd5960c Compare August 6, 2024 10:23
@Emantor Emantor requested a review from Bastian-Krause August 6, 2024 12:12
@Emantor Emantor removed the needs author info Requires more information from the PR/Issue author label Aug 6, 2024
@tadeas-vintrlik
Copy link

Greetings,

What is the state of this PR? We could really use it.

@Emantor Emantor force-pushed the feature/aten_pe6216_power_driver branch from bd5960c to 8b52be2 Compare June 11, 2025 04:48
@tadeas-vintrlik
Copy link

@Bastian-Krause is there something missing for this to get merged? We have been using a fork for almost two years at this point.

The support for Aten PDU family is not present in the `pdudameon` at the
moment, hence we have to add it here.

Signed-off-by: Daniel Kříž <daniel.kriz@protonmail.com>
[bst: check for HTTP errors, format, document username/password, add
import test]
Signed-off-by: Bastian Krause <bst@pengutronix.de>
@Bastian-Krause Bastian-Krause force-pushed the feature/aten_pe6216_power_driver branch from 8b52be2 to a2557a5 Compare February 3, 2026 10:54
@Bastian-Krause
Copy link
Member

Force-pushed: rebased, add check for HTTP errors, reformatted, document that default username/password is expected, add import test, use ExecutionError instead of RuntimeError

@Bastian-Krause Bastian-Krause merged commit b327f81 into labgrid-project:master Feb 3, 2026
10 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants