devserver: Update collect_cros_au_log RPC to return the host logs.
The collect_cros_au_log RPC currently returns just the executing log.
We will need it to return the host logs saved during the update so that
the autoupdate_EndToEndTest test can analyse them.
BUG=chromium:709710
TEST=dev_server.auto_update() and verify that the host logs are saved
into job.resultdir when the test is finished.
Change-Id: I7cf14a81da5481ba8474de9cf1d115280eb93dda
Reviewed-on: https://chromium-review.googlesource.com/503616
Commit-Ready: David Haddock <dhaddock@chromium.org>
Tested-by: David Haddock <dhaddock@chromium.org>
Reviewed-by: Xixuan Wu <xixuan@chromium.org>
diff --git a/devserver.py b/devserver.py
index fafeb53..5e6cc0f 100755
--- a/devserver.py
+++ b/devserver.py
@@ -1074,7 +1074,7 @@
pid: the background process id of cros-update.
Returns:
- A string contains the whole content of the execute log file.
+ A dictionary containing the execute log file and any hostlog files.
"""
if 'host_name' not in kwargs:
raise common_util.DevServerHTTPError((KEY_ERROR_MSG % 'host_name'))
@@ -1088,7 +1088,9 @@
# Fetch the execute log recorded by cros_update_progress.
au_log = cros_update_progress.ReadExecuteLogFile(host_name, pid)
cros_update_progress.DelExecuteLogFile(host_name, pid)
- return au_log
+ # Fetch the cros_au host_logs if they exist
+ au_hostlogs = cros_update_progress.ReadAUHostLogFiles(host_name, pid)
+ return json.dumps({'cros_au_log': au_log, 'host_logs': au_hostlogs})
@cherrypy.expose
def locate_file(self, **kwargs):