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 <tob...@waldekranz.com>
Link: 
https://lore.barebox.org/barebox/20250813214103.254178-1-tob...@waldekranz.com/T/#u
Signed-off-by: Ahmad Fatoum <a.fat...@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 via email to