mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 1/3] test: populate qemu_bin, even if missing features
Date: Fri, 28 Nov 2025 18:21:01 +0100	[thread overview]
Message-ID: <20251128172107.35323-1-a.fatoum@pengutronix.de> (raw)

If the YAML lists no features, the lookup for qemu_bin is prematurely
aborted, even for QEMU environment configs.

Split up the try/except clauses to fix this.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 conftest.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/conftest.py b/conftest.py
index fa088b1cac81..55935f7602f7 100644
--- a/conftest.py
+++ b/conftest.py
@@ -134,9 +134,13 @@ def strategy(request, target, pytestconfig):  # noqa: max-complexity=30
     try:
         main = target.env.config.data["targets"]["main"]
         features = main["features"]
-        qemu_bin = main["drivers"]["QEMUDriver"]["qemu_bin"]
     except KeyError:
         features = []
+
+    try:
+        main = target.env.config.data["targets"]["main"]
+        qemu_bin = main["drivers"]["QEMUDriver"]["qemu_bin"]
+    except KeyError:
         qemu_bin = None
 
     virtio = None
-- 
2.47.3




             reply	other threads:[~2025-11-28 17:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-28 17:21 Ahmad Fatoum [this message]
2025-11-28 17:21 ` [PATCH 2/3] test: arm: qemu-sabrelite: drop -nographic Ahmad Fatoum
2025-11-28 17:21 ` [PATCH 3/3] test: arm: qemu-raspi1ap the default multi_v5_v6_defconfig.yaml Ahmad Fatoum
2025-12-01  9:45   ` Sascha Hauer
2025-12-01  9:46     ` Ahmad Fatoum
2025-12-01  9:53 ` [PATCH 1/3] test: populate qemu_bin, even if missing features Sascha Hauer

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=20251128172107.35323-1-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox