finalize¶
Source code: finalize.py
The finalize test is the last step before DUT switching to release image.
Description¶
The test invokes gooftool finalize
with specified arguments to switch the
machine to shipping state, in following steps:
Run preflight tasks, including:
Download HWID file from server if available.
Log test states.
Log image versions.
Call
gooftool finalize
, which executes following sub commands in order:
Verify firmware, keys, disk image, hardware components… etc. (equivalent to
gooftool verify
)Clear manufacturing flags in firmware (equivalent to
gooftool clear_gbb_flags
)Enable software write protect (equivalent to
gooftool write_protect
)Start wiping process (equivalent to
gooftool wipe_in_place
), which will do the following tasks:
Wipe stateful partiton
Enable release partition
Notify factory server
Battery cutoff
You can use gooftool_waive_list
and gooftool_skip_list
to waive or skip
some gooftool steps.
Test Procedure¶
When started, the pytest runs a few preflight tasks, to check configuration or prepare logs.
After that, gooftool finalize
will be called, and it will check device’s
state, from hardware to software configuration.
If everything looks good (or waived, skipped by test arguments), gooftool
will enable shipping mode by clearing firmware manufacturing flags, enabling
write protection, enabling release image, wiping out manufacturing disk data,
cutting off battery.
During battery cutoff, operator might be prompted to plug / unplug charger if battery charge percentage is too low or too high.
Dependency¶
Almost everything essential to Chrome OS, especially:
crossystem (developer switch status, hardware WP status)
battery driver (read battery percentage from sysfs)
flashrom (to turn on software WP)
TPM (read from sysfs)
frecon (to show wipe progress and instructions)
network connection (to notify factory server)
clobber-state (/sbin/clobber-state, which wipes stateful partition)
Examples¶
A minimum example should be:
{
"pytest_name": "finalize"
}
Where,
write_protection
will beTrue
for PVT phase, otherwiseFalse
.enable_factory_server
isTrue
, will try to connect to factory server and update HWID data, flush event logs.All gooftool verification rules are not skipped or waived.
For early builds (PROTO, EVT), you can skip things that are not ready:
{
"pytest_name": "finalize",
"args": {
"gooftool_skip_list": ["clear_gbb_flags"],
"write_protection": false,
"gooftool_waive_list": ["verify_tpm", "verify_hwid"]
}
}
Test Arguments¶
Name |
Type |
Description |
---|---|---|
write_protection |
bool, None |
(optional; default: |
has_ectool |
bool |
(optional; default: |
secure_wipe |
bool |
(optional; default: |
upload_method |
str, None |
(optional; default: |
upload_max_retry_times |
int |
(optional; default: |
upload_retry_interval |
int, None |
(optional; default: |
upload_allow_fail |
bool |
(optional; default: |
enable_factory_server |
bool |
(optional; default: |
hwid_need_vpd |
bool |
(optional; default: |
factory_process |
str |
(optional; default: |
rma_mode |
bool |
(optional; default: |
is_cros_core |
bool |
(optional; default: |
has_ec_pubkey |
bool, None |
(optional; default: |
enforced_release_channels |
list, None |
(optional; default: |
ec_pubkey_path |
str, None |
(optional; default: |
ec_pubkey_hash |
str, None |
(optional; default: |
use_local_gooftool |
bool |
(optional; default: |
station_ip |
str, None |
(optional; default: |
gooftool_waive_list |
list |
(optional; default: |
gooftool_skip_list |
list |
(optional; default: |
enable_zero_touch |
bool |
(optional; default: |
cbi_eeprom_wp_status |
[‘Absent’, ‘Locked’, ‘Unlocked’] |
(optional; default: |
is_reference_board |
bool |
(optional; default: |
project |
str, None |
(optional; default: |
mode |
str |
(optional; default: |
skip_feature_tiering_steps |
bool |
(optional; default: |
block_dev_mode |
bool |
(optional; default: |