summaryrefslogtreecommitdiff
path: root/test/boot/bootmeth.c
diff options
context:
space:
mode:
authorSimon Glass <[email protected]>2022-10-20 18:22:49 -0600
committerTom Rini <[email protected]>2022-10-31 11:02:44 -0400
commitc43635bdbc6cb1e4ba2d9e2f28f7f3cb3b287bf8 (patch)
tree2b4a6c1620f2a966857661d0b1ce4179e195b27d /test/boot/bootmeth.c
parent1facaadea1871c1b6962272dd21569a4aafda18c (diff)
test: Update tests to use the skip feature
Some tests currently return 0 when they want to be skipped. Update them to return -EAGAIN instead, so they are counted as skipped. A few tests are in two parts, with the latter part being skipped in certain situations. Split these into two and use the correct condition for the second part. Signed-off-by: Simon Glass <[email protected]>
Diffstat (limited to 'test/boot/bootmeth.c')
-rw-r--r--test/boot/bootmeth.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/test/boot/bootmeth.c b/test/boot/bootmeth.c
index f0b5ab9adb3..0098ef3efd0 100644
--- a/test/boot/bootmeth.c
+++ b/test/boot/bootmeth.c
@@ -103,10 +103,17 @@ static int bootmeth_cmd_order(struct unit_test_state *uts)
ut_asserteq_str("efi syslinux", env_get("bootmeths"));
ut_assert_console_end();
- /* Try with global bootmeths */
+ return 0;
+}
+BOOTSTD_TEST(bootmeth_cmd_order, UT_TESTF_DM | UT_TESTF_SCAN_FDT);
+
+/* Check 'bootmeth order' command with global bootmeths */
+static int bootmeth_cmd_order_glob(struct unit_test_state *uts)
+{
if (!IS_ENABLED(CONFIG_BOOTMETH_GLOBAL))
- return 0;
+ return -EAGAIN;
+ console_record_reset_enable();
ut_assertok(run_command("bootmeth order \"efi firmware0\"", 0));
ut_assert_console_end();
ut_assertok(run_command("bootmeth list", 0));
@@ -122,7 +129,7 @@ static int bootmeth_cmd_order(struct unit_test_state *uts)
return 0;
}
-BOOTSTD_TEST(bootmeth_cmd_order, UT_TESTF_DM | UT_TESTF_SCAN_FDT);
+BOOTSTD_TEST(bootmeth_cmd_order_glob, UT_TESTF_DM | UT_TESTF_SCAN_FDT);
/* Check 'bootmeths' env var */
static int bootmeth_env(struct unit_test_state *uts)