All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tests: strip macOS "-unsigned" suffix from binary name
@ 2026-06-08 15:24 Emmanuel Blot
  2026-06-08 15:29 ` Peter Maydell
  0 siblings, 1 reply; 8+ messages in thread
From: Emmanuel Blot @ 2026-06-08 15:24 UTC (permalink / raw)
  To: qemu-devel
  Cc: Thomas Huth, Philippe Mathieu-Daudé, Daniel P. Berrangé,
	Fabiano Rosas, Laurent Vivier, Paolo Bonzini, Emmanuel Blot

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 <eblot@meta.com>
---
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 <eblot@meta.com>



^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-06-08 17:40 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-08 15:24 [PATCH] tests: strip macOS "-unsigned" suffix from binary name Emmanuel Blot
2026-06-08 15:29 ` Peter Maydell
2026-06-08 15:35   ` Daniel P. Berrangé
2026-06-08 15:38     ` Peter Maydell
2026-06-08 15:56       ` Emmanuel Blot
2026-06-08 16:08         ` Peter Maydell
2026-06-08 16:43           ` Pierrick Bouvier
2026-06-08 17:39             ` Peter Maydell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.