[autotest] Return the PID of the successful autoupdate run.
dev_server.auto_update should return the pid of the succesful update run
so that autoupdate_EndToEndTest can use it to parse the correct logs
about the update.
The dev_server.auto_update() can rerun a few times so we want to know
only the successful pid.
BUG=chromium:709710
TEST=test_that <ip> provision_AutoUpdate
Change-Id: I49a035c20ac30ae3ad50a2e84310150938e76520
Reviewed-on: https://chromium-review.googlesource.com/544914
Commit-Ready: David Haddock <dhaddock@chromium.org>
Tested-by: David Haddock <dhaddock@chromium.org>
Reviewed-by: Xixuan Wu <xixuan@chromium.org>
diff --git a/client/common_lib/cros/dev_server.py b/client/common_lib/cros/dev_server.py
index 99495ed..1b647db 100644
--- a/client/common_lib/cros/dev_server.py
+++ b/client/common_lib/cros/dev_server.py
@@ -2052,7 +2052,9 @@
@param force_original: Whether to force stateful update with the
original payload.
- @return is_success, which indicates whether this auto_update succeeds.
+ @return A set (is_success, pid) in which:
+ 1. is_success indicates whether this auto_update succeeds.
+ 2. pid is the process id of the successful autoupdate run.
@raise DevServerException if auto_update fails and is not retryable.
@raise RetryableProvisionException if it fails and is retryable.
@@ -2198,7 +2200,7 @@
c.increment(fields=f)
if is_au_success:
- return is_au_success
+ return (is_au_success, pid)
# If errors happen in the CrOS AU process, report the first error
# since the following errors might be caused by the first error.
diff --git a/server/hosts/cros_host.py b/server/hosts/cros_host.py
index e4172ee..edbb5ea 100644
--- a/server/hosts/cros_host.py
+++ b/server/hosts/cros_host.py
@@ -1992,7 +1992,10 @@
def is_chrome_switch_present(self, switch):
- """Returns True if the specified switch was provided to Chrome."""
+ """Returns True if the specified switch was provided to Chrome.
+
+ @param switch The chrome switch to search for.
+ """
command = 'pgrep -x -f -c "/opt/google/chrome/chrome.*%s.*"' % switch
return self.run(command, ignore_status=True).exit_status == 0