@samitouri / QOSamiQemu / commits / 1531b9ec8c

tests/functional: fix querying available machines

Aliases are not handled, and that's why tests used them are skipped, like this: PYTHONPATH=python:tests/functional \ QEMU_TEST_QEMU_BINARY=$PWD/build/qemu-system-x86_64 \ MESON_BUILD_ROOT=$PWD/build \ ./build/pyvenv/bin/python3 tests/functional/x86_64/test_hotplug_blk.py TAP version 13 ok 1 test_hotplug_blk.HotPlugBlk.test # SKIP no support for machine q35 1..1 Fixes: 0e7aa78b0bee50 ("tests/functional: use QMP to query available machines") Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru> Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-ID: <20260710090317.498350-1-vsementsov@yandex-team.ru> Signed-off-by: Thomas Huth <th.huth@posteo.eu>

Vladimir Sementsov-Ogievskiy committed Jul 10, 2026 at 12:03 UTC 1531b9ec8c2e7033cbb737e2428827677be0a1b0
1 file changed +6 -3
tests/functional/qemu_test/testcase.py
+6 -3
@@ -325,9 +325,12 @@ class QemuSystemTest(QemuBaseTest):
325 resp = tmp_vm.qmp('query-machines')
326
327 machines = resp.get('return', [])
328 - cls._machines = [
329 - m.get('name') for m in machines if 'name' in m
330 - ]
328 + cls._machines = []
329 + for m in machines:
330 + if 'name' in m:
331 + cls._machines.append(m['name'])
332 + if 'alias' in m:
333 + cls._machines.append(m['alias'])
334
335 finally:
336 try: