summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMikko Rapeli <mikko.rapeli@linaro.org>2023-02-09 10:09:34 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-02-10 09:25:44 +0000
commit18bcccc8f8dbf3541e7c7c4dec38b5fe9e2c7f20 (patch)
tree78aba1a298d7652246cb480e78ba1bce49a343ce
parentd61df4b2208a01702ffab344a237cfb2be5d4972 (diff)
downloadpoky-18bcccc8f8dbf3541e7c7c4dec38b5fe9e2c7f20.tar.gz
oeqa qemurunner.py: add timeout to QMP calls
When a qemu machine hangs, the QMP calls can hang for ever too, and when this happens any failing test commands from ssh runner may be followed by dump_monitor() calls which then also hang. Hangs followed by hangs. Use runqemutime at setup and run_monitor() specific timeout for later calls. (From OE-Core rev: 3a07bdf77dc6ecbf4c620b051dd032abaaf1e4ff) Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/lib/oeqa/utils/qemurunner.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py
index 2e054447fc..bce00c696a 100644
--- a/meta/lib/oeqa/utils/qemurunner.py
+++ b/meta/lib/oeqa/utils/qemurunner.py
@@ -350,6 +350,8 @@ class QemuRunner:
350 return False 350 return False
351 351
352 try: 352 try:
353 # set timeout value for all QMP calls
354 self.qmp.settimeout(self.runqemutime)
353 self.qmp.connect() 355 self.qmp.connect()
354 connect_time = time.time() 356 connect_time = time.time()
355 self.logger.info("QMP connected to QEMU at %s and took %s seconds" % 357 self.logger.info("QMP connected to QEMU at %s and took %s seconds" %
@@ -628,6 +630,7 @@ class QemuRunner:
628 630
629 def run_monitor(self, command, args=None, timeout=60): 631 def run_monitor(self, command, args=None, timeout=60):
630 if hasattr(self, 'qmp') and self.qmp: 632 if hasattr(self, 'qmp') and self.qmp:
633 self.qmp.settimeout(timeout)
631 if args is not None: 634 if args is not None:
632 return self.qmp.cmd(command, args) 635 return self.qmp.cmd(command, args)
633 else: 636 else: