hwid: Rewrites `DatabaseBuilder` class and its unittest.
In previous CLs we implemented method for manipulating a HWID database
object in `Database` class and we also removed some complex logics
such as "probeable" from the database. It's time to rewrite the
builder for the database in a simpler way.
This CL also moves the probing related functions from `hwid_utils`
module into a individual module to focus on "how to use the probe
tool to know what components are installed on the device".
TEST=make test; manually test all functions of hwid tools on DUT
BUG=chromium:689944
CQ-DEPEND=CL:*553738,CL:*553758
Change-Id: I2e79298ff49b304b9c17be1dfa21e95ec8c12232
Reviewed-on: https://chromium-review.googlesource.com/885343
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Yong Hong <yhong@google.com>
Reviewed-by: Cheng-Han Yang <chenghan@chromium.org>
diff --git a/py/gooftool/commands.py b/py/gooftool/commands.py
index 25de5d1..b59847c 100755
--- a/py/gooftool/commands.py
+++ b/py/gooftool/commands.py
@@ -749,14 +749,15 @@
encoded_string = options.hwid or GetGooftool(options).ReadHWID()
probed_results = hwid_utils.GetProbedResults(infile=options.probe_results)
+ device_info = hwid_utils.GetDeviceInfo()
vpd = hwid_utils.GetVPDData(run_vpd=options.hwid_run_vpd,
infile=options.hwid_vpd_data_file)
event_log.Log('probed_results', probed_results=FilterDict(probed_results))
event_log.Log('vpd', vpd=FilterDict(vpd) if vpd is None else None)
- hwid_utils.VerifyHWID(database, encoded_string, probed_results=probed_results,
- vpd=vpd, rma_mode=options.rma_mode)
+ hwid_utils.VerifyHWID(database, encoded_string, probed_results,
+ device_info, vpd, options.rma_mode)
event_log.Log('verified_hwid', hwid=encoded_string)