summaryrefslogtreecommitdiff
path: root/test/boot/bootdev.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2024-11-09 08:05:41 -0600
committerTom Rini <trini@konsulko.com>2024-11-09 08:05:41 -0600
commitf448c4517b55f4018271cdf014615eb54121d863 (patch)
treeb7974f966aacb07af9630b3c3e8cd0be56e17e61 /test/boot/bootdev.c
parenta7a96a37cbd875994bc8d25adb0536bf00e4a30e (diff)
parent70b78d52937b5f18afbbc4257bd3b89b0e75a186 (diff)
Merge tag 'efi-2025-01-rc2-2' of https://source.denx.de/u-boot/custodians/u-boot-efi
Pull request efi-2025-01-rc2-2 Documentation: * correct title and author of rst2pdf generated pdf * describe CONFIG_DEBUG_SBI_CONSOLE * remove vile language UEFI * correct printf codes in mkeficapsule * add an EFI test app * move default filename to a function * move get_efi_pxe_arch() to efi_helper * allow reporting the host defaults in efidebug * drop sandbox PXE architecture Other: * do not reserve extra 16 KiB of stack in lmb * disable the sandbox virtio blk device * provide -N command line flag to control EFI default boot file name on the sandbox * provide a unit test for the efi bootmeth
Diffstat (limited to 'test/boot/bootdev.c')
-rw-r--r--test/boot/bootdev.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/test/boot/bootdev.c b/test/boot/bootdev.c
index 369c611d924..8c44afd9297 100644
--- a/test/boot/bootdev.c
+++ b/test/boot/bootdev.c
@@ -221,6 +221,10 @@ static int bootdev_test_order(struct unit_test_state *uts)
/* Use the environment variable to override it */
ut_assertok(env_set("boot_targets", "mmc1 mmc2 usb"));
ut_assertok(bootflow_scan_first(NULL, NULL, &iter, 0, &bflow));
+
+ /* get the usb device which has a backing file (flash1.img) */
+ ut_asserteq(0, bootflow_scan_next(&iter, &bflow));
+
ut_asserteq(-ENODEV, bootflow_scan_next(&iter, &bflow));
ut_asserteq(5, iter.num_devs);
ut_asserteq_str("mmc1.bootdev", iter.dev_used[0]->name);
@@ -260,7 +264,11 @@ static int bootdev_test_order(struct unit_test_state *uts)
ut_assertok(bootflow_scan_first(NULL, NULL, &iter, 0, &bflow));
ut_asserteq(2, iter.num_devs);
- /* Now scan past mmc1 and make sure that the 3 USB devices show up */
+ /*
+ * Now scan past mmc1 and make sure that the 3 USB devices show up. The
+ * first one has a backing file so returns success
+ */
+ ut_asserteq(0, bootflow_scan_next(&iter, &bflow));
ut_asserteq(-ENODEV, bootflow_scan_next(&iter, &bflow));
ut_asserteq(6, iter.num_devs);
ut_asserteq_str("mmc2.bootdev", iter.dev_used[0]->name);
@@ -322,6 +330,10 @@ static int bootdev_test_prio(struct unit_test_state *uts)
/* 3 MMC and 3 USB bootdevs: MMC should come before USB */
ut_assertok(bootflow_scan_first(NULL, NULL, &iter, 0, &bflow));
+
+ /* get the usb device which has a backing file (flash1.img) */
+ ut_asserteq(0, bootflow_scan_next(&iter, &bflow));
+
ut_asserteq(-ENODEV, bootflow_scan_next(&iter, &bflow));
ut_asserteq(6, iter.num_devs);
ut_asserteq_str("mmc2.bootdev", iter.dev_used[0]->name);
@@ -339,6 +351,10 @@ static int bootdev_test_prio(struct unit_test_state *uts)
bootflow_iter_uninit(&iter);
ut_assertok(bootflow_scan_first(NULL, NULL, &iter, BOOTFLOWIF_HUNT,
&bflow));
+
+ /* get the usb device which has a backing file (flash1.img) */
+ ut_asserteq(0, bootflow_scan_next(&iter, &bflow));
+
ut_asserteq(-ENODEV, bootflow_scan_next(&iter, &bflow));
ut_asserteq(7, iter.num_devs);
ut_asserteq_str("usb_mass_storage.lun0.bootdev",