From 0658434ee3c97bc27b9aa7bde682309af5c2f3c3 Mon Sep 17 00:00:00 2001 From: Alejandro Hernandez Date: Thu, 6 Aug 2015 18:44:22 +0000 Subject: qemurunner: Improves checking for server and target IPs on qemus parameters Fixes OS hanging infinitely waiting for qemus process to release bitbake.lock (From OE-Core rev: d168bf34c553dbe5de7511e158cd83869d7a88bc) Signed-off-by: Alejandro Hernandez Signed-off-by: Richard Purdie --- meta/lib/oeqa/utils/qemurunner.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'meta/lib/oeqa') diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py index 1cf8f7668c..02ac89c142 100644 --- a/meta/lib/oeqa/utils/qemurunner.py +++ b/meta/lib/oeqa/utils/qemurunner.py @@ -120,14 +120,17 @@ class QemuRunner: cmdline = '' with open('/proc/%s/cmdline' % self.qemupid) as p: cmdline = p.read() - ips = re.findall("((?:[0-9]{1,3}\.){3}[0-9]{1,3})", cmdline.split("ip=")[1]) - if not ips or len(ips) != 3: + try: + ips = re.findall("((?:[0-9]{1,3}\.){3}[0-9]{1,3})", cmdline.split("ip=")[1]) + if not ips or len(ips) != 3: + raise ValueError + else: + self.ip = ips[0] + self.server_ip = ips[1] + except IndexError, ValueError: logger.info("Couldn't get ip from qemu process arguments! Here is the qemu command line used: %s" % cmdline) self.stop() return False - else: - self.ip = ips[0] - self.server_ip = ips[1] logger.info("Target IP: %s" % self.ip) logger.info("Server IP: %s" % self.server_ip) logger.info("Waiting at most %d seconds for login banner" % self.boottime) -- cgit v1.2.3-54-g00ecf