[autotest] move firmware update code from provision_FirmwareUpdate test to CrosHost
Refer to machine_install method, this CL moves the logic needed for repairing
firmware to CrOSHost class. Once servo V3 is ready to update firmware, anothe
CL will be added to enable repair with firmware image.
BUG=chromium:279410
TEST=run test in local setup
test_that 172.22.30.146 provision_FirmwareUpdate --args "value=falco-release/R36-5832.0.0 servo_host=localhost"
TODO: The test can only be done when servod is running in localhost. bug 381718
needs to be fixed before firmware can be updated using servo runnin beaglebone.
Change-Id: Id1a8d484c231120e6834bc985aaaef9f7ad122e8
Reviewed-on: https://chromium-review.googlesource.com/204451
Tested-by: Dan Shi <dshi@chromium.org>
Reviewed-by: Fang Deng <fdeng@chromium.org>
Commit-Queue: Dan Shi <dshi@chromium.org>
diff --git a/server/cros/provision.py b/server/cros/provision.py
index f807717..a60fa41 100644
--- a/server/cros/provision.py
+++ b/server/cros/provision.py
@@ -28,6 +28,17 @@
return CROS_VERSION_PREFIX + ':' + image
+def fw_version_to_label(image):
+ """
+ Returns the proper label name for a firmware build of |image|.
+
+ @param image: A string of the form 'lumpy-release/R28-3993.0.0'
+ @returns: A string that is the appropriate label name.
+
+ """
+ return FW_VERSION_PREFIX + ':' + image
+
+
class _SpecialTaskAction(object):
"""
Base class to give a template for mapping labels to tests.