Commit 2c435259ae for qemu.org
commit 2c435259ae1de9eb9b43259838fdc9105cd76b3b
Author: Marc-André Lureau <marcandre.lureau@redhat.com>
Date: Sat Sep 5 15:03:23 2026 +0400
tests/functional: add skipTestIfNoHMP() helper
Reviewed-by: Thomas Huth <th.huth+qemu@posteo.eu>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
diff --git a/tests/functional/qemu_test/testcase.py b/tests/functional/qemu_test/testcase.py
index 69d3d06cc0..bf2dc1dc10 100644
--- a/tests/functional/qemu_test/testcase.py
+++ b/tests/functional/qemu_test/testcase.py
@@ -369,6 +369,12 @@ def require_accelerator(self, accelerator):
self.skipTest("%s accelerator does not seem to be "
"available" % accelerator)
+ def skipTestIfNoHMP(self):
+ commands = self.vm.cmd('query-commands')
+ if not any(cmd['name'] == 'human-monitor-command'
+ for cmd in commands):
+ self.skipTest('HMP support is not available')
+
def require_netdev(self, netdevname):
helptxt = run([self.qemu_bin, '-M', 'none', '-netdev', 'help'],
capture_output=True, check=True, encoding='utf8').stdout