summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
Diffstat (limited to 'meta')
-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 427ae23b1b..6bae3882d6 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
@@ -307,9 +309,12 @@ class QemuRunner:
307 sock.close() 309 sock.close()
308 stopread = True 310 stopread = True
309 311
312
310 if not reachedlogin: 313 if not reachedlogin:
311 self.logger.info("Target didn't reached login boot in %d seconds" % self.boottime) 314 self.logger.info("Target didn't reached login boot in %d seconds" % self.boottime)
312 lines = "\n".join(bootlog.splitlines()[-25:]) 315 tail = lambda l: "\n".join(l.splitlines()[-25:])
316 # in case bootlog is empty, use tail qemu log store at self.msg
317 lines = tail(bootlog if bootlog else self.msg)
313 self.logger.info("Last 25 lines of text:\n%s" % lines) 318 self.logger.info("Last 25 lines of text:\n%s" % lines)
314 self.logger.info("Check full boot log: %s" % self.logfile) 319 self.logger.info("Check full boot log: %s" % self.logfile)
315 self._dump_host() 320 self._dump_host()