[PATCH 2/2] efi_selftest: test specific LoadImage() case

Vincent Stehlé vincent.stehle at arm.com
Mon Feb 16 12:30:17 CET 2026


Add a test calling the LoadImage() UEFI function with both its SourceBuffer
and DevicePath input arguments equal to NULL.

This test can be run on the sandbox with the following command:

  ./u-boot -T -c "setenv efi_selftest load image from file; \
                  bootefi selftest"

Signed-off-by: Vincent Stehlé <vincent.stehle at arm.com>
Cc: Heinrich Schuchardt <xypron.glpk at gmx.de>
Cc: Ilias Apalodimas <ilias.apalodimas at linaro.org>
Cc: Tom Rini <trini at konsulko.com>
---
 lib/efi_selftest/efi_selftest_loadimage.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/lib/efi_selftest/efi_selftest_loadimage.c b/lib/efi_selftest/efi_selftest_loadimage.c
index 967eaa58c69..0e8fc6216f0 100644
--- a/lib/efi_selftest/efi_selftest_loadimage.c
+++ b/lib/efi_selftest/efi_selftest_loadimage.c
@@ -562,6 +562,13 @@ static int execute(void)
 		return EFI_ST_FAILURE;
 	}
 
+	ret = boottime->load_image(false, handle_image, NULL, NULL, 0,
+				   &handle);
+	if (ret != EFI_NOT_FOUND) {
+		efi_st_error("Unexpected load_image return value\n");
+		return EFI_ST_FAILURE;
+	}
+
 	return EFI_ST_SUCCESS;
 }
 
-- 
2.51.0



More information about the U-Boot mailing list