summaryrefslogtreecommitdiffstats
path: root/meta/lib
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-24 16:41:51 +0000
commitf5c3677f705e375d4ceed2dc3574be0642fb7e02 (patch)
tree82677de94858745ef2ea332af2af18021b0e238b /meta/lib
parentd0ae99feb87b44335a8d4ac0f983c84327eabc22 (diff)
downloadpoky-f5c3677f705e375d4ceed2dc3574be0642fb7e02.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: cd6bb88d98b1dc8d751cf75b9ddcca39c84738c6) Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> (cherry picked from commit 3a07bdf77dc6ecbf4c620b051dd032abaaf1e4ff) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-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 3aeef19434..d21b0a275f 100644
--- a/meta/lib/oeqa/utils/qemurunner.py
+++ b/meta/lib/oeqa/utils/qemurunner.py
@@ -346,6 +346,8 @@ class QemuRunner:
346 return False 346 return False
347 347
348 try: 348 try:
349 # set timeout value for all QMP calls
350 self.qmp.settimeout(self.runqemutime)
349 self.qmp.connect() 351 self.qmp.connect()
350 connect_time = time.time() 352 connect_time = time.time()
351 self.logger.info("QMP connected to QEMU at %s and took %s seconds" % 353 self.logger.info("QMP connected to QEMU at %s and took %s seconds" %
@@ -623,6 +625,7 @@ class QemuRunner:
623 625
624 def run_monitor(self, command, args=None, timeout=60): 626 def run_monitor(self, command, args=None, timeout=60):
625 if hasattr(self, 'qmp') and self.qmp: 627 if hasattr(self, 'qmp') and self.qmp:
628 self.qmp.settimeout(timeout)
626 if args is not None: 629 if args is not None:
627 return self.qmp.cmd(command, args) 630 return self.qmp.cmd(command, args)
628 else: 631 else: