mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] test: py: add regression test for missing x86 EFI child devices
@ 2025-08-14  7:15 Ahmad Fatoum
  2025-08-14 10:54 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Ahmad Fatoum @ 2025-08-14  7:15 UTC (permalink / raw)
  To: barebox; +Cc: Tobias Waldekranz, Ahmad Fatoum

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




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] test: py: add regression test for missing x86 EFI child devices
  2025-08-14  7:15 [PATCH] test: py: add regression test for missing x86 EFI child devices Ahmad Fatoum
@ 2025-08-14 10:54 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2025-08-14 10:54 UTC (permalink / raw)
  To: barebox, Ahmad Fatoum; +Cc: Tobias Waldekranz


On Thu, 14 Aug 2025 09:15:33 +0200, Ahmad Fatoum wrote:
> 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.
> 
> [...]

Applied, thanks!

[1/1] test: py: add regression test for missing x86 EFI child devices
      https://git.pengutronix.de/cgit/barebox/commit/?id=6e3b27f11772 (link may not be stable)

Best regards,
-- 
Sascha Hauer <s.hauer@pengutronix.de>




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-08-14 13:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-08-14  7:15 [PATCH] test: py: add regression test for missing x86 EFI child devices Ahmad Fatoum
2025-08-14 10:54 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox