hwid¶
Source code: hwid.py
Uses HWID v3 to generate, encode, and verify the device’s HWID.
Description¶
This test generates and verifies HWID of device under testing.
Test Procedure¶
This test does not require operator interaction.
When generate
is True
, this test will do the following:
If
enable_factory_server
isTrue
, it downloads latest HWID database from Google Factory Server.Collect materials (including probed results, device data, and optionally the vpd data) from DUT for generating the HWID string. This step is equivalent to executing
hwid collect-material
in shell.Generate HWID by command
hwid generate --probed-results-file <probed-results> --material-file <hwid-material-file> --json-output
.Verify generated HWID by
hwid verify --material-file <hwid-material-file> --phase <phase>
.Write HWID to GBB by
hwid write <generated-hwid>
.
If generate
is False
, then instead of running hwid generate
in step
3, it will just use hwid read
to read saved HWID from the device. And step
5 will be skipped.
If vpd_data_file
is set to a string of <path>
, the vpd-related
arguments for hwid
tool will be --vpd-data-file <path>
; otherwise if
run_vpd
is True
, the vpd-related arguments for hwid
tool will be
--run-vpd
. Note that run_vpd=True
has no effect if vpd_data_file
is set.
Dependency¶
Various of system utilities like vpd
and flashrom
will be invoked to
grab materials from DUT.
Examples¶
To generate and verify HWID, add this to your test list:
{
"pytest_name": "hwid",
"label": "Write HWID"
}
If you are doing RMA, to allow deprecated
components, you need to enable RMA
mode:
{
"pytest_name": "hwid",
"label": "Write HWID",
"args": {
"rma_mode": true
}
}
New HWID with ‘configless’ format is still under testing. To enable this feature, set argument like this:
{
"pytest_name": "hwid",
"label": "Write HWID",
"args": {
"enable_configless_fields": true
}
}
To override the default project name, use project
arguments:
{
"pytest_name": "hwid",
"label": "Write HWID",
"args": {
"project": "nirwen"
}
}
Test Arguments¶
Name |
Type |
Description |
---|---|---|
generate |
bool |
(optional; default: |
enable_factory_server |
bool |
(optional; default: |
run_vpd |
bool |
(optional; default: |
vpd_data_file |
str, None |
(optional; default: |
rma_mode |
bool |
(optional; default: |
verify_checksum |
bool |
(optional; default: |
enable_configless_fields |
bool |
(optional; default: |
enable_component_status_check_on_pvt |
bool |
(optional; default: |
include_brand_code |
bool |
(optional; default: |
project |
str, None |
(optional; default: |