mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@barebox.org>
To: barebox@lists.infradead.org
Cc: Tobias Waldekranz <tobias@waldekranz.com>,
	Ahmad Fatoum <a.fatoum@barebox.org>
Subject: [PATCH] test: py: add regression test for missing x86 EFI child devices
Date: Thu, 14 Aug 2025 09:15:33 +0200	[thread overview]
Message-ID: <20250814071533.3917128-1-a.fatoum@barebox.org> (raw)

A bug introduced by commit 4a5a9b58b568 ("drive: bus: make use of new
bus_find_device helper") led to child devices of EFI handles not being
probed.

Let's assert existence of some devices to ensure such issues don't slip
through again. As handles don't have stable names, we don't hardcode
any, but instead look for their virtual child devices that we expect.

Cc: Tobias Waldekranz <tobias@waldekranz.com>
Link: https://lore.barebox.org/barebox/20250813214103.254178-1-tobias@waldekranz.com/T/#u
Signed-off-by: Ahmad Fatoum <a.fatoum@barebox.org>
---
 test/py/test_devices.py        | 12 ++++++++++++
 test/x86/pc@efi_defconfig.yaml |  8 ++++++++
 2 files changed, 20 insertions(+)
 create mode 100644 test/py/test_devices.py

diff --git a/test/py/test_devices.py b/test/py/test_devices.py
new file mode 100644
index 000000000000..8b1df393ed4d
--- /dev/null
+++ b/test/py/test_devices.py
@@ -0,0 +1,12 @@
+# SPDX-License-Identifier: GPL-2.0-only
+
+import pytest
+
+
+def test_devices_present(env, barebox):
+    devices = env.config.data["targets"]["main"].get("devices")
+    if not devices:
+        pytest.skip("No devices listed in YAML to assert existence of")
+
+    for devname in devices.keys():
+        assert devices[devname] in barebox.run_check(f"devinfo {devname}")
diff --git a/test/x86/pc@efi_defconfig.yaml b/test/x86/pc@efi_defconfig.yaml
index 632e72ea7bd9..29e9fa3595b0 100644
--- a/test/x86/pc@efi_defconfig.yaml
+++ b/test/x86/pc@efi_defconfig.yaml
@@ -15,6 +15,14 @@ targets:
       BareboxTestStrategy: {}
     features:
       - pci
+    devices:
+      fb0: 'Type: primary'
+      fbconsole0: 'Parent: fb0'
+      wdog0: 'Parent: efi-wdt'
+      efivarfs0: 'Driver: efivarfs'
+      'pci-8086:1237.0': 'Bus: pci'
+      efifs0: 'Driver: efifs'
+      acpi-APIC0: 'Signature: APIC (Multiple APIC Description Table)'
     runner:
       tuxmake_arch: x86_64
       kconfig_add:
-- 
2.39.5




             reply	other threads:[~2025-08-14  7:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-14  7:15 Ahmad Fatoum [this message]
2025-08-14 10:54 ` 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=20250814071533.3917128-1-a.fatoum@barebox.org \
    --to=a.fatoum@barebox.org \
    --cc=barebox@lists.infradead.org \
    --cc=tobias@waldekranz.com \
    /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