Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

driver/pe6216: add support for Aten PE6216 PDU #1324

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

DanielKriz
Copy link

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

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>
@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
Copy link

codecov bot commented Mar 14, 2024

Codecov Report

Attention: Patch coverage is 0% with 19 lines in your changes are missing coverage. Please review.

Project coverage is 52.9%. Comparing base (2d6f93c) to head (b6f8d65).
Report is 38 commits behind head on master.

Files Patch % Lines
labgrid/driver/power/pe6216.py 0.0% 19 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           master   #1324     +/-   ##
========================================
- Coverage    62.7%   52.9%   -9.8%     
========================================
  Files         163     164      +1     
  Lines       12001   12020     +19     
========================================
- Hits         7532    6370   -1162     
- Misses       4469    5650   +1181     

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

@DanielKriz
Copy link
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement needs author info Requires more information from the PR/Issue author
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants