summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWai-Hong Tam <waihong@google.com>2022-08-17 08:40:12 -0700
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-08-17 17:06:15 +0000
commit428787b5287976bccab5b90ca999412b216afeee (patch)
treebc960a8d081a2f3f8f1b472b1e9144ebe0ec2436
parentd4240c889db6c6a5473ec7e5386c9ff7da6fc522 (diff)
downloadchrome-ec-428787b5287976bccab5b90ca999412b216afeee.tar.gz
zephyr: test: Add board_version host command test case
Add the test case which gets the board version. It returns the default board version 0. BRANCH=None BUG=b:236074980 TEST=./twister -s zephyr/test/drivers/drivers.default Change-Id: Icbd622d1435a1a852834c4b57854759c4b4f9db5 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3834011 Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Al Semjonovs <asemjonovs@google.com>
-rw-r--r--zephyr/test/drivers/default/src/system.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/zephyr/test/drivers/default/src/system.c b/zephyr/test/drivers/default/src/system.c
index e3d2aeb5ac..74b238ced2 100644
--- a/zephyr/test/drivers/default/src/system.c
+++ b/zephyr/test/drivers/default/src/system.c
@@ -27,4 +27,18 @@ ZTEST_USER(system, test_hostcmd_sysinfo)
zassert_equal(response.flags, 0, "response.flags = %d", response.flags);
}
+ZTEST_USER(system, test_hostcmd_board_version)
+{
+ struct ec_response_board_version response;
+ struct host_cmd_handler_args args = BUILD_HOST_COMMAND_RESPONSE(
+ EC_CMD_GET_BOARD_VERSION, 0, response);
+
+ /* Get the board version, which is default 0. */
+ zassert_ok(host_command_process(&args), NULL);
+ zassert_ok(args.result, NULL);
+ zassert_equal(args.response_size, sizeof(response), NULL);
+ zassert_equal(response.board_version, 0, "response.board_version = %d",
+ response.board_version);
+}
+
ZTEST_SUITE(system, drivers_predicate_post_main, NULL, NULL, NULL, NULL);