Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(590)

Unified Diff: bin/au_test_harness/au_worker.py

Issue 6672007: Add logs for update_engine and image_to_live to test artifacts. (Closed) Base URL: http://git.chromium.org/git/crosutils.git@master
Patch Set: Fix bug in RunCommand Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « bin/au_test_harness/au_test.py ('k') | bin/au_test_harness/cros_au_test_harness.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bin/au_test_harness/au_worker.py
diff --git a/bin/au_test_harness/au_worker.py b/bin/au_test_harness/au_worker.py
index 20363c1d327f51f6d7aefdbb47e79d8492cfd9f6..303c1802084785333d62110261e53a847353099b 100644
--- a/bin/au_test_harness/au_worker.py
+++ b/bin/au_test_harness/au_worker.py
@@ -192,14 +192,18 @@ class AUWorker(object):
cmd.append('--image=%s' % image_path)
if src_image_path: cmd.append('--src_image=%s' % src_image_path)
- def RunUpdateCmd(self, cmd):
+ def RunUpdateCmd(self, cmd, log_directory=None):
"""Runs the given update cmd given verbose options.
Raises an update_exception.UpdateException if the update fails.
"""
if self.verbose:
try:
- cros_lib.RunCommand(cmd)
+ if log_directory:
+ cros_lib.RunCommand(cmd, log_to_file=os.path.join(log_directory,
+ 'update.log'))
+ else:
+ cros_lib.RunCommand(cmd)
except Exception as e:
Warning(str(e))
raise update_exception.UpdateException(1, str(e))
@@ -236,14 +240,20 @@ class AUWorker(object):
self.results_count = 0
def GetNextResultsPath(self, label):
- """Returns a new results path based for this label.
+ """Returns a path for the results directory for this label.
Prefixes directory returned for worker with time called i.e. 1_label,
- 2_label, etc.
+ 2_label, etc. The directory returned is outside the chroot so if passing
+ to an script that is called with enther_chroot, make sure to use
+ ReinterpretPathForChroot.
"""
self.results_count += 1
- return os.path.join(self.results_directory, '%s_%s' % (self.results_count,
- label))
+ dir = os.path.join(self.results_directory, '%s_%s' % (self.results_count,
+ label))
+ if not os.path.exists(dir):
+ os.makedirs(dir)
+
+ return dir
# --- PRIVATE HELPER FUNCTIONS ---
« no previous file with comments | « bin/au_test_harness/au_test.py ('k') | bin/au_test_harness/cros_au_test_harness.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698