summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlejandro Hernandez <alejandro.hernandez@linux.intel.com>2015-08-06 18:44:22 (GMT)
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-09-01 20:37:32 (GMT)
commite74c4a5ff4ed7eb5eb648e2cb382ba8f9e25662e (patch)
treec75ab3722d60d85c36ca6c2a8a28124315e67b38
parent1a99652a88f541afe5ff9cb4f5aeaacbc917d40f (diff)
downloadpoky-e74c4a5ff4ed7eb5eb648e2cb382ba8f9e25662e.tar.gz
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) (From OE-Core rev: 99ac0971aecb1b6bc113da28b79d169095e6b671) Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/lib/oeqa/utils/qemurunner.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py
index f12e65d..16cf0e0 100644
--- a/meta/lib/oeqa/utils/qemurunner.py
+++ b/meta/lib/oeqa/utils/qemurunner.py
@@ -107,14 +107,17 @@ class QemuRunner:
107 cmdline = '' 107 cmdline = ''
108 with open('/proc/%s/cmdline' % self.qemupid) as p: 108 with open('/proc/%s/cmdline' % self.qemupid) as p:
109 cmdline = p.read() 109 cmdline = p.read()
110 ips = re.findall("((?:[0-9]{1,3}\.){3}[0-9]{1,3})", cmdline.split("ip=")[1]) 110 try:
111 if not ips or len(ips) != 3: 111 ips = re.findall("((?:[0-9]{1,3}\.){3}[0-9]{1,3})", cmdline.split("ip=")[1])
112 if not ips or len(ips) != 3:
113 raise ValueError
114 else:
115 self.ip = ips[0]
116 self.server_ip = ips[1]
117 except IndexError, ValueError:
112 logger.info("Couldn't get ip from qemu process arguments! Here is the qemu command line used: %s" % cmdline) 118 logger.info("Couldn't get ip from qemu process arguments! Here is the qemu command line used: %s" % cmdline)
113 self.stop() 119 self.stop()
114 return False 120 return False
115 else:
116 self.ip = ips[0]
117 self.server_ip = ips[1]
118 logger.info("Target IP: %s" % self.ip) 121 logger.info("Target IP: %s" % self.ip)
119 logger.info("Server IP: %s" % self.server_ip) 122 logger.info("Server IP: %s" % self.server_ip)
120 logger.info("Waiting at most %d seconds for login banner" % self.boottime) 123 logger.info("Waiting at most %d seconds for login banner" % self.boottime)