summaryrefslogtreecommitdiff
path: root/test/cmd/coreboot.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2024-10-14 16:32:07 -0600
committerTom Rini <trini@konsulko.com>2024-11-03 21:27:12 -0600
commitbde86903abd6a1169f33f212ca1247d26ea11555 (patch)
tree87debe0164876a41d72bbc79b18f28cdf604c795 /test/cmd/coreboot.c
parent680dff6f924b8fe462a95418f3bc05918341399e (diff)
x86: coreboot: Add a test for cbsysinfo command
Add a simple test for this command, checking that coreboot has the required features. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'test/cmd/coreboot.c')
-rw-r--r--test/cmd/coreboot.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/test/cmd/coreboot.c b/test/cmd/coreboot.c
new file mode 100644
index 00000000000..4a00bad2b8f
--- /dev/null
+++ b/test/cmd/coreboot.c
@@ -0,0 +1,36 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Test for coreboot commands
+ *
+ * Copyright 2023 Google LLC
+ * Written by Simon Glass <sjg@chromium.org>
+ */
+
+#include <command.h>
+#include <test/cmd.h>
+#include <test/test.h>
+#include <test/ut.h>
+
+/**
+ * test_cmd_cbsysinfo() - test the cbsysinfo command produces expected output
+ *
+ * This includes ensuring that the coreboot build has the expected options
+ * enabled
+ */
+static int test_cmd_cbsysinfo(struct unit_test_state *uts)
+{
+ ut_assertok(run_command("cbsysinfo", 0));
+ ut_assert_nextlinen("Coreboot table at");
+
+ /* Make sure the linear frame buffer is enabled */
+ ut_assert_skip_to_linen("Framebuffer");
+ ut_assert_nextlinen(" Phys addr");
+
+ ut_assert_skip_to_line("Chrome OS VPD: 00000000");
+ ut_assert_nextlinen("RSDP");
+ ut_assert_nextlinen("Unimpl.");
+ ut_assert_console_end();
+
+ return 0;
+}
+CMD_TEST(test_cmd_cbsysinfo, UTF_CONSOLE);