summaryrefslogtreecommitdiff
path: root/zephyr/test/ap_power
diff options
context:
space:
mode:
Diffstat (limited to 'zephyr/test/ap_power')
-rw-r--r--zephyr/test/ap_power/src/console_command.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/zephyr/test/ap_power/src/console_command.c b/zephyr/test/ap_power/src/console_command.c
new file mode 100644
index 0000000000..9d38e773c7
--- /dev/null
+++ b/zephyr/test/ap_power/src/console_command.c
@@ -0,0 +1,32 @@
+/* Copyright 2022 The ChromiumOS Authors
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#include <zephyr/shell/shell.h>
+#include <zephyr/ztest.h>
+
+#include "console.h"
+#include "ec_commands.h"
+#include "test_state.h"
+
+ZTEST_USER(console_cmd_debug_mode, test_debug_mode_default)
+{
+ zassert_ok(shell_execute_cmd(get_ec_shell(), "debug_mode"),
+ "failed to get debug_mode");
+}
+
+ZTEST_USER(console_cmd_debug_mode, test_debug_mode_disabled)
+{
+ zassert_ok(shell_execute_cmd(get_ec_shell(), "debug_mode disable"),
+ "failed to disable debug_mode");
+}
+
+ZTEST_USER(console_cmd_debug_mode, test_debug_mode_enabled)
+{
+ zassert_ok(shell_execute_cmd(get_ec_shell(), "debug_mode enable"),
+ "failed to enable debug_mode");
+}
+
+ZTEST_SUITE(console_cmd_debug_mode, ap_power_predicate_post_main, NULL, NULL,
+ NULL, NULL);