summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/lib/oeqa/utils/qemurunner.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py
index be50d5e771..b9fa95eff2 100644
--- a/meta/lib/oeqa/utils/qemurunner.py
+++ b/meta/lib/oeqa/utils/qemurunner.py
@@ -51,6 +51,7 @@ class QemuRunner:
51 self.logged = False 51 self.logged = False
52 self.thread = None 52 self.thread = None
53 self.use_kvm = use_kvm 53 self.use_kvm = use_kvm
54 self.msg = ''
54 55
55 self.runqemutime = 120 56 self.runqemutime = 120
56 self.qemu_pidfile = 'pidfile_'+str(os.getpid()) 57 self.qemu_pidfile = 'pidfile_'+str(os.getpid())
@@ -79,6 +80,7 @@ class QemuRunner:
79 # because is possible to have control characters 80 # because is possible to have control characters
80 msg = msg.decode("utf-8", errors='ignore') 81 msg = msg.decode("utf-8", errors='ignore')
81 msg = re_control_char.sub('', msg) 82 msg = re_control_char.sub('', msg)
83 self.msg += msg
82 with codecs.open(self.logfile, "a", encoding="utf-8") as f: 84 with codecs.open(self.logfile, "a", encoding="utf-8") as f:
83 f.write("%s" % msg) 85 f.write("%s" % msg)
84 86
@@ -306,9 +308,12 @@ class QemuRunner:
306 sock.close() 308 sock.close()
307 stopread = True 309 stopread = True
308 310
311
309 if not reachedlogin: 312 if not reachedlogin:
310 self.logger.info("Target didn't reached login boot in %d seconds" % self.boottime) 313 self.logger.info("Target didn't reached login boot in %d seconds" % self.boottime)
311 lines = "\n".join(bootlog.splitlines()[-25:]) 314 tail = lambda l: "\n".join(l.splitlines()[-25:])
315 # in case bootlog is empty, use tail qemu log store at self.msg
316 lines = tail(bootlog if bootlog else self.msg)
312 self.logger.info("Last 25 lines of text:\n%s" % lines) 317 self.logger.info("Last 25 lines of text:\n%s" % lines)
313 self.logger.info("Check full boot log: %s" % self.logfile) 318 self.logger.info("Check full boot log: %s" % self.logfile)
314 self._dump_host() 319 self._dump_host()