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

rte: add PSU commands and documentation #78

Merged
merged 2 commits into from
Dec 1, 2024
Merged

rte: add PSU commands and documentation #78

merged 2 commits into from
Dec 1, 2024

Conversation

macpijan
Copy link
Contributor

@macpijan macpijan commented Nov 29, 2024

Somehow fixes: https://github.com/Dasharo/osfv-scripts/issues/69

I think in the end we do not need that much logic in this CLI tool, but
the PSU control was definitely missing. We provide a single interface
to control the PSU, no matter what power control (relay, Sonoff) is in
place.

It has been added and exposed to the OSFV via RF libs. The CLI tool
should not know much about the firmware behavior, such as whether
the DUT will power on when PSU is enabled, or not. This is often
configurable, even at runtime, and should be handled in test environment
instead. In many cases, the CLI tool may even ope

Somehow fixes: #69

I think in the end we do not need that much logic in this CLI tool, but
the PSU control was definitely missing. We provide a single interface
to control the PSU, no matter what power control (relay, Sonoff) is in
place.

It has been added and exposed to the OSFV via RF libs. The CLI tool
should not know much about the firmware behavior, such as whether
the DUT will power on when PSU is enabled, or not. This is often
configurable, even at runtime, and should be handled in test environment
instead. In many cases, the CLI tool may even operate with no firmware
at all, or with bricked DUT.

Signed-off-by: Maciej Pijanowski <maciej.pijanowski@3mdeb.com>
@macpijan
Copy link
Contributor Author

Added extra check to warn that the PSU is OFF when we try to use power button, as that was a common mistake:

osfv_cli rte --rte_ip 192.168.10.188 pwr on
DUT model retrieved from snipeit: MSI PRO Z690-A DDR5
Using rte command is invasive action, checking first if the device is not used...
Asset 45 is already checked out by you
Power supply state: OFF !
If you wanted to power on the DUT, you need to enable power supply first ("pwr psu on"), pushing the power button is not enough!
Powering on...
Since the asset 45 has been checkout manually by you prior running this script, it will NOT be checked in automatically. Please return the device when work is finished.

I am not sure if full automation instead would be desired here.

"""
Disconnect main power supply from the DUT by setting either relay or Sonoff to OFF state.
"""
# TODO: rework using abstract interfaces for power control?
Copy link
Contributor Author

Choose a reason for hiding this comment

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

#77

Sonoff returns capital ON/OFF, while relay returned on/off.
We define relay strings here, so can be changed here to
unify the reponses, no matter which power control method
was used at the time.

The more proper solution would be to implement:
#77

Signed-off-by: Maciej Pijanowski <maciej.pijanowski@3mdeb.com>
@macpijan macpijan merged commit c7a007e into main Dec 1, 2024
1 check passed
@macpijan macpijan deleted the psu branch December 1, 2024 16:02
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