summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/utils/qemurunner.py
diff options
context:
space:
mode:
authorMariano Lopez <mariano.lopez@linux.intel.com>2015-09-02 13:44:42 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-09-03 12:43:31 +0100
commit097f36f636a624a9cf3f04780000671d7bc3df50 (patch)
treed4430fffec0d02d39a2cb295b3fef92fd6b679f2 /meta/lib/oeqa/utils/qemurunner.py
parenta3fec07654e6992eab96861892d4261b1e2e0ebf (diff)
downloadpoky-097f36f636a624a9cf3f04780000671d7bc3df50.tar.gz
qemurunner: Handle lack of data on run serial gracefully
This changes the behavior when data was not received over the serial console when a command is run. With this the socket is no longer closed but it throws and exception that can handled in upper layers. With this the test can continue without throwing errors for not having the socket anymore. [YOCTO #8118] (From OE-Core rev: 4770a766389b94ddd5639d7a92e196abac38da22) Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/utils/qemurunner.py')
-rw-r--r--meta/lib/oeqa/utils/qemurunner.py21
1 files changed, 12 insertions, 9 deletions
diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py
index 4ce5d9c685..3ad747a503 100644
--- a/meta/lib/oeqa/utils/qemurunner.py
+++ b/meta/lib/oeqa/utils/qemurunner.py
@@ -197,13 +197,17 @@ class QemuRunner:
197 self.stop() 197 self.stop()
198 return False 198 return False
199 199
200 (status, output) = self.run_serial("root\n", raw=True) 200 # If we are not able to login the tests can continue
201 if re.search("root@[a-zA-Z0-9\-]+:~#", output): 201 try:
202 self.logged = True 202 (status, output) = self.run_serial("root\n", raw=True)
203 logger.info("Logged as root in serial console") 203 if re.search("root@[a-zA-Z0-9\-]+:~#", output):
204 else: 204 self.logged = True
205 logger.info("Couldn't login into serial console" 205 logger.info("Logged as root in serial console")
206 " as root using blank password") 206 else:
207 logger.info("Couldn't login into serial console"
208 " as root using blank password")
209 except:
210 logger.info("Serial console failed while trying to login")
207 211
208 else: 212 else:
209 logger.info("Qemu pid didn't appeared in %s seconds" % self.runqemutime) 213 logger.info("Qemu pid didn't appeared in %s seconds" % self.runqemutime)
@@ -321,8 +325,7 @@ class QemuRunner:
321 stopread = True 325 stopread = True
322 break 326 break
323 else: 327 else:
324 sock.close() 328 raise Exception("No data on serial console socket")
325 stopread = True
326 if data: 329 if data:
327 if raw: 330 if raw:
328 status = 1 331 status = 1