From: Vladimir Sementsov-Ogievskiy <[email protected]>

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 <[email protected]>
Reviewed-by: Philippe Mathieu-DaudĂ© <[email protected]>
Reviewed-by: Daniel P. BerrangĂ© <[email protected]>
Message-ID: <[email protected]>
Signed-off-by: Thomas Huth <[email protected]>
---
 tests/functional/qemu_test/testcase.py | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/tests/functional/qemu_test/testcase.py 
b/tests/functional/qemu_test/testcase.py
index 4912a47a46..e4179d165c 100644
--- a/tests/functional/qemu_test/testcase.py
+++ b/tests/functional/qemu_test/testcase.py
@@ -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:
-- 
2.54.0


Reply via email to