All of lore.kernel.org
 help / color / mirror / Atom feed
From: Emmanuel Blot <eblot@meta.com>
To: <qemu-devel@nongnu.org>
Cc: "Thomas Huth" <th.huth+qemu@posteo.eu>,
	"Philippe Mathieu-Daudé" <philmd@mailo.com>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	"Fabiano Rosas" <farosas@suse.de>,
	"Laurent Vivier" <lvivier@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Emmanuel Blot" <eblot@meta.com>
Subject: [PATCH] tests: strip macOS "-unsigned" suffix from binary name
Date: Mon, 8 Jun 2026 17:24:24 +0200	[thread overview]
Message-ID: <20260608-testing-macos-v1-1-42774498936f@meta.com> (raw)

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>



             reply	other threads:[~2026-06-08 15:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-08 15:24 Emmanuel Blot [this message]
2026-06-08 15:29 ` [PATCH] tests: strip macOS "-unsigned" suffix from binary name 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260608-testing-macos-v1-1-42774498936f@meta.com \
    --to=eblot@meta.com \
    --cc=berrange@redhat.com \
    --cc=farosas@suse.de \
    --cc=lvivier@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=philmd@mailo.com \
    --cc=qemu-devel@nongnu.org \
    --cc=th.huth+qemu@posteo.eu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.