summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/utils/qemurunner.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2021-05-09 10:59:44 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-05-09 23:30:14 +0100
commitb681827f5b1359bc9beb990b4586bdec62a7a46e (patch)
tree84e3cc548199fa89a43711ce3f5acce850ca6b77 /meta/lib/oeqa/utils/qemurunner.py
parent4a3a0e7838f36fd1d5b8b54c69b92fc376938fcc (diff)
downloadpoky-b681827f5b1359bc9beb990b4586bdec62a7a46e.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. (From OE-Core rev: 396a3ba884820d040c91f7592daf20ac28c49b5d) 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.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 899152c7ad..4f094e29c7 100644
--- a/meta/lib/oeqa/utils/qemurunner.py
+++ b/meta/lib/oeqa/utils/qemurunner.py
@@ -73,6 +73,8 @@ class QemuRunner:
73 self.monitorpipe = None 73 self.monitorpipe = None
74 74
75 self.logger = logger 75 self.logger = logger
76 # Whether we're expecting an exit and should show related errors
77 self.canexit = False
76 78
77 # Enable testing other OS's 79 # Enable testing other OS's
78 # Set commands for target communication, and default to Linux ALWAYS 80 # Set commands for target communication, and default to Linux ALWAYS
@@ -543,6 +545,7 @@ class QemuRunner:
543 self.thread.join() 545 self.thread.join()
544 546
545 def allowexit(self): 547 def allowexit(self):
548 self.canexit = True
546 if self.thread: 549 if self.thread:
547 self.thread.allowexit() 550 self.thread.allowexit()
548 551
@@ -604,7 +607,9 @@ class QemuRunner:
604 if re.search(self.boot_patterns['search_cmd_finished'], data): 607 if re.search(self.boot_patterns['search_cmd_finished'], data):
605 break 608 break
606 else: 609 else:
607 raise Exception("No data on serial console socket") 610 if self.canexit:
611 return (1, "")
612 raise Exception("No data on serial console socket, connection closed?")
608 613
609 if data: 614 if data:
610 if raw: 615 if raw: