[OE-core] [PATCH 2/3] utils: qemurunner.py: Log both 'failed to reach login banner" reasons

Mark Asselstine mark.asselstine at windriver.com
Mon Nov 13 16:28:31 UTC 2017


The current logging always assumes the boot timeout has expired yet
there is a second reason we might have ended up in a position where no
login banner was found, that being a socket disconnect. Add logging
for the disconnect case and make the timeout expiration conditional on
the timeout being exhausted.

Signed-off-by: Mark Asselstine <mark.asselstine at windriver.com>
---
 meta/lib/oeqa/utils/qemurunner.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py
index 2121a0d..f31c2ca 100644
--- a/meta/lib/oeqa/utils/qemurunner.py
+++ b/meta/lib/oeqa/utils/qemurunner.py
@@ -311,14 +311,18 @@ class QemuRunner:
                         except UnicodeDecodeError:
                             continue
                     else:
+                        # no need to check if reachedlogin unless we support multiple connections
+                        self.logger.debug("QEMU socket disconnected before login banner reached. (%s)" %
+                                          time.strftime("%D %H:%M:%S"))
                         socklist.remove(sock)
                         sock.close()
                         stopread = True
 
 
         if not reachedlogin:
-            self.logger.debug("Target didn't reached login boot in %d seconds (%s)" %
-                              (self.boottime, time.strftime("%D %H:%M:%S")))
+            if time.time() >= endtime:
+                self.logger.debug("Target didn't reached login boot in %d seconds (%s)" %
+                                  (self.boottime, time.strftime("%D %H:%M:%S")))
             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)
-- 
2.7.4




More information about the Openembedded-core mailing list