autoupdate_EndToend: improved output; robust event verification logic
This change aims at improving the quality of output during the AU
end-to-end test. In doing so, we're also robustifying the logic for
creating expected events and verifying actual events during an update
process. More specifically:
* We now use symbolic constants for specifying event type and event
result values. This means that such values are defined in one place
and there's much less room for error due to typos etc.
* Event type/result is stored in its raw form, rather than a readable
string form. The mechanism for converting a raw value to
a human-readable form is dong internally by the event class itself.
* Event verification success/failure now prints both raw and beautified
forms of both the expected and actual results. This makes it easy to
map event related info to information logged elsewhere (e.g. when new
events are consumed).
* Rootdev change message more informative (good vs bad outcome).
* We now log the fact that a test has completed all steps; this helps
a reader figure out when the test has completed successfully, and
where that point is in the logs (without this it's quite hard to
distinguish this from the rest of autotest's boilerplate logging).
* Capitalized and improved logging and exception strings.
* Rounded time differences to bounded decimal fractions (one tenth of
a second is enough).
BUG=None
TEST=Test runs successfully; logs as described.
Change-Id: Ie66677765a11778071aeaf0ad8593c5b65217d06
Reviewed-on: https://chromium-review.googlesource.com/171651
Reviewed-by: Gilad Arnold <garnold@chromium.org>
Commit-Queue: Gilad Arnold <garnold@chromium.org>
Tested-by: Gilad Arnold <garnold@chromium.org>
diff --git a/client/common_lib/cros/autoupdater.py b/client/common_lib/cros/autoupdater.py
index a15d621..a23dbec 100644
--- a/client/common_lib/cros/autoupdater.py
+++ b/client/common_lib/cros/autoupdater.py
@@ -214,11 +214,11 @@
"""
autoupdate_cmd = '%s --check_for_update --omaha_url=%s' % (
UPDATER_BIN, self.update_url)
- logging.info('triggering update via: %s', autoupdate_cmd)
+ logging.info('Triggering update via: %s', autoupdate_cmd)
try:
self._run(autoupdate_cmd)
except error.AutoservRunError, e:
- raise RootFSUpdateError('update triggering failed on %s: %s' %
+ raise RootFSUpdateError('Update triggering failed on %s: %s' %
(self.host.hostname, str(e)))