summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/utils
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib/oeqa/utils')
-rw-r--r--meta/lib/oeqa/utils/qemurunner.py11
1 files changed, 3 insertions, 8 deletions
diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py
index 20bb1e5e8d..9ae618f4c9 100644
--- a/meta/lib/oeqa/utils/qemurunner.py
+++ b/meta/lib/oeqa/utils/qemurunner.py
@@ -54,7 +54,6 @@ class QemuRunner:
54 54
55 def launch(self, qemuparams = None): 55 def launch(self, qemuparams = None):
56 56
57
58 if self.display: 57 if self.display:
59 os.environ["DISPLAY"] = self.display 58 os.environ["DISPLAY"] = self.display
60 else: 59 else:
@@ -84,12 +83,11 @@ class QemuRunner:
84 83
85 if self.is_alive(): 84 if self.is_alive():
86 bb.note("qemu started - qemu procces pid is %s" % self.qemupid) 85 bb.note("qemu started - qemu procces pid is %s" % self.qemupid)
87 pscmd = 'ps -p %s -fww | grep -o "192\.168\.7\.[0-9]*::" | awk -F":" \'{print $1}\'' % self.qemupid 86 cmdline = open('/proc/%s/cmdline' % self.qemupid).read()
88 self.ip = subprocess.Popen(pscmd,shell=True,stdout=subprocess.PIPE).communicate()[0].strip() 87 self.ip, _, self.host_ip = cmdline.split('ip=')[1].split(' ')[0].split(':')[0:3]
89 if not re.search("^((?:[0-9]{1,3}\.){3}[0-9]{1,3})$", self.ip): 88 if not re.search("^((?:[0-9]{1,3}\.){3}[0-9]{1,3})$", self.ip):
90 bb.note("Couldn't get ip from qemu process arguments, I got '%s'" % self.ip) 89 bb.note("Couldn't get ip from qemu process arguments, I got '%s'" % self.ip)
91 bb.note("Here is the ps output:\n%s" % \ 90 bb.note("Here is the ps output:\n%s" % cmdline)
92 subprocess.Popen("ps -p %s -fww" % self.qemupid,shell=True,stdout=subprocess.PIPE).communicate()[0])
93 self.kill() 91 self.kill()
94 return False 92 return False
95 bb.note("IP found: %s" % self.ip) 93 bb.note("IP found: %s" % self.ip)
@@ -122,7 +120,6 @@ class QemuRunner:
122 sock.close() 120 sock.close()
123 stopread = True 121 stopread = True
124 122
125
126 if not reachedlogin: 123 if not reachedlogin:
127 bb.note("Target didn't reached login boot in %d seconds" % self.boottime) 124 bb.note("Target didn't reached login boot in %d seconds" % self.boottime)
128 lines = "\n".join(self.bootlog.splitlines()[-5:]) 125 lines = "\n".join(self.bootlog.splitlines()[-5:])
@@ -139,7 +136,6 @@ class QemuRunner:
139 136
140 return self.is_alive() 137 return self.is_alive()
141 138
142
143 def kill(self): 139 def kill(self):
144 if self.server_socket: 140 if self.server_socket:
145 self.server_socket.close() 141 self.server_socket.close()
@@ -207,4 +203,3 @@ class QemuRunner:
207 basecmd = os.path.basename(basecmd) 203 basecmd = os.path.basename(basecmd)
208 if "qemu-system" in basecmd and "-serial tcp" in commands[p]: 204 if "qemu-system" in basecmd and "-serial tcp" in commands[p]:
209 return [int(p),commands[p]] 205 return [int(p),commands[p]]
210