diff options
-rw-r--r-- | meta/lib/oeqa/utils/qemurunner.py | 13 |
1 files changed, 8 insertions, 5 deletions
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: | |||
120 | cmdline = '' | 120 | cmdline = '' |
121 | with open('/proc/%s/cmdline' % self.qemupid) as p: | 121 | with open('/proc/%s/cmdline' % self.qemupid) as p: |
122 | cmdline = p.read() | 122 | cmdline = p.read() |
123 | ips = re.findall("((?:[0-9]{1,3}\.){3}[0-9]{1,3})", cmdline.split("ip=")[1]) | 123 | try: |
124 | if not ips or len(ips) != 3: | 124 | ips = re.findall("((?:[0-9]{1,3}\.){3}[0-9]{1,3})", cmdline.split("ip=")[1]) |
125 | if not ips or len(ips) != 3: | ||
126 | raise ValueError | ||
127 | else: | ||
128 | self.ip = ips[0] | ||
129 | self.server_ip = ips[1] | ||
130 | except IndexError, ValueError: | ||
125 | logger.info("Couldn't get ip from qemu process arguments! Here is the qemu command line used: %s" % cmdline) | 131 | logger.info("Couldn't get ip from qemu process arguments! Here is the qemu command line used: %s" % cmdline) |
126 | self.stop() | 132 | self.stop() |
127 | return False | 133 | return False |
128 | else: | ||
129 | self.ip = ips[0] | ||
130 | self.server_ip = ips[1] | ||
131 | logger.info("Target IP: %s" % self.ip) | 134 | logger.info("Target IP: %s" % self.ip) |
132 | logger.info("Server IP: %s" % self.server_ip) | 135 | logger.info("Server IP: %s" % self.server_ip) |
133 | logger.info("Waiting at most %d seconds for login banner" % self.boottime) | 136 | logger.info("Waiting at most %d seconds for login banner" % self.boottime) |