3/3 Allow auto_update by specifying payload filename.
This adds support for a payload_filename parameter to the devserver
auto_update function. This should be the file we staged by Google
Storage URI in the autoupdate_EndToEndTest. It will be passed to cros_au.
BUG=chromium:709710
TEST=autoupdate_EndToEndTest
Change-Id: Iee618f280129971ca9abb76af922438e69d9206f
Reviewed-on: https://chromium-review.googlesource.com/471883
Commit-Ready: David Haddock <dhaddock@chromium.org>
Tested-by: David Haddock <dhaddock@chromium.org>
Reviewed-by: David Haddock <dhaddock@chromium.org>
diff --git a/client/common_lib/cros/dev_server.py b/client/common_lib/cros/dev_server.py
index 851dc13..4ac9abd 100644
--- a/client/common_lib/cros/dev_server.py
+++ b/client/common_lib/cros/dev_server.py
@@ -1963,7 +1963,8 @@
def auto_update(self, host_name, build_name, original_board=None,
original_release_version=None, log_dir=None,
- force_update=False, full_update=False):
+ force_update=False, full_update=False,
+ payload_filename=None):
"""Auto-update a CrOS host.
@param host_name: The hostname of the DUT to auto-update.
@@ -1979,6 +1980,11 @@
force a full reimage. If False, try stateful
update first if the dut is already installed
with the same version.
+ @param payload_filename: Used to specify the exact file to
+ use for autoupdating. If None, the payload
+ will be determined by build_name. You
+ must have already staged this file before
+ passing it in here.
@return A set (is_success, is_retryable) in which:
1. is_success indicates whether this auto_update succeeds.
@@ -1992,6 +1998,9 @@
'force_update': force_update,
'full_update': full_update}
+ if payload_filename is not None:
+ kwargs['payload_filename'] = payload_filename
+
error_msg = 'CrOS auto-update failed for host %s: %s'
error_msg_attempt = 'Exception raised on auto_update attempt #%s:\n%s'
is_au_success = False