[PATCH v2025.09.y 34/49] test: populate qemu_bin, even if missing features

Ahmad Fatoum a.fatoum at pengutronix.de
Fri Dec 19 01:21:10 PST 2025


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 at pengutronix.de>
Link: https://lore.barebox.org/20251128172107.35323-1-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
(cherry picked from commit 0f474e5b689fc22990abe83984aeef12349ddaef)
Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
 conftest.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/conftest.py b/conftest.py
index 06321c938dba..2f72d3fe5322 100644
--- a/conftest.py
+++ b/conftest.py
@@ -128,9 +128,13 @@ def strategy(request, target, pytestconfig):
     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




More information about the barebox mailing list