summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/utils/commands.py
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib/oeqa/utils/commands.py')
-rw-r--r--meta/lib/oeqa/utils/commands.py25
1 files changed, 8 insertions, 17 deletions
diff --git a/meta/lib/oeqa/utils/commands.py b/meta/lib/oeqa/utils/commands.py
index 57286fcb10..ed925a4d92 100644
--- a/meta/lib/oeqa/utils/commands.py
+++ b/meta/lib/oeqa/utils/commands.py
@@ -233,6 +233,12 @@ def runqemu(pn, ssh=True, runqemuparams='', image_fstype=None, launch_cmd=None,
233 import bb.tinfoil 233 import bb.tinfoil
234 import bb.build 234 import bb.build
235 235
236 # Need a non-'BitBake' logger to capture the runner output
237 targetlogger = logging.getLogger('TargetRunner')
238 targetlogger.setLevel(logging.DEBUG)
239 handler = logging.StreamHandler(sys.stdout)
240 targetlogger.addHandler(handler)
241
236 tinfoil = bb.tinfoil.Tinfoil() 242 tinfoil = bb.tinfoil.Tinfoil()
237 tinfoil.prepare(config_only=False, quiet=True) 243 tinfoil.prepare(config_only=False, quiet=True)
238 try: 244 try:
@@ -250,31 +256,15 @@ def runqemu(pn, ssh=True, runqemuparams='', image_fstype=None, launch_cmd=None,
250 for key, value in overrides.items(): 256 for key, value in overrides.items():
251 recipedata.setVar(key, value) 257 recipedata.setVar(key, value)
252 258
253 # The QemuRunner log is saved out, but we need to ensure it is at the right
254 # log level (and then ensure that since it's a child of the BitBake logger,
255 # we disable propagation so we don't then see the log events on the console)
256 logger = logging.getLogger('BitBake.QemuRunner')
257 logger.setLevel(logging.DEBUG)
258 logger.propagate = False
259 logdir = recipedata.getVar("TEST_LOG_DIR") 259 logdir = recipedata.getVar("TEST_LOG_DIR")
260 260
261 qemu = oeqa.targetcontrol.QemuTarget(recipedata, image_fstype) 261 qemu = oeqa.targetcontrol.QemuTarget(recipedata, targetlogger, image_fstype)
262 finally: 262 finally:
263 # We need to shut down tinfoil early here in case we actually want 263 # We need to shut down tinfoil early here in case we actually want
264 # to run tinfoil-using utilities with the running QEMU instance. 264 # to run tinfoil-using utilities with the running QEMU instance.
265 # Luckily QemuTarget doesn't need it after the constructor. 265 # Luckily QemuTarget doesn't need it after the constructor.
266 tinfoil.shutdown() 266 tinfoil.shutdown()
267 267
268 # Setup bitbake logger as console handler is removed by tinfoil.shutdown
269 bblogger = logging.getLogger('BitBake')
270 bblogger.setLevel(logging.INFO)
271 console = logging.StreamHandler(sys.stdout)
272 bbformat = bb.msg.BBLogFormatter("%(levelname)s: %(message)s")
273 if sys.stdout.isatty():
274 bbformat.enable_color()
275 console.setFormatter(bbformat)
276 bblogger.addHandler(console)
277
278 try: 268 try:
279 qemu.deploy() 269 qemu.deploy()
280 try: 270 try:
@@ -289,6 +279,7 @@ def runqemu(pn, ssh=True, runqemuparams='', image_fstype=None, launch_cmd=None,
289 qemu.stop() 279 qemu.stop()
290 except: 280 except:
291 pass 281 pass
282 targetlogger.removeHandler(handler)
292 283
293def updateEnv(env_file): 284def updateEnv(env_file):
294 """ 285 """