On macOS, plain QEMU binaries are named qemu-system-<arch>-unsigned.

In libqtest, qtest_get_arch() extracts the architecture by splitting
after "-system-", which yields "arm-unsigned" instead of "arm".  This
prevents the QOS graph from matching any machine node, causing all
QOS-based tests to be silently skipped.

In the functional test framework, the same suffix causes the arch to
be parsed as "unsigned", leading to wrong output directories and
teardown failures.

Strip the "-unsigned" suffix on both code paths.

Signed-off-by: Emmanuel Blot <[email protected]>
---
Address issues with liqtest and functional test framework when run from
a macOS host.

Unsigned binaries on macOS may be appended an `-unsigned` suffix, which
confuse these components that rely on the binary name to recover the
guest architecture. 
---
 tests/functional/qemu_test/testcase.py | 2 ++
 tests/qtest/libqtest.c                 | 6 ++++++
 2 files changed, 8 insertions(+)

diff --git a/tests/functional/qemu_test/testcase.py 
b/tests/functional/qemu_test/testcase.py
index eaec1bea13..2885fdd44c 100644
--- a/tests/functional/qemu_test/testcase.py
+++ b/tests/functional/qemu_test/testcase.py
@@ -204,6 +204,8 @@ def setUp(self):
         self.qemu_bin = os.getenv('QEMU_TEST_QEMU_BINARY')
         self.assertIsNotNone(self.qemu_bin, 'QEMU_TEST_QEMU_BINARY must be 
set')
         self.arch = self.qemu_bin.split('-')[-1]
+        if sys.platform == 'darwin' and self.arch == "unsigned":
+            self.arch = self.qemu_bin.split('-')[-2]
         self.socketdir = None
 
         self.outputdir = self.build_file('tests', 'functional',
diff --git a/tests/qtest/libqtest.c b/tests/qtest/libqtest.c
index 4e22c66b75..e31f060152 100644
--- a/tests/qtest/libqtest.c
+++ b/tests/qtest/libqtest.c
@@ -1033,6 +1033,12 @@ const char *qtest_get_arch(void)
             g_auto(GStrv) tokens = g_strsplit_set(sysstr + strlen("-system-"),
                                                   " \t", 2);
             if (tokens && tokens[0]) {
+#ifdef __APPLE__
+                if (g_str_has_suffix(tokens[0], "-unsigned")) {
+                    tokens[0][strlen(tokens[0])
+                              - strlen("-unsigned")] = '\0';
+                }
+#endif
                 arch = g_steal_pointer(&tokens[0]);
             }
         }

---
base-commit: cc329c491768b2d91eb0b0984f3baa0bf805776d
change-id: 20260608-testing-macos-b95676cd3f86

Best regards,
--  
Emmanuel Blot <[email protected]>


Reply via email to