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: 0e7aa78b0b ("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>
This commit is contained in:
Vladimir Sementsov-Ogievskiy
2026-07-10 12:03:17 +03:00
committed by Thomas Huth
parent a759542a2c
commit 1531b9ec8c

View File

@@ -325,9 +325,12 @@ def set_machine(self, machinename):
resp = tmp_vm.qmp('query-machines')
machines = resp.get('return', [])
cls._machines = [
m.get('name') for m in machines if 'name' in m
]
cls._machines = []
for m in machines:
if 'name' in m:
cls._machines.append(m['name'])
if 'alias' in m:
cls._machines.append(m['alias'])
finally:
try: