[oe-commits] [openembedded-core] branch master updated: qemurunner: print tail qemu log in case bootlog is empty

git at git.openembedded.org git at git.openembedded.org
Mon Sep 25 13:17:18 UTC 2017


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master
in repository openembedded-core.

The following commit(s) were added to refs/heads/master by this push:
     new 39ffa0f  qemurunner: print tail qemu log in case bootlog is empty
39ffa0f is described below

commit 39ffa0f3779305c5e8ef86fe4572e961c5912021
Author: Leonardo Sandoval <leonardo.sandoval.gonzalez at linux.intel.com>
AuthorDate: Fri Sep 22 16:05:41 2017 -0700

    qemurunner: print tail qemu log in case bootlog is empty
    
    There are cases where the 'while loop' waiting for login prompt fails
    and the bootlog variable does not get populated, thus use the the new
    qemurunner member (self.msg) which stores all output coming from the qemu
    process.
    
    [YOCTO #12113]
    
    Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez at linux.intel.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 meta/lib/oeqa/utils/qemurunner.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py
index 427ae23..6bae388 100644
--- a/meta/lib/oeqa/utils/qemurunner.py
+++ b/meta/lib/oeqa/utils/qemurunner.py
@@ -51,6 +51,7 @@ class QemuRunner:
         self.logged = False
         self.thread = None
         self.use_kvm = use_kvm
+        self.msg = ''
 
         self.runqemutime = 120
         self.qemu_pidfile = 'pidfile_'+str(os.getpid())
@@ -79,6 +80,7 @@ class QemuRunner:
             # because is possible to have control characters
             msg = msg.decode("utf-8", errors='ignore')
             msg = re_control_char.sub('', msg)
+            self.msg += msg
             with codecs.open(self.logfile, "a", encoding="utf-8") as f:
                 f.write("%s" % msg)
 
@@ -307,9 +309,12 @@ class QemuRunner:
                         sock.close()
                         stopread = True
 
+
         if not reachedlogin:
             self.logger.info("Target didn't reached login boot in %d seconds" % self.boottime)
-            lines = "\n".join(bootlog.splitlines()[-25:])
+            tail = lambda l: "\n".join(l.splitlines()[-25:])
+            # in case bootlog is empty, use tail qemu log store at self.msg
+            lines = tail(bootlog if bootlog else self.msg)
             self.logger.info("Last 25 lines of text:\n%s" % lines)
             self.logger.info("Check full boot log: %s" % self.logfile)
             self._dump_host()

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list