diff mbox series

[1/2] selftest: uboot: Test UBOOT_ELF

Message ID 20261129000720.272757-1-marek.vasut@mailbox.org
State New
Headers show
Series [1/2] selftest: uboot: Test UBOOT_ELF | expand

Commit Message

Marek Vasut Nov. 29, 2026, 12:07 a.m. UTC
Test handling of UBOOT_ELF , which is a configuration that ships
u-boot.elf alongside U-Boot build artifacts. The u-boot.elf may not
be built by default, so build it explicitly via UBOOT_MAKE_TARGET.
Test for the u-boot.elf file existence after the build.

Signed-off-by: Marek Vasut <marek.vasut@mailbox.org>
---
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Ross Burton <ross.burton@arm.com>
Cc: Ryan Eatmon <reatmon@ti.com>
Cc: Yoann Congal <yoann.congal@smile.fr>
---
 meta/lib/oeqa/selftest/cases/uboot.py | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
diff mbox series

Patch

diff --git a/meta/lib/oeqa/selftest/cases/uboot.py b/meta/lib/oeqa/selftest/cases/uboot.py
index 847fa205a13..fc2aea7d03a 100644
--- a/meta/lib/oeqa/selftest/cases/uboot.py
+++ b/meta/lib/oeqa/selftest/cases/uboot.py
@@ -98,6 +98,26 @@  QB_DRIVE_TYPE = "/dev/vd"
             # with KVM enabled
             self.assertTrue("KVM: hypervisor services detected" in output, msg=output)
 
+    def test_uboot_elf_binary(self):
+        """
+        Tests building the U-Boot u-boot.elf file.
+        """
+
+        self.write_config(textwrap.dedent("""
+            UBOOT_MAKE_TARGET = "u-boot.elf"
+            UBOOT_ELF = "u-boot.elf"
+        """))
+
+        bitbake("u-boot")
+
+        bb_vars = get_bb_vars(["DEPLOYDIR", "UBOOT_ELF_BINARY"], "u-boot")
+
+        uboot_elf_binary_path = os.path.realpath(os.path.join(
+            bb_vars["DEPLOYDIR"], bb_vars["UBOOT_ELF_BINARY"]
+        ))
+
+        self.assertExists(uboot_elf_binary_path)
+
     def test_uboot_initial_env_binary(self):
         """
         Tests building the initial U-Boot environment in binary format with