Dasharo / open-source-firmware-validation

OSFV infrastructure with automated tests and scripts for managing test results
Apache License 2.0
9 stars 2 forks source link

Factor power control, input and output methods into separate libraries #159

Open mkopec opened 11 months ago

mkopec commented 11 months ago

The problem you're addressing (if any)

Right now it's a bit messy with each DUT using a different set of control methods for power, serial, wake etc, which are selected using flags (DUT_CONNECTION_METHOD etc)

Describe the solution you'd like

Factor out each implementation into a separate library with a defined interface

i.e. wakeonlan and rte libraries for waking up, rte and pikvm for terminal output, rte and sonoff for power control, etc.

Platform configs would only include the libraries that they need.

Where is the value to a user, and who might that user be?

Makes tests simpler by having a set of well known kwds for things that are platform-specific

Enforces a stable interface for power, terminal I/O control

Describe alternatives you've considered

do nothing?

Additional context

No response

macpijan commented 4 months ago

@BeataZdunczyk This may need a bit more work to evaluate all of the places needing to be changed, but probably still valid. We need to build more concrete plan here.

A good example of how to approach this is how the options lib has been implemented: https://github.com/Dasharo/open-source-firmware-validation/tree/develop/lib/options

philipandag commented 1 week ago

The Power On / Power Cycle On and similar keywords behave differently on many devices. For example Running Power On or Power Cycle On on a device without a power control, (laptops) does nothing.

On other devices running such keyword causes the device to turn off and boot with the firmware read from the flash memory. The tests which flash the devices depend on it and it might be surprising that running a Power On keyword won't cause the newly flashed firmware to be booted.