]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
test: bdinfo: Test bdinfo -e
authorMarek Vasut <marek.vasut+renesas@mailbox.org>
Sat, 7 Oct 2023 21:41:06 +0000 (23:41 +0200)
committerTom Rini <trini@konsulko.com>
Sat, 9 Dec 2023 13:42:29 +0000 (08:42 -0500)
The bdinfo -e should print only the board ethernet settings.
Test the expected output.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
test/cmd/bdinfo.c

index c9be182e37098cc32bb5ad74a786844f693b688d..9744bd16df926254c564f2b7d6ee6de4ab2c9dd1 100644 (file)
@@ -263,6 +263,20 @@ static int bdinfo_test_memory(struct unit_test_state *uts)
 
 BDINFO_TEST(bdinfo_test_memory, UT_TESTF_CONSOLE_REC);
 
+static int bdinfo_test_eth(struct unit_test_state *uts)
+{
+       /* Test BDINFO ethernet settings only print */
+       ut_assertok(console_record_reset_enable());
+       ut_assertok(run_commandf("bdinfo -e"));
+       if (IS_ENABLED(CONFIG_CMD_NET))
+               ut_assertok(test_eth(uts));
+       ut_assertok(ut_check_console_end(uts));
+
+       return 0;
+}
+
+BDINFO_TEST(bdinfo_test_eth, UT_TESTF_CONSOLE_REC);
+
 int do_ut_bdinfo(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
 {
        struct unit_test *tests = UNIT_TEST_SUITE_START(bdinfo_test);