summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2016-06-30 15:53:52 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-08-17 10:35:44 +0100
commit51970d10d66be742df3c4d6d5755f5f426c7d221 (patch)
treee05b981b26affce75baa18145cc5119533572d7a
parent818d4c2d8e8507634be5bb89087a24f971a4be01 (diff)
downloadpoky-51970d10d66be742df3c4d6d5755f5f426c7d221.tar.gz
oeqa.buildperf: be more verbose about failed commands
Log failures of commands whose output is stored. (From OE-Core rev: 240f6e7366c8a9ea830e531d307dd2e27a61a6bd) Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/lib/oeqa/buildperf/base.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/meta/lib/oeqa/buildperf/base.py b/meta/lib/oeqa/buildperf/base.py
index 52c2ab61bf..fe18181f2b 100644
--- a/meta/lib/oeqa/buildperf/base.py
+++ b/meta/lib/oeqa/buildperf/base.py
@@ -23,7 +23,7 @@ import unittest
23from datetime import datetime, timedelta 23from datetime import datetime, timedelta
24from functools import partial 24from functools import partial
25 25
26from oeqa.utils.commands import runCmd, get_bb_vars 26from oeqa.utils.commands import CommandError, runCmd, get_bb_vars
27from oeqa.utils.git import GitError, GitRepo 27from oeqa.utils.git import GitError, GitRepo
28 28
29# Get logger for this module 29# Get logger for this module
@@ -216,9 +216,15 @@ class BuildPerfTestCase(unittest.TestCase):
216 216
217 def log_cmd_output(self, cmd): 217 def log_cmd_output(self, cmd):
218 """Run a command and log it's output""" 218 """Run a command and log it's output"""
219 cmd_str = cmd if isinstance(cmd, str) else ' '.join(cmd)
220 log.info("Logging command: %s", cmd_str)
219 cmd_log = os.path.join(self.out_dir, 'commands.log') 221 cmd_log = os.path.join(self.out_dir, 'commands.log')
220 with open(cmd_log, 'a') as fobj: 222 try:
221 runCmd2(cmd, stdout=fobj) 223 with open(cmd_log, 'a') as fobj:
224 runCmd2(cmd, stdout=fobj)
225 except CommandError as err:
226 log.error("Command failed: %s", err.retcode)
227 raise
222 228
223 def measure_cmd_resources(self, cmd, name, legend): 229 def measure_cmd_resources(self, cmd, name, legend):
224 """Measure system resource usage of a command""" 230 """Measure system resource usage of a command"""