diff options
Diffstat (limited to 'meta/lib/oeqa/utils/commands.py')
-rw-r--r-- | meta/lib/oeqa/utils/commands.py | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/meta/lib/oeqa/utils/commands.py b/meta/lib/oeqa/utils/commands.py index 5e5345434d..0bb90028dc 100644 --- a/meta/lib/oeqa/utils/commands.py +++ b/meta/lib/oeqa/utils/commands.py | |||
@@ -296,6 +296,12 @@ def runqemu(pn, ssh=True, runqemuparams='', image_fstype=None, launch_cmd=None, | |||
296 | import bb.tinfoil | 296 | import bb.tinfoil |
297 | import bb.build | 297 | import bb.build |
298 | 298 | ||
299 | # Need a non-'BitBake' logger to capture the runner output | ||
300 | targetlogger = logging.getLogger('TargetRunner') | ||
301 | targetlogger.setLevel(logging.DEBUG) | ||
302 | handler = logging.StreamHandler(sys.stdout) | ||
303 | targetlogger.addHandler(handler) | ||
304 | |||
299 | tinfoil = bb.tinfoil.Tinfoil() | 305 | tinfoil = bb.tinfoil.Tinfoil() |
300 | tinfoil.prepare(config_only=False, quiet=True) | 306 | tinfoil.prepare(config_only=False, quiet=True) |
301 | try: | 307 | try: |
@@ -313,31 +319,15 @@ def runqemu(pn, ssh=True, runqemuparams='', image_fstype=None, launch_cmd=None, | |||
313 | for key, value in overrides.items(): | 319 | for key, value in overrides.items(): |
314 | recipedata.setVar(key, value) | 320 | recipedata.setVar(key, value) |
315 | 321 | ||
316 | # The QemuRunner log is saved out, but we need to ensure it is at the right | ||
317 | # log level (and then ensure that since it's a child of the BitBake logger, | ||
318 | # we disable propagation so we don't then see the log events on the console) | ||
319 | logger = logging.getLogger('BitBake.QemuRunner') | ||
320 | logger.setLevel(logging.DEBUG) | ||
321 | logger.propagate = False | ||
322 | logdir = recipedata.getVar("TEST_LOG_DIR") | 322 | logdir = recipedata.getVar("TEST_LOG_DIR") |
323 | 323 | ||
324 | qemu = oeqa.targetcontrol.QemuTarget(recipedata, image_fstype) | 324 | qemu = oeqa.targetcontrol.QemuTarget(recipedata, targetlogger, image_fstype) |
325 | finally: | 325 | finally: |
326 | # We need to shut down tinfoil early here in case we actually want | 326 | # We need to shut down tinfoil early here in case we actually want |
327 | # to run tinfoil-using utilities with the running QEMU instance. | 327 | # to run tinfoil-using utilities with the running QEMU instance. |
328 | # Luckily QemuTarget doesn't need it after the constructor. | 328 | # Luckily QemuTarget doesn't need it after the constructor. |
329 | tinfoil.shutdown() | 329 | tinfoil.shutdown() |
330 | 330 | ||
331 | # Setup bitbake logger as console handler is removed by tinfoil.shutdown | ||
332 | bblogger = logging.getLogger('BitBake') | ||
333 | bblogger.setLevel(logging.INFO) | ||
334 | console = logging.StreamHandler(sys.stdout) | ||
335 | bbformat = bb.msg.BBLogFormatter("%(levelname)s: %(message)s") | ||
336 | if sys.stdout.isatty(): | ||
337 | bbformat.enable_color() | ||
338 | console.setFormatter(bbformat) | ||
339 | bblogger.addHandler(console) | ||
340 | |||
341 | try: | 331 | try: |
342 | qemu.deploy() | 332 | qemu.deploy() |
343 | try: | 333 | try: |
@@ -352,6 +342,7 @@ def runqemu(pn, ssh=True, runqemuparams='', image_fstype=None, launch_cmd=None, | |||
352 | qemu.stop() | 342 | qemu.stop() |
353 | except: | 343 | except: |
354 | pass | 344 | pass |
345 | targetlogger.removeHandler(handler) | ||
355 | 346 | ||
356 | def updateEnv(env_file): | 347 | def updateEnv(env_file): |
357 | """ | 348 | """ |