From patchwork Mon Feb 16 01:34:51 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1883 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1771205741; bh=CeAekYYT6CrmHa/7GR28r1nZ57yeeU5ou+LbhBU8jkM=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=TzPC9Bf3YnwkDQvLfnRJJu75jbGXVOl98ozPRAmTm3BFukQ4ZPueSrDAzYqVTP3Fp BbBkfGyq5hUXYtb+NGghwXn71O2aDihp4sCvWbb4lvHFDJ6GK7yjVQoQhSlDgUJuEt uTHDo51g80cmQ41WFMaP86e0B7XE4rbRcxBSGSd5HLKKYARhnEd+V9OZpgkmDsgcu3 CbkOTuh6+vwfEr2sPSRxMSomUMVCs+DJSexZXsiAxYbFeSDFdvWhTJyySN/1YzH629 ljp728Q91BR85Xk7NxKMCREdZV3OAyfeuf4CeLEeIaXTeoXr7QsPgu+n62XHjmewAx CQuqnbf4A0mKA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id AAA3369BCC for ; Sun, 15 Feb 2026 18:35:41 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id M9NWZDCa47ST for ; Sun, 15 Feb 2026 18:35:41 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1771205741; bh=CeAekYYT6CrmHa/7GR28r1nZ57yeeU5ou+LbhBU8jkM=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=TzPC9Bf3YnwkDQvLfnRJJu75jbGXVOl98ozPRAmTm3BFukQ4ZPueSrDAzYqVTP3Fp BbBkfGyq5hUXYtb+NGghwXn71O2aDihp4sCvWbb4lvHFDJ6GK7yjVQoQhSlDgUJuEt uTHDo51g80cmQ41WFMaP86e0B7XE4rbRcxBSGSd5HLKKYARhnEd+V9OZpgkmDsgcu3 CbkOTuh6+vwfEr2sPSRxMSomUMVCs+DJSexZXsiAxYbFeSDFdvWhTJyySN/1YzH629 ljp728Q91BR85Xk7NxKMCREdZV3OAyfeuf4CeLEeIaXTeoXr7QsPgu+n62XHjmewAx CQuqnbf4A0mKA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 99FB969BCE for ; Sun, 15 Feb 2026 18:35:41 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1771205740; bh=2twAtSfiJxGDWwaq6dm0gR7EEkEZCnDYVW8ytP17Vz8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fAuHveebVbec9wlrJWlWumR4l5NR+rkCyR+xtcxMS1HYNq538O5yRli2DLaAshOK+ DU8JbUAIGq0ja2A8sdlfYdg+0sr5IMcSP9BW8ZZapMFuq/mGpHWaEHQo9csXKm55yA xO6mGZWlsU2jSppjFReYjffD/t7YJ/q+Pa6MADqGLWAy/UENcOkDU3XA29pleaO31y Gfkr66zms6d0q3xZfKemrqZNXKmPyrk5SBV9np4pF81pArGKf9DPE3SK+DeYtibpvb pBB1eX0vUZj+ra8Bma1E6vWqWu/cdjViwSmTcQQE05yeV41Buju7w4KYvSMJOYek31 LhPjjp1W1C+LA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id C05C069B01; Sun, 15 Feb 2026 18:35:40 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id xGbNMmFTZNbX; Sun, 15 Feb 2026 18:35:40 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1771205735; bh=JsZJsCjy4TV9+tOyJOEbhGC9mq3ZpHiAiUVwOUj7PaA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UrWXx8ghC7BPfEaxGbINe0FsEo0OrsTSHHTspXB9r3fsbqD0xXBDQUn1Xx/339WDD mMZa0HP83RrpHa7/KvAC0v2MD4gfY8smIlpuIN6uUJssD0tR5SEsZffXfzSW6S6r3E fBnsJs3HL73abWPXu2x8lG8Z9NAjOnPqd82WVtNcJRlXroxsPPoFaen9HE0PbuA95d L7wmREYg0Q3bhagqfBGU7dCJkaLHWgFlWV7/Ayz1/gijfpNwfxTTzTD+8OpziH49hV iQiZF18KUclx9CQBY76erJ5sIgNEqBhGARtIYlIjAcc75Kn/eI/wANqF4G3dyNyXVH J/BXlib6lOEsw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id EDD1069AD9; Sun, 15 Feb 2026 18:35:34 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 15 Feb 2026 18:34:51 -0700 Message-ID: <20260216013511.4079770-4-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260216013511.4079770-1-sjg@u-boot.org> References: <20260216013511.4079770-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: XVYVBYDRL62F6Z2HDI2UDZ7GMPQCIOLV X-Message-ID-Hash: XVYVBYDRL62F6Z2HDI2UDZ7GMPQCIOLV X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 03/17] ulib: test: Add localqemu marker to skip tests in lab List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Some tests launch their own QEMU process via subprocess rather than using the lab's managed U-Boot instance. In lab mode the locally launched QEMU produces empty output, causing assertion failures. There isn't really any point in running these tests on the lab since they run happily in CI. Add a 'localqemu' pytest marker and the corresponding setup_localqemu() hook in conftest.py that skips marked tests when ubconfig.role is set. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- doc/develop/pytest/usage.rst | 9 +++++++++ test/py/conftest.py | 15 +++++++++++++++ test/py/pytest.ini | 1 + test/py/tests/test_ulib.py | 1 + 4 files changed, 26 insertions(+) diff --git a/doc/develop/pytest/usage.rst b/doc/develop/pytest/usage.rst index 9ba6ed429a9..32037d47dcd 100644 --- a/doc/develop/pytest/usage.rst +++ b/doc/develop/pytest/usage.rst @@ -596,3 +596,12 @@ option not to be set. The following annotation requires CONFIG_RISCV=n: .. code-block:: python @pytest.mark.notbuildconfigspec('riscv') + +The localqemu marker indicates that a test launches its own QEMU process +rather than using the lab's managed U-Boot instance. Tests with this marker +are automatically skipped when running in lab mode (i.e. when ``--role`` is +set), since the locally launched QEMU is not available in that environment: + +.. code-block:: python + + @pytest.mark.localqemu diff --git a/test/py/conftest.py b/test/py/conftest.py index eb64f2a82be..b7a03669751 100644 --- a/test/py/conftest.py +++ b/test/py/conftest.py @@ -818,6 +818,20 @@ def setup_role(item): if required_roles and ubconfig.role not in required_roles: pytest.skip(f'board "{ubconfig.role}" not supported') +def setup_localqemu(item): + """Process any 'localqemu' marker for a test. + + Skip this test if running in lab mode (i.e. role is set), since the + test launches its own QEMU rather than using the lab's U-Boot. + + Args: + item (pytest.Item): The pytest test item + """ + for _ in item.iter_markers('localqemu'): + if ubconfig.role: + pytest.skip('test requires local QEMU (not supported in lab)') + return + def start_test_section(item): anchors[item.name] = log.start_section(item.name) @@ -840,6 +854,7 @@ def pytest_runtest_setup(item): setup_requiredtool(item) setup_singlethread(item) setup_role(item) + setup_localqemu(item) def pytest_runtest_protocol(item, nextitem): """pytest hook: Called to execute a test. diff --git a/test/py/pytest.ini b/test/py/pytest.ini index 0a0268ec247..bebb22cd3d6 100644 --- a/test/py/pytest.ini +++ b/test/py/pytest.ini @@ -14,3 +14,4 @@ markers = slow: U-Boot: Specific test will run slowly. singlethread: Cannot run in parallel role: U-Boot: Indicates the lab 'role' which can execute this test + localqemu: U-Boot: Test launches its own QEMU, skip in lab mode diff --git a/test/py/tests/test_ulib.py b/test/py/tests/test_ulib.py index aff586c4d79..16af47fd840 100644 --- a/test/py/tests/test_ulib.py +++ b/test/py/tests/test_ulib.py @@ -210,6 +210,7 @@ def test_ulib_api_header(ubman): assert 'ub_snprintf(char *buf, size_t size, const char *fmt, ...)' in out assert 'ub_vprintf(const char *fmt, va_list args)' in out +@pytest.mark.localqemu @pytest.mark.boardspec('qemu-x86') @pytest.mark.buildconfigspec("examples") def test_ulib_demo_rom(ubman):