Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] support/testing: test_edk2: add a few build tests
@ 2025-04-11 15:53 Vincent Stehlé
  2025-04-19 16:37 ` Thomas Petazzoni via buildroot
  2025-05-02 10:29 ` Arnout Vandecappelle via buildroot
  0 siblings, 2 replies; 3+ messages in thread
From: Vincent Stehlé @ 2025-04-11 15:53 UTC (permalink / raw)
  To: buildroot; +Cc: Vincent Stehlé, Dick Olsson

Some EDK II configurations have complex dependencies on several packages
and additional build options; build tests help keeping track of those
more easily.

Factorize some code common to all the build tests into a new
TestEdk2BuildBase class, which defines a base configuration and a method
to assert that binaries do indeed exist after the build.

While at it, add myself in DEVELOPERS.

Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com>
Cc: Dick Olsson <hi@senzilla.io>
---


Hi,

I will also send a build test for the MACCHIATObin platform later on,
after a couple of fixes have been integrated. [1][2]

Best regards,
Vincent.

[1] https://patchwork.ozlabs.org/project/buildroot/patch/20250411125452.1377323-1-vincent.stehle@arm.com/
[2] https://patchwork.ozlabs.org/project/buildroot/patch/20250410153114.1374261-1-vincent.stehle@arm.com/


 DEVELOPERS                              |   1 +
 support/testing/tests/boot/test_edk2.py | 101 ++++++++++++++++++++++++
 2 files changed, 102 insertions(+)

diff --git a/DEVELOPERS b/DEVELOPERS
index 1c84f95943..1e6a029512 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -3350,6 +3350,7 @@ F:	configs/qemu_aarch64_ebbr_defconfig
 F:	configs/qemu_arm_ebbr_defconfig
 F:	configs/rockpro64_ebbr_defconfig
 F:	package/edk2-non-osi/
+F:	support/testing/tests/boot/test_edk2.py
 
 N:	Vincent Stehlé <vincent.stehle@laposte.net>
 F:	board/arm/foundation-v8/
diff --git a/support/testing/tests/boot/test_edk2.py b/support/testing/tests/boot/test_edk2.py
index 90583b56fe..4e0942b3a4 100644
--- a/support/testing/tests/boot/test_edk2.py
+++ b/support/testing/tests/boot/test_edk2.py
@@ -48,3 +48,104 @@ class TestEdk2(infra.basetest.BRTest):
                                     "-pflash", flash1,
                                     "-hda", hda])
         self.emulator.login()
