#include <bootmeth.h>
#include <bootstd.h>
#include <dm.h>
+#ifdef CONFIG_SANDBOX
#include <asm/test.h>
+#endif
#include <dm/lists.h>
#include <test/suites.h>
#include <test/ut.h>
}
BOOTSTD_TEST(bootflow_iter, UT_TESTF_DM | UT_TESTF_SCAN_FDT);
+#if defined(CONFIG_SANDBOX) && defined(CONFIG_BOOTMETH_GLOBAL)
/* Check using the system bootdev */
static int bootflow_system(struct unit_test_state *uts)
{
}
BOOTSTD_TEST(bootflow_system, UT_TESTF_DM | UT_TESTF_SCAN_PDATA |
UT_TESTF_SCAN_FDT);
+#endif
/* Check disabling a bootmethod if it requests it */
static int bootflow_iter_disable(struct unit_test_state *uts)
/* Check 'bootflow scan' with a bootmeth ordering including a global bootmeth */
static int bootflow_scan_glob_bootmeth(struct unit_test_state *uts)
{
+ if (!IS_ENABLED(CONFIG_BOOTMETH_GLOBAL))
+ return 0;
+
ut_assertok(bootstd_test_drop_bootdev_order(uts));
/*
ut_assert_nextlinen("---");
ut_assert_nextline(" 0 0 syslinux Syslinux boot from a block device");
ut_assert_nextline(" 1 1 efi EFI boot from an .efi file");
- ut_assert_nextline(" glob 2 firmware0 VBE simple");
+ if (IS_ENABLED(CONFIG_BOOTMETH_GLOBAL))
+ ut_assert_nextline(" glob 2 firmware0 VBE simple");
ut_assert_nextlinen("---");
- ut_assert_nextline("(3 bootmeths)");
+ ut_assert_nextline(IS_ENABLED(CONFIG_BOOTMETH_GLOBAL) ?
+ "(3 bootmeths)" : "(2 bootmeths)");
ut_assert_console_end();
return 0;
ut_assert_nextlinen("---");
ut_assert_nextline(" 0 0 syslinux Syslinux boot from a block device");
ut_assert_nextline(" - 1 efi EFI boot from an .efi file");
- ut_assert_nextline(" glob 2 firmware0 VBE simple");
+ if (IS_ENABLED(CONFIG_BOOTMETH_GLOBAL))
+ ut_assert_nextline(" glob 2 firmware0 VBE simple");
ut_assert_nextlinen("---");
- ut_assert_nextline("(3 bootmeths)");
+ ut_assert_nextline(IS_ENABLED(CONFIG_BOOTMETH_GLOBAL) ?
+ "(3 bootmeths)" : "(2 bootmeths)");
ut_assert_console_end();
/* Check the -a flag with the reverse order */
ut_assert_nextlinen("---");
ut_assert_nextline(" 1 0 syslinux Syslinux boot from a block device");
ut_assert_nextline(" 0 1 efi EFI boot from an .efi file");
- ut_assert_nextline(" glob 2 firmware0 VBE simple");
+ if (IS_ENABLED(CONFIG_BOOTMETH_GLOBAL))
+ ut_assert_nextline(" glob 2 firmware0 VBE simple");
ut_assert_nextlinen("---");
- ut_assert_nextline("(3 bootmeths)");
+ ut_assert_nextline(IS_ENABLED(CONFIG_BOOTMETH_GLOBAL) ?
+ "(3 bootmeths)" : "(2 bootmeths)");
ut_assert_console_end();
/* Now reset the order to empty, which should show all of them again */
ut_assert_console_end();
ut_assertnull(env_get("bootmeths"));
ut_assertok(run_command("bootmeth list", 0));
- ut_assert_skip_to_line("(3 bootmeths)");
+ ut_assert_skip_to_line(IS_ENABLED(CONFIG_BOOTMETH_GLOBAL) ?
+ "(3 bootmeths)" : "(2 bootmeths)");
/* Try reverse order */
ut_assertok(run_command("bootmeth order \"efi syslinux\"", 0));
ut_assert_console_end();
/* Try with global bootmeths */
+ if (!IS_ENABLED(CONFIG_BOOTMETH_GLOBAL))
+ return 0;
+
ut_assertok(run_command("bootmeth order \"efi firmware0\"", 0));
ut_assert_console_end();
ut_assertok(run_command("bootmeth list", 0));