update_detachable_base¶
Source code: update_detachable_base.py
Detachable base update test
Description¶
For detachable projects, the detachable base (as a USB device) may need to be
updated with its standalone EC and touchpad firmware.
This test leverages hammerd
, which is the dedicated daemon for updating
detachable base firmware, to help factory automize firmware update and basic
verification.
Test Procedure¶
Test will try to locate detachable base with the given USB device info. If the info is not provided from test lists, the test will try to get it from
cros_config
.Hammerd is invoked to update base’s EC and touch firmware. If the path to EC or touch firmware is not specified, the test will extract the firmware from the release or test rootfs depending on
from_release
.Verify base is properly updated by probing base info and doing some preliminary checkings.
Note that one might want to disable hammerd being inited on boot by configuring upstart. See here for detail.
In addition, it’s recommended to configure detachable base info in chromeos-config (instead of test lists) with following properties provided:
ec-image-name
touch-image-name
vendor-id
product-id
usb-path
So that the it can be maintained in the standalone config and be easily shared across the system.
Dependency¶
chromeos_config (cros_config)
hammerd
usb_updater2
Examples¶
If detachable base information is ready in cros_config and user would like to update using the images extracted from release rootfs:
{
"pytest_name": "update_detachable_base"
}
If explicitly supplying detachable base info (Krane for example):
{
"pytest_name": "update_detachable_base",
"args": {
"from_release": false,
"usb_path": "1-1.1",
"product_id": 20540,
"vendor_id": 6353,
"ec_image_path": "/lib/firmware/masterball.fw",
"touchpad_image_path": "/lib/firmware/masterball-touch.fw"
}
}
Test Arguments¶
Name |
Type |
Description |
---|---|---|
from_release |
bool |
(optional; default: |
usb_path |
str, None |
(optional; default: |
product_id |
int, None |
(optional; default: |
vendor_id |
int, None |
(optional; default: |
ec_image_path |
str, None |
(optional; default: |
touchpad_image_path |
str, None |
(optional; default: |
update |
bool |
(optional; default: |
verify |
bool |
(optional; default: |