summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/utils/qemurunner.py
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib/oeqa/utils/qemurunner.py')
-rw-r--r--meta/lib/oeqa/utils/qemurunner.py19
1 files changed, 9 insertions, 10 deletions
diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py
index 04584474e7..c5bb13c878 100644
--- a/meta/lib/oeqa/utils/qemurunner.py
+++ b/meta/lib/oeqa/utils/qemurunner.py
@@ -43,9 +43,6 @@ class QemuRunner:
43 43
44 def create_socket(self): 44 def create_socket(self):
45 45
46 self.bootlog = ''
47 self.qemusock = None
48
49 try: 46 try:
50 self.server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 47 self.server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
51 self.server_socket.setblocking(0) 48 self.server_socket.setblocking(0)
@@ -145,22 +142,24 @@ class QemuRunner:
145 socklist = [self.server_socket] 142 socklist = [self.server_socket]
146 reachedlogin = False 143 reachedlogin = False
147 stopread = False 144 stopread = False
145 qemusock = None
146 bootlog = ''
148 while time.time() < endtime and not stopread: 147 while time.time() < endtime and not stopread:
149 sread, swrite, serror = select.select(socklist, [], [], 5) 148 sread, swrite, serror = select.select(socklist, [], [], 5)
150 for sock in sread: 149 for sock in sread:
151 if sock is self.server_socket: 150 if sock is self.server_socket:
152 self.qemusock, addr = self.server_socket.accept() 151 qemusock, addr = self.server_socket.accept()
153 self.qemusock.setblocking(0) 152 qemusock.setblocking(0)
154 socklist.append(self.qemusock) 153 socklist.append(qemusock)
155 socklist.remove(self.server_socket) 154 socklist.remove(self.server_socket)
156 logger.info("Connection from %s:%s" % addr) 155 logger.info("Connection from %s:%s" % addr)
157 else: 156 else:
158 data = sock.recv(1024) 157 data = sock.recv(1024)
159 if data: 158 if data:
160 self.log(data) 159 self.log(data)
161 self.bootlog += data 160 bootlog += data
162 if re.search(".* login:", self.bootlog): 161 if re.search(".* login:", bootlog):
163 self.server_socket = self.qemusock 162 self.server_socket = qemusock
164 stopread = True 163 stopread = True
165 reachedlogin = True 164 reachedlogin = True
166 logger.info("Reached login banner") 165 logger.info("Reached login banner")
@@ -171,7 +170,7 @@ class QemuRunner:
171 170
172 if not reachedlogin: 171 if not reachedlogin:
173 logger.info("Target didn't reached login boot in %d seconds" % self.boottime) 172 logger.info("Target didn't reached login boot in %d seconds" % self.boottime)
174 lines = "\n".join(self.bootlog.splitlines()[-25:]) 173 lines = "\n".join(bootlog.splitlines()[-25:])
175 logger.info("Last 25 lines of text:\n%s" % lines) 174 logger.info("Last 25 lines of text:\n%s" % lines)
176 logger.info("Check full boot log: %s" % self.logfile) 175 logger.info("Check full boot log: %s" % self.logfile)
177 self.stop() 176 self.stop()