[PATCH 9/9] test: bdinfo: Test bdinfo -e
Marek Vasut
marek.vasut+renesas at mailbox.org
Thu Sep 21 00:58:11 CEST 2023
The bdinfo -e should print only the board ethernet settings.
Test the expected output.
Signed-off-by: Marek Vasut <marek.vasut+renesas at mailbox.org>
---
Cc: Bin Meng <bmeng.cn at gmail.com>
Cc: Mario Six <mario.six at gdsys.cc>
Cc: Nikhil M Jain <n-jain1 at ti.com>
Cc: Simon Glass <sjg at chromium.org>
---
test/cmd/bdinfo.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/test/cmd/bdinfo.c b/test/cmd/bdinfo.c
index f090667fb42..6caee4b0b50 100644
--- a/test/cmd/bdinfo.c
+++ b/test/cmd/bdinfo.c
@@ -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);
--
2.40.1
More information about the U-Boot
mailing list