-
Notifications
You must be signed in to change notification settings - Fork 20
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
Add firmware_update phase #141
Conversation
Signed-off-by: nancyc12 <[email protected]>
Signed-off-by: nancyc12 <[email protected]>
Signed-off-by: nancyc12 <[email protected]>
Signed-off-by: nancyc12 <[email protected]>
Signed-off-by: nancyc12 <[email protected]>
a4a40e9
to
b99bb18
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for getting this all figured out! it's a complicated piece and what you've done here is fantastic, has unit tests, and I know the documentation has landed separately already. So I think it's in pretty good shape already, but there are a couple of minor things that I mentioned below, that I think would really improve it even more. Take a look and see what you think.
device-connectors/src/testflinger_device_connectors/fw_devices/LVFS/LVFS.py
Outdated
Show resolved
Hide resolved
device-connectors/src/testflinger_device_connectors/fw_devices/LVFS/LVFS.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 great work!
Description
Base on CR033 - Firmware updates for regression testing, introduce a new optional phase firmware_update after provision phase to handle request for firmware update on the device. As in the spec, this new phase is implemented in
DefaultDevice
, so it won't need any change on existingDeviceConnector
codes.To trigger firmware_update phase, the following section needs to be provided in job.yaml. If the
firmware_update_data
section is missing from the job, this phase will not run.Variables in
firmware_update_data
:version
: The desired firmware level on the device. Currently it only supportslatest
(upgrading all components in the device with the latest firmware release). More options are planned to be implemented in the future once we gathering data for working firmware baseline on devices.ignore_failure
: When set tofalse
, Testflinger Agent will suspend the job if firmware_update phase return a status other than 0, which implies there's a failure during firmware_update phase. If set totrue
, the job will continue regardless the status of firmware_update phase.Code changes
Server
firmware_update_data
section.Agent
firmware_update_command
.Important
For each Testflinger agent instance, extra configuration needs to be added to testflinger-agent.conf. For example,
firmware_update_command: testflinger-device-connector noprovision firmware_update -c default.yaml testflinger.json
.However, it won't break the agent if you don't provide
firmware_update_command
in the conf file, it just loses the support for firmware_update phase.Device Connector
Add firmware_update phase in
DefaultDevice
to handle the firmware update for all childDeviceConnector
class. It will gather DMI chassis_vendor and chassis_type from the DUT to decide whether firmware update is applicable. The current support scope is limited the devices as below.Resolved issues
N/A
Documentation
As discussed with @tang-mm, the documentation for firmware_update phase should include the following:
General Introduction:
covered in Doc: add test phase reference #134
Testflinger agents config:
definition and usage for
firmware_update_command
, which has been updated in add reference docs for configuration options #113Testflinger jobs config:
covered in Doc: add test phase reference #134
Troubleshooting:
provided necessary command output and detailed firmware update status in testflinger log
Tests
It's tested by building a dev testflinger server with docker along with modified agent and device connector.
Unit tests for server
Unit tests for agent
Unit tests for device connector
Testflinger server is able to accept job.yaml with
firmware_update_data
section, and propagate the job json to the agent. Agent is able to work with Device Connector (tested with noprovision) to run firmware_update phase, and populate the data tofirmware_update_data
,firmware_update_status
andfirmware_update_output
section in server job webpage.