+
+
+class TestEdk2BuildBase(infra.basetest.BRTest):
+    """A class to test the build of various edk2 platforms."""
+    base_config = \
+        """
+        # BR2_PACKAGE_BUSYBOX is not set
+        # BR2_PACKAGE_IFUPDOWN_SCRIPTS is not set
+        # BR2_TARGET_ROOTFS_TAR is not set
+        BR2_INIT_NONE=y
+        BR2_SYSTEM_BIN_SH_NONE=y
+        BR2_TARGET_EDK2=y
+        BR2_TOOLCHAIN_EXTERNAL=y
+        """
+
+    def assertBinariesExist(self, *binaries: str) -> None:
+        """Assert that the binaries passed as argument exist
+        under the images folder.
+        We print a message to the emulator logfile for each binary found.
+        """
+        for binary in binaries:
+            binpath = os.path.join(self.builddir, "images", binary)
+            self.assertTrue(os.path.exists(binpath), f"Missing {binpath}!")
+            print(f"{binary} exists: {binpath}", file=self.emulator.logfile,
+                  flush=True)
+
+
+class TestEdk2BuildArmVirtQemu(TestEdk2BuildBase):
+    config = TestEdk2BuildBase.base_config + \
+        """
+        BR2_aarch64=y
+        BR2_TARGET_EDK2_PLATFORM_ARM_VIRT_QEMU=y
+        """
+
+    def test_run(self) -> None:
+        self.assertBinariesExist("QEMU_EFI.fd", "QEMU_VARS.fd")
+
+
+class TestEdk2BuildArmVirtQemuKernel(TestEdk2BuildBase):
+    config = TestEdk2BuildBase.base_config + \
+        """
+        BR2_aarch64=y
+        BR2_TARGET_EDK2_PLATFORM_ARM_VIRT_QEMU_KERNEL=y
+        """
+
+    def test_run(self) -> None:
+        self.assertBinariesExist("QEMU_EFI.fd", "QEMU_VARS.fd")
+
+
+class TestEdk2BuildArmSgi575(TestEdk2BuildBase):
+    config = TestEdk2BuildBase.base_config + \
+        """
+        BR2_aarch64=y
+        BR2_TARGET_EDK2_PLATFORM_ARM_SGI575=y
+        """
+
+    def test_run(self) -> None:
+        self.assertBinariesExist("BL33_AP_UEFI.fd")
+
+
+class TestEdk2BuildArmVexpressFvpAarch64(TestEdk2BuildBase):
+    config = TestEdk2BuildBase.base_config + \
+        """
+        BR2_aarch64=y
+        BR2_TARGET_EDK2_PLATFORM_ARM_VEXPRESS_FVP_AARCH64=y
+        """
+
+    def test_run(self) -> None:
+        self.assertBinariesExist("FVP_AARCH64_EFI.fd")
+
+
+class TestEdk2BuildSocionextDeveloperbox(TestEdk2BuildBase):
+    config = TestEdk2BuildBase.base_config + \
+        """
+        BR2_aarch64=y
+        BR2_TARGET_EDK2_PLATFORM_SOCIONEXT_DEVELOPERBOX=y
+        BR2_TARGET_ARM_TRUSTED_FIRMWARE=y
+        BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="synquacer"
+        BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL31=y
+        BR2_TARGET_ARM_TRUSTED_FIRMWARE_ADDITIONAL_TARGETS="PRELOADED_BL33_BASE=0x8200000"
+        """
+
+    def test_run(self) -> None:
+        self.assertBinariesExist("SPI_NOR_IMAGE.fd", "fip.bin")
+
+
+class TestEdk2BuildQemuSbsa(TestEdk2BuildBase):
+    # This configuration is not exactly identical to the configuration built
+    # during TestEdk2, as we use the latest arm-trusted-firmware version, among
+    # other things.
+    config = TestEdk2BuildBase.base_config + \
+        """
+        BR2_aarch64=y
+        BR2_TARGET_EDK2_PLATFORM_QEMU_SBSA=y
+        BR2_TARGET_ARM_TRUSTED_FIRMWARE=y
+        BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="qemu_sbsa"
+        BR2_TARGET_ARM_TRUSTED_FIRMWARE_FIP=y
+        """
+
+    def test_run(self) -> None:
+        self.assertBinariesExist("SBSA_FLASH0.fd", "SBSA_FLASH1.fd", "fip.bin")
-- 
2.47.2

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH] support/testing: test_edk2: add a few build tests
  2025-04-11 15:53 [Buildroot] [PATCH] support/testing: test_edk2: add a few build tests Vincent Stehlé
@ 2025-04-19 16:37 ` Thomas Petazzoni via buildroot
  2025-05-02 10:29 ` Arnout Vandecappelle via buildroot
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Petazzoni via buildroot @ 2025-04-19 16:37 UTC (permalink / raw)
  To: Vincent Stehlé; +Cc: buildroot, Dick Olsson

On Fri, 11 Apr 2025 17:53:14 +0200
Vincent Stehlé <vincent.stehle@arm.com> wrote:

> Some EDK II configurations have complex dependencies on several packages
> and additional build options; build tests help keeping track of those
> more easily.
> 
> Factorize some code common to all the build tests into a new
> TestEdk2BuildBase class, which defines a base configuration and a method
> to assert that binaries do indeed exist after the build.
> 
> While at it, add myself in DEVELOPERS.
> 
> Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com>
> Cc: Dick Olsson <hi@senzilla.io>
> ---

Applied to master, thanks.

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH] support/testing: test_edk2: add a few build tests
  2025-04-11 15:53 [Buildroot] [PATCH] support/testing: test_edk2: add a few build tests Vincent Stehlé
  2025-04-19 16:37 ` Thomas Petazzoni via buildroot
@ 2025-05-02 10:29 ` Arnout Vandecappelle via buildroot
  1 sibling, 0 replies; 3+ messages in thread
From: Arnout Vandecappelle via buildroot @ 2025-05-02 10:29 UTC (permalink / raw)
  To: Vincent Stehlé, buildroot; +Cc: Dick Olsson



On 11/04/2025 17:53, Vincent Stehlé wrote:
> Some EDK II configurations have complex dependencies on several packages
> and additional build options; build tests help keeping track of those
> more easily.
> 
> Factorize some code common to all the build tests into a new
> TestEdk2BuildBase class, which defines a base configuration and a method
> to assert that binaries do indeed exist after the build.
> 
> While at it, add myself in DEVELOPERS.
> 
> Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com>
> Cc: Dick Olsson <hi@senzilla.io>

  Applied to 2025.02.x, thanks.

  Regards,
  Arnout

> ---
> 
> 
> Hi,
> 
> I will also send a build test for the MACCHIATObin platform later on,
> after a couple of fixes have been integrated. [1][2]
> 
> Best regards,
> Vincent.
> 
> [1] https://patchwork.ozlabs.org/project/buildroot/patch/20250411125452.1377323-1-vincent.stehle@arm.com/
> [2] https://patchwork.ozlabs.org/project/buildroot/patch/20250410153114.1374261-1-vincent.stehle@arm.com/
> 
> 
>   DEVELOPERS                              |   1 +
>   support/testing/tests/boot/test_edk2.py | 101 ++++++++++++++++++++++++
>   2 files changed, 102 insertions(+)
> 
> diff --git a/DEVELOPERS b/DEVELOPERS
> index 1c84f95943..1e6a029512 100644
> --- a/DEVELOPERS
> +++ b/DEVELOPERS
> @@ -3350,6 +3350,7 @@ F:	configs/qemu_aarch64_ebbr_defconfig
>   F:	configs/qemu_arm_ebbr_defconfig
>   F:	configs/rockpro64_ebbr_defconfig
>   F:	package/edk2-non-osi/
> +F:	support/testing/tests/boot/test_edk2.py
>   
>   N:	Vincent Stehlé <vincent.stehle@laposte.net>
>   F:	board/arm/foundation-v8/
> diff --git a/support/testing/tests/boot/test_edk2.py b/support/testing/tests/boot/test_edk2.py
> index 90583b56fe..4e0942b3a4 100644
> --- a/support/testing/tests/boot/test_edk2.py
> +++ b/support/testing/tests/boot/test_edk2.py
> @@ -48,3 +48,104 @@ class TestEdk2(infra.basetest.BRTest):
>                                       "-pflash", flash1,
>                                       "-hda", hda])
>           self.emulator.login()
> +
> +
> +class TestEdk2BuildBase(infra.basetest.BRTest):
> +    """A class to test the build of various edk2 platforms."""
> +    base_config = \
> +        """
> +        # BR2_PACKAGE_BUSYBOX is not set
> +        # BR2_PACKAGE_IFUPDOWN_SCRIPTS is not set
> +        # BR2_TARGET_ROOTFS_TAR is not set
> +        BR2_INIT_NONE=y
> +        BR2_SYSTEM_BIN_SH_NONE=y
> +        BR2_TARGET_EDK2=y
> +        BR2_TOOLCHAIN_EXTERNAL=y
> +        """
> +
> +    def assertBinariesExist(self, *binaries: str) -> None:
> +        """Assert that the binaries passed as argument exist
> +        under the images folder.
> +        We print a message to the emulator logfile for each binary found.
> +        """
> +        for binary in binaries:
> +            binpath = os.path.join(self.builddir, "images", binary)
> +            self.assertTrue(os.path.exists(binpath), f"Missing {binpath}!")
> +            print(f"{binary} exists: {binpath}", file=self.emulator.logfile,
> +                  flush=True)
> +
> +
> +class TestEdk2BuildArmVirtQemu(TestEdk2BuildBase):
> +    config = TestEdk2BuildBase.base_config + \
> +        """
> +        BR2_aarch64=y
> +        BR2_TARGET_EDK2_PLATFORM_ARM_VIRT_QEMU=y
> +        """
> +
> +    def test_run(self) -> None:
> +        self.assertBinariesExist("QEMU_EFI.fd", "QEMU_VARS.fd")
> +
> +
> +class TestEdk2BuildArmVirtQemuKernel(TestEdk2BuildBase):
> +    config = TestEdk2BuildBase.base_config + \
> +        """
> +        BR2_aarch64=y
> +        BR2_TARGET_EDK2_PLATFORM_ARM_VIRT_QEMU_KERNEL=y
> +        """
> +
> +    def test_run(self) -> None:
> +        self.assertBinariesExist("QEMU_EFI.fd", "QEMU_VARS.fd")
> +
> +
> +class TestEdk2BuildArmSgi575(TestEdk2BuildBase):
> +    config = TestEdk2BuildBase.base_config + \
> +        """
> +        BR2_aarch64=y
> +        BR2_TARGET_EDK2_PLATFORM_ARM_SGI575=y
> +        """
> +
> +    def test_run(self) -> None:
> +        self.assertBinariesExist("BL33_AP_UEFI.fd")
> +
> +
> +class TestEdk2BuildArmVexpressFvpAarch64(TestEdk2BuildBase):
> +    config = TestEdk2BuildBase.base_config + \
> +        """
> +        BR2_aarch64=y
> +        BR2_TARGET_EDK2_PLATFORM_ARM_VEXPRESS_FVP_AARCH64=y
> +        """
> +
> +    def test_run(self) -> None:
> +        self.assertBinariesExist("FVP_AARCH64_EFI.fd")
> +
> +
> +class TestEdk2BuildSocionextDeveloperbox(TestEdk2BuildBase):
> +    config = TestEdk2BuildBase.base_config + \
> +        """
> +        BR2_aarch64=y
> +        BR2_TARGET_EDK2_PLATFORM_SOCIONEXT_DEVELOPERBOX=y
> +        BR2_TARGET_ARM_TRUSTED_FIRMWARE=y
> +        BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="synquacer"
> +        BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL31=y
> +        BR2_TARGET_ARM_TRUSTED_FIRMWARE_ADDITIONAL_TARGETS="PRELOADED_BL33_BASE=0x8200000"
> +        """
> +
> +    def test_run(self) -> None:
> +        self.assertBinariesExist("SPI_NOR_IMAGE.fd", "fip.bin")
> +
> +
> +class TestEdk2BuildQemuSbsa(TestEdk2BuildBase):
> +    # This configuration is not exactly identical to the configuration built
> +    # during TestEdk2, as we use the latest arm-trusted-firmware version, among
> +    # other things.
> +    config = TestEdk2BuildBase.base_config + \
> +        """
> +        BR2_aarch64=y
> +        BR2_TARGET_EDK2_PLATFORM_QEMU_SBSA=y
> +        BR2_TARGET_ARM_TRUSTED_FIRMWARE=y
> +        BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="qemu_sbsa"
> +        BR2_TARGET_ARM_TRUSTED_FIRMWARE_FIP=y
> +        """
> +
> +    def test_run(self) -> None:
> +        self.assertBinariesExist("SBSA_FLASH0.fd", "SBSA_FLASH1.fd", "fip.bin")

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

end of thread, other threads:[~2025-05-02 10:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-11 15:53 [Buildroot] [PATCH] support/testing: test_edk2: add a few build tests Vincent Stehlé
2025-04-19 16:37 ` Thomas Petazzoni via buildroot
2025-05-02 10:29 ` Arnout Vandecappelle via buildroot

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