summaryrefslogtreecommitdiff
path: root/test/boot
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2023-05-14 11:27:18 -0400
committerTom Rini <trini@konsulko.com>2023-05-14 11:27:18 -0400
commit177e506952a8ee34011590c4bd578d191fafb1ca (patch)
tree1c4be9b6329df4a1976125e87bf2fd8447990f29 /test/boot
parente94fbdd2729fdcd570035d43f67adda8e0dfc115 (diff)
parentfba0e7380269771bb9587fce84e56a059ebf7d42 (diff)
downloadu-boot-177e506952a8ee34011590c4bd578d191fafb1ca.tar.gz
Merge branch '2023-05-13-bootstd-updates-and-improvements'
- Assorted bootstd fixes and cleanups. This should fix problems with Debian, and make script-based distributions work when BOOTMETH_DISTRO is enabled now (as BOOTMETH_DISTRO was renamed and then reintroduced).
Diffstat (limited to 'test/boot')
-rw-r--r--test/boot/bootdev.c9
-rw-r--r--test/boot/bootflow.c44
-rw-r--r--test/boot/bootmeth.c24
3 files changed, 41 insertions, 36 deletions
diff --git a/test/boot/bootdev.c b/test/boot/bootdev.c
index 8cf3f30e0f..6b29213416 100644
--- a/test/boot/bootdev.c
+++ b/test/boot/bootdev.c
@@ -19,9 +19,9 @@
/* Allow reseting the USB-started flag */
#if defined(CONFIG_USB_HOST) || defined(CONFIG_USB_GADGET)
-extern char usb_started;
+extern bool usb_started;
#else
-char usb_started;
+#include <usb.h>
#endif
/* Check 'bootdev list' command */
@@ -306,6 +306,7 @@ static int bootdev_test_hunter(struct unit_test_state *uts)
{
struct bootstd_priv *std;
+ usb_started = false;
test_set_skip_delays(true);
/* get access to the used hunters */
@@ -346,6 +347,7 @@ static int bootdev_test_cmd_hunt(struct unit_test_state *uts)
struct bootstd_priv *std;
test_set_skip_delays(true);
+ usb_started = false;
/* get access to the used hunters */
ut_assertok(bootstd_get_priv(&std));
@@ -474,6 +476,7 @@ BOOTSTD_TEST(bootdev_test_bootable, UT_TESTF_DM | UT_TESTF_SCAN_FDT);
/* Check hunting for bootdev of a particular priority */
static int bootdev_test_hunt_prio(struct unit_test_state *uts)
{
+ usb_started = false;
test_set_skip_delays(true);
console_record_reset_enable();
@@ -502,6 +505,8 @@ static int bootdev_test_hunt_label(struct unit_test_state *uts)
struct bootstd_priv *std;
int mflags;
+ usb_started = false;
+
/* get access to the used hunters */
ut_assertok(bootstd_get_priv(&std));
diff --git a/test/boot/bootflow.c b/test/boot/bootflow.c
index fd0e1d6243..2b5f87d7f0 100644
--- a/test/boot/bootflow.c
+++ b/test/boot/bootflow.c
@@ -57,7 +57,7 @@ static int bootflow_cmd(struct unit_test_state *uts)
ut_assert_nextlinen("---");
ut_assert_nextline("Scanning bootdev 'mmc2.bootdev':");
ut_assert_nextline("Scanning bootdev 'mmc1.bootdev':");
- ut_assert_nextline(" 0 syslinux ready mmc 1 mmc1.bootdev.part_1 /extlinux/extlinux.conf");
+ ut_assert_nextline(" 0 extlinux ready mmc 1 mmc1.bootdev.part_1 /extlinux/extlinux.conf");
ut_assert_nextline("No more bootdevs");
ut_assert_nextlinen("---");
ut_assert_nextline("(1 bootflow, 1 valid)");
@@ -67,7 +67,7 @@ static int bootflow_cmd(struct unit_test_state *uts)
ut_assert_nextline("Showing bootflows for bootdev 'mmc1.bootdev'");
ut_assert_nextline("Seq Method State Uclass Part Name Filename");
ut_assert_nextlinen("---");
- ut_assert_nextline(" 0 syslinux ready mmc 1 mmc1.bootdev.part_1 /extlinux/extlinux.conf");
+ ut_assert_nextline(" 0 extlinux ready mmc 1 mmc1.bootdev.part_1 /extlinux/extlinux.conf");
ut_assert_nextlinen("---");
ut_assert_nextline("(1 bootflow, 1 valid)");
ut_assert_console_end();
@@ -136,7 +136,7 @@ static int bootflow_cmd_glob(struct unit_test_state *uts)
ut_assert_nextlinen("---");
ut_assert_nextline("Scanning bootdev 'mmc2.bootdev':");
ut_assert_nextline("Scanning bootdev 'mmc1.bootdev':");
- ut_assert_nextline(" 0 syslinux ready mmc 1 mmc1.bootdev.part_1 /extlinux/extlinux.conf");
+ ut_assert_nextline(" 0 extlinux ready mmc 1 mmc1.bootdev.part_1 /extlinux/extlinux.conf");
ut_assert_nextline("Scanning bootdev 'mmc0.bootdev':");
ut_assert_nextline("No more bootdevs");
ut_assert_nextlinen("---");
@@ -147,7 +147,7 @@ static int bootflow_cmd_glob(struct unit_test_state *uts)
ut_assert_nextline("Showing all bootflows");
ut_assert_nextline("Seq Method State Uclass Part Name Filename");
ut_assert_nextlinen("---");
- ut_assert_nextline(" 0 syslinux ready mmc 1 mmc1.bootdev.part_1 /extlinux/extlinux.conf");
+ ut_assert_nextline(" 0 extlinux ready mmc 1 mmc1.bootdev.part_1 /extlinux/extlinux.conf");
ut_assert_nextlinen("---");
ut_assert_nextline("(1 bootflow, 1 valid)");
ut_assert_console_end();
@@ -167,22 +167,22 @@ static int bootflow_cmd_scan_e(struct unit_test_state *uts)
ut_assert_nextline("Seq Method State Uclass Part Name Filename");
ut_assert_nextlinen("---");
ut_assert_nextline("Scanning bootdev 'mmc2.bootdev':");
- ut_assert_nextline(" 0 syslinux media mmc 0 mmc2.bootdev.whole <NULL>");
- ut_assert_nextline(" ** No partition found, err=-93");
+ ut_assert_nextline(" 0 extlinux media mmc 0 mmc2.bootdev.whole <NULL>");
+ ut_assert_nextline(" ** No partition found, err=-93: Protocol not supported");
ut_assert_nextline(" 1 efi media mmc 0 mmc2.bootdev.whole <NULL>");
- ut_assert_nextline(" ** No partition found, err=-93");
+ ut_assert_nextline(" ** No partition found, err=-93: Protocol not supported");
ut_assert_nextline("Scanning bootdev 'mmc1.bootdev':");
- ut_assert_nextline(" 2 syslinux media mmc 0 mmc1.bootdev.whole <NULL>");
- ut_assert_nextline(" ** No partition found, err=-2");
+ ut_assert_nextline(" 2 extlinux media mmc 0 mmc1.bootdev.whole <NULL>");
+ ut_assert_nextline(" ** No partition found, err=-2: No such file or directory");
ut_assert_nextline(" 3 efi media mmc 0 mmc1.bootdev.whole <NULL>");
- ut_assert_nextline(" ** No partition found, err=-2");
- ut_assert_nextline(" 4 syslinux ready mmc 1 mmc1.bootdev.part_1 /extlinux/extlinux.conf");
+ ut_assert_nextline(" ** No partition found, err=-2: No such file or directory");
+ ut_assert_nextline(" 4 extlinux ready mmc 1 mmc1.bootdev.part_1 /extlinux/extlinux.conf");
ut_assert_nextline(" 5 efi fs mmc 1 mmc1.bootdev.part_1 efi/boot/bootsbox.efi");
ut_assert_skip_to_line("Scanning bootdev 'mmc0.bootdev':");
ut_assert_skip_to_line(" 3f efi media mmc 0 mmc0.bootdev.whole <NULL>");
- ut_assert_nextline(" ** No partition found, err=-93");
+ ut_assert_nextline(" ** No partition found, err=-93: Protocol not supported");
ut_assert_nextline("No more bootdevs");
ut_assert_nextlinen("---");
ut_assert_nextline("(64 bootflows, 1 valid)");
@@ -192,9 +192,9 @@ static int bootflow_cmd_scan_e(struct unit_test_state *uts)
ut_assert_nextline("Showing all bootflows");
ut_assert_nextline("Seq Method State Uclass Part Name Filename");
ut_assert_nextlinen("---");
- ut_assert_nextline(" 0 syslinux media mmc 0 mmc2.bootdev.whole <NULL>");
+ ut_assert_nextline(" 0 extlinux media mmc 0 mmc2.bootdev.whole <NULL>");
ut_assert_nextline(" 1 efi media mmc 0 mmc2.bootdev.whole <NULL>");
- ut_assert_skip_to_line(" 4 syslinux ready mmc 1 mmc1.bootdev.part_1 /extlinux/extlinux.conf");
+ ut_assert_skip_to_line(" 4 extlinux ready mmc 1 mmc1.bootdev.part_1 /extlinux/extlinux.conf");
ut_assert_skip_to_line(" 3f efi media mmc 0 mmc0.bootdev.whole <NULL>");
ut_assert_nextlinen("---");
ut_assert_nextline("(64 bootflows, 1 valid)");
@@ -218,7 +218,7 @@ static int bootflow_cmd_info(struct unit_test_state *uts)
ut_assert_nextline("Name: mmc1.bootdev.part_1");
ut_assert_nextline("Device: mmc1.bootdev");
ut_assert_nextline("Block dev: mmc1.blk");
- ut_assert_nextline("Method: syslinux");
+ ut_assert_nextline("Method: extlinux");
ut_assert_nextline("State: ready");
ut_assert_nextline("Partition: 1");
ut_assert_nextline("Subdir: (none)");
@@ -251,7 +251,7 @@ static int bootflow_scan_boot(struct unit_test_state *uts)
ut_assertok(inject_response(uts));
ut_assertok(run_command("bootflow scan -b", 0));
ut_assert_nextline(
- "** Booting bootflow 'mmc1.bootdev.part_1' with syslinux");
+ "** Booting bootflow 'mmc1.bootdev.part_1' with extlinux");
ut_assert_nextline("Ignoring unknown command: ui");
/*
@@ -282,7 +282,7 @@ static int bootflow_iter(struct unit_test_state *uts)
ut_asserteq(0, iter.cur_method);
ut_asserteq(0, iter.part);
ut_asserteq(0, iter.max_part);
- ut_asserteq_str("syslinux", iter.method->name);
+ ut_asserteq_str("extlinux", iter.method->name);
ut_asserteq(0, bflow.err);
/*
@@ -309,7 +309,7 @@ static int bootflow_iter(struct unit_test_state *uts)
ut_asserteq(0, iter.cur_method);
ut_asserteq(0, iter.part);
ut_asserteq(0x1e, iter.max_part);
- ut_asserteq_str("syslinux", iter.method->name);
+ ut_asserteq_str("extlinux", iter.method->name);
ut_asserteq(0, bflow.err);
ut_asserteq(BOOTFLOWST_MEDIA, bflow.state);
bootflow_free(&bflow);
@@ -330,7 +330,7 @@ static int bootflow_iter(struct unit_test_state *uts)
ut_asserteq(0, iter.cur_method);
ut_asserteq(1, iter.part);
ut_asserteq(0x1e, iter.max_part);
- ut_asserteq_str("syslinux", iter.method->name);
+ ut_asserteq_str("extlinux", iter.method->name);
ut_asserteq(0, bflow.err);
ut_asserteq(BOOTFLOWST_READY, bflow.state);
bootflow_free(&bflow);
@@ -351,7 +351,7 @@ static int bootflow_iter(struct unit_test_state *uts)
ut_asserteq(0, iter.cur_method);
ut_asserteq(2, iter.part);
ut_asserteq(0x1e, iter.max_part);
- ut_asserteq_str("syslinux", iter.method->name);
+ ut_asserteq_str("extlinux", iter.method->name);
ut_asserteq(0, bflow.err);
ut_asserteq(BOOTFLOWST_MEDIA, bflow.state);
bootflow_free(&bflow);
@@ -489,7 +489,7 @@ static int bootflow_cmd_boot(struct unit_test_state *uts)
ut_assertok(inject_response(uts));
ut_asserteq(1, run_command("bootflow boot", 0));
ut_assert_nextline(
- "** Booting bootflow 'mmc1.bootdev.part_1' with syslinux");
+ "** Booting bootflow 'mmc1.bootdev.part_1' with extlinux");
ut_assert_nextline("Ignoring unknown command: ui");
/*
@@ -614,7 +614,7 @@ static int bootflow_cmd_hunt_label(struct unit_test_state *uts)
ut_assert_nextline("Scanning bootdev 'mmc2.bootdev':");
ut_assert_nextline("Scanning bootdev 'mmc1.bootdev':");
ut_assert_nextline(
- " 0 syslinux ready mmc 1 mmc1.bootdev.part_1 /extlinux/extlinux.conf");
+ " 0 extlinux ready mmc 1 mmc1.bootdev.part_1 /extlinux/extlinux.conf");
ut_assert_nextline("Scanning bootdev 'mmc0.bootdev':");
ut_assert_skip_to_line("(1 bootflow, 1 valid)");
ut_assert_console_end();
diff --git a/test/boot/bootmeth.c b/test/boot/bootmeth.c
index 0098ef3efd..e498eee036 100644
--- a/test/boot/bootmeth.c
+++ b/test/boot/bootmeth.c
@@ -21,7 +21,7 @@ static int bootmeth_cmd_list(struct unit_test_state *uts)
ut_assertok(run_command("bootmeth list", 0));
ut_assert_nextline("Order Seq Name Description");
ut_assert_nextlinen("---");
- ut_assert_nextline(" 0 0 syslinux Syslinux boot from a block device");
+ ut_assert_nextline(" 0 0 extlinux Extlinux boot from a block device");
ut_assert_nextline(" 1 1 efi EFI boot from an .efi file");
if (IS_ENABLED(CONFIG_BOOTMETH_GLOBAL))
ut_assert_nextline(" glob 2 firmware0 VBE simple");
@@ -39,16 +39,16 @@ static int bootmeth_cmd_order(struct unit_test_state *uts)
{
/* Select just one bootmethod */
console_record_reset_enable();
- ut_assertok(run_command("bootmeth order syslinux", 0));
+ ut_assertok(run_command("bootmeth order extlinux", 0));
ut_assert_console_end();
ut_assertnonnull(env_get("bootmeths"));
- ut_asserteq_str("syslinux", env_get("bootmeths"));
+ ut_asserteq_str("extlinux", env_get("bootmeths"));
/* Only that one should be listed */
ut_assertok(run_command("bootmeth list", 0));
ut_assert_nextline("Order Seq Name Description");
ut_assert_nextlinen("---");
- ut_assert_nextline(" 0 0 syslinux Syslinux boot from a block device");
+ ut_assert_nextline(" 0 0 extlinux Extlinux boot from a block device");
ut_assert_nextlinen("---");
ut_assert_nextline("(1 bootmeth)");
ut_assert_console_end();
@@ -57,7 +57,7 @@ static int bootmeth_cmd_order(struct unit_test_state *uts)
ut_assertok(run_command("bootmeth list -a", 0));
ut_assert_nextline("Order Seq Name Description");
ut_assert_nextlinen("---");
- ut_assert_nextline(" 0 0 syslinux Syslinux boot from a block device");
+ ut_assert_nextline(" 0 0 extlinux Extlinux boot from a block device");
ut_assert_nextline(" - 1 efi EFI boot from an .efi file");
if (IS_ENABLED(CONFIG_BOOTMETH_GLOBAL))
ut_assert_nextline(" glob 2 firmware0 VBE simple");
@@ -67,12 +67,12 @@ static int bootmeth_cmd_order(struct unit_test_state *uts)
ut_assert_console_end();
/* Check the -a flag with the reverse order */
- ut_assertok(run_command("bootmeth order \"efi syslinux\"", 0));
+ ut_assertok(run_command("bootmeth order \"efi extlinux\"", 0));
ut_assert_console_end();
ut_assertok(run_command("bootmeth list -a", 0));
ut_assert_nextline("Order Seq Name Description");
ut_assert_nextlinen("---");
- ut_assert_nextline(" 1 0 syslinux Syslinux boot from a block device");
+ ut_assert_nextline(" 1 0 extlinux Extlinux boot from a block device");
ut_assert_nextline(" 0 1 efi EFI boot from an .efi file");
if (IS_ENABLED(CONFIG_BOOTMETH_GLOBAL))
ut_assert_nextline(" glob 2 firmware0 VBE simple");
@@ -90,17 +90,17 @@ static int bootmeth_cmd_order(struct unit_test_state *uts)
"(3 bootmeths)" : "(2 bootmeths)");
/* Try reverse order */
- ut_assertok(run_command("bootmeth order \"efi syslinux\"", 0));
+ ut_assertok(run_command("bootmeth order \"efi extlinux\"", 0));
ut_assert_console_end();
ut_assertok(run_command("bootmeth list", 0));
ut_assert_nextline("Order Seq Name Description");
ut_assert_nextlinen("---");
ut_assert_nextline(" 0 1 efi EFI boot from an .efi file");
- ut_assert_nextline(" 1 0 syslinux Syslinux boot from a block device");
+ ut_assert_nextline(" 1 0 extlinux Extlinux boot from a block device");
ut_assert_nextlinen("---");
ut_assert_nextline("(2 bootmeths)");
ut_assertnonnull(env_get("bootmeths"));
- ut_asserteq_str("efi syslinux", env_get("bootmeths"));
+ ut_asserteq_str("efi extlinux", env_get("bootmeths"));
ut_assert_console_end();
return 0;
@@ -140,7 +140,7 @@ static int bootmeth_env(struct unit_test_state *uts)
/* Select just one bootmethod */
console_record_reset_enable();
- ut_assertok(env_set("bootmeths", "syslinux"));
+ ut_assertok(env_set("bootmeths", "extlinux"));
ut_asserteq(1, std->bootmeth_count);
/* Select an invalid bootmethod */
@@ -149,7 +149,7 @@ static int bootmeth_env(struct unit_test_state *uts)
ut_assert_nextlinen("## Error inserting");
ut_assert_console_end();
- ut_assertok(env_set("bootmeths", "efi syslinux"));
+ ut_assertok(env_set("bootmeths", "efi extlinux"));
ut_asserteq(2, std->bootmeth_count);
ut_assert_console_end();