gooftool: Remove DUT API.
Gooftool, as a command line program dedicated for "Running locally on a
ChromeOS device", should do everything on its own with restricted
dependency and not using remote DUT API.
In station-based mode, gooftool will be executed by being pushed into
device in a bundled archive "factory.par" and then executed locally, so
we don't need to migrate all the complicated probing code.
There are also some side effects:
- Modem probing is removed because new Chromebooks don't support that.
- dut.info.allowed_channel is removed because no one should override
it, and the only one who reads it is gooftool.
The dependency tree of gooftool after this change is still loading whole
test framework due to hwid_utils and its call to shopfloor, which will
be revised in other changes.
BUG=chromium:557573
TEST=make test
Change-Id: Ic35bbc4bac40823c9ba6add1ecf0b51451593b62
Reviewed-on: https://chromium-review.googlesource.com/320455
Commit-Ready: Hung-Te Lin <hungte@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Hsu Wei-Cheng <mojahsu@chromium.org>
diff --git a/py/gooftool/gooftool.py b/py/gooftool/gooftool.py
index 004d6cc..3755f90 100755
--- a/py/gooftool/gooftool.py
+++ b/py/gooftool/gooftool.py
@@ -419,12 +419,10 @@
event_log.Log('vpd', ro_vpd=FilterDict(ro_vpd), rw_vpd=FilterDict(rw_vpd))
map(hwid_tool.Validate.Status, options.status)
- if not options.hwid or not options.probe_results:
- main_fw_file = crosfw.LoadMainFirmware().GetFileName()
-
if options.hwid:
hwid_str = options.hwid
else:
+ main_fw_file = crosfw.LoadMainFirmware().GetFileName()
gbb_result = Shell('gbb_utility -g --hwid %s' % main_fw_file).stdout
hwid_str = re.findall(r'hardware_id:(.*)', gbb_result)[0].strip()
hwid = hwid_tool.ParseHwid(hwid_str)
@@ -449,8 +447,8 @@
(ro_vpd if match.group(1) == 'ro' else rw_vpd)[match.group(2)] = v
else:
probe_results = Probe()
- ro_vpd = ReadRoVpd(main_fw_file)
- rw_vpd = ReadRwVpd(main_fw_file)
+ ro_vpd = ReadRoVpd()
+ rw_vpd = ReadRwVpd()
cooked_components = hw_db.comp_db.MatchComponentProbeValues(
probe_results.found_probe_value_map)
cooked_volatiles = device.MatchVolatileValues(
@@ -857,7 +855,7 @@
_add_file_cmd_arg)
def UploadReport(options):
"""Create a report containing key device details."""
- ro_vpd = ReadRoVpd(crosfw.LoadMainFirmware().GetFileName())
+ ro_vpd = ReadRoVpd()
device_sn = ro_vpd.get('serial_number', None)
if device_sn is None:
logging.warning('RO_VPD missing device serial number')