diff options
author | Mariano Lopez <mariano.lopez@linux.intel.com> | 2015-09-02 13:44:42 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-09-02 23:47:21 +0100 |
commit | 4770a766389b94ddd5639d7a92e196abac38da22 (patch) | |
tree | 01db69a1a1db5307c0c93a5b60960db8a1d8b779 /meta/lib/oeqa/utils/qemurunner.py | |
parent | f8c7542164ebbe29613532c93ddc34c94238453c (diff) | |
download | openembedded-core-4770a766389b94ddd5639d7a92e196abac38da22.tar.gz openembedded-core-4770a766389b94ddd5639d7a92e196abac38da22.tar.bz2 openembedded-core-4770a766389b94ddd5639d7a92e196abac38da22.zip |
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]
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.py | 21 |
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: self.stop() return False - (status, output) = self.run_serial("root\n", raw=True) - if re.search("root@[a-zA-Z0-9\-]+:~#", output): - self.logged = True - logger.info("Logged as root in serial console") - else: - logger.info("Couldn't login into serial console" - " as root using blank password") + # If we are not able to login the tests can continue + try: + (status, output) = self.run_serial("root\n", raw=True) + if re.search("root@[a-zA-Z0-9\-]+:~#", output): + self.logged = True + logger.info("Logged as root in serial console") + else: + logger.info("Couldn't login into serial console" + " as root using blank password") + except: + logger.info("Serial console failed while trying to login") else: logger.info("Qemu pid didn't appeared in %s seconds" % self.runqemutime) @@ -321,8 +325,7 @@ class QemuRunner: stopread = True break else: - sock.close() - stopread = True + raise Exception("No data on serial console socket") if data: if raw: status = 1 |