summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2021-05-09 10:59:44 +0100
committerSteve Sakoman <steve@sakoman.com>2021-05-14 07:16:38 -1000
commit9c0b242856de519c58be179f82441a35fc635ad9 (patch)
tree81130252bf9574fee848c64e15c381e281294557
parent8f24a7b35861b6aec39bc8d589e090ea9816732c (diff)
downloadopenembedded-core-contrib-9c0b242856de519c58be179f82441a35fc635ad9.tar.gz
oeqa/qemurunner: Improve handling of run_serial for shutdown commands
When running a shutdown command, the serial port can close without the command returning. This is seen as the socket being readable but having no data. Change the way this case is handled in the code to avoid tracebacks. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 396a3ba884820d040c91f7592daf20ac28c49b5d) Signed-off-by: Steve Sakoman <steve@sakoman.com>
-rw-r--r--meta/lib/oeqa/utils/qemurunner.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py
index 09ef9fadb2..79db2cc247 100644
--- a/meta/lib/oeqa/utils/qemurunner.py
+++ b/meta/lib/oeqa/utils/qemurunner.py
@@ -70,6 +70,8 @@ class QemuRunner:
self.monitorpipe = None
self.logger = logger
+ # Whether we're expecting an exit and should show related errors
+ self.canexit = False
# Enable testing other OS's
# Set commands for target communication, and default to Linux ALWAYS
@@ -468,6 +470,7 @@ class QemuRunner:
self.thread.join()
def allowexit(self):
+ self.canexit = True
if self.thread:
self.thread.allowexit()
@@ -526,7 +529,9 @@ class QemuRunner:
if re.search(self.boot_patterns['search_cmd_finished'], data):
break
else:
- raise Exception("No data on serial console socket")
+ if self.canexit:
+ return (1, "")
+ raise Exception("No data on serial console socket, connection closed?")
if data:
if raw: