diff options
author | Abe Levkoy <alevkoy@chromium.org> | 2022-10-10 10:20:49 -0600 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-10-11 19:32:50 +0000 |
commit | 6583f4530295a4d617a288d40ac1cb848abeb7ec (patch) | |
tree | 4e9db48d8132f2f442467f94e89d2f023c63b251 | |
parent | bd7adc27d9800ed6d32dab1aad764502ddc82b2c (diff) | |
download | chrome-ec-6583f4530295a4d617a288d40ac1cb848abeb7ec.tar.gz |
zephyr test: Verify that TCPM initiates VCONN Swap
Verify that TCPM will become VCONN Source if it can after attaching as
not VCONN Source.
BUG=b:251485312
TEST=twister -s zephyr/test/drivers/drivers.usbc_vconn_swap
BRANCH=none
Signed-off-by: Abe Levkoy <alevkoy@chromium.org>
Change-Id: Icd094f1cdc1d8ab320bf18edb112182532385618
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3943260
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
-rw-r--r-- | zephyr/test/drivers/usbc_vconn_swap/src/usbc_vconn_swap.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/zephyr/test/drivers/usbc_vconn_swap/src/usbc_vconn_swap.c b/zephyr/test/drivers/usbc_vconn_swap/src/usbc_vconn_swap.c index 359d5b97aa..70d13bdada 100644 --- a/zephyr/test/drivers/usbc_vconn_swap/src/usbc_vconn_swap.c +++ b/zephyr/test/drivers/usbc_vconn_swap/src/usbc_vconn_swap.c @@ -125,5 +125,14 @@ static void usbc_vconn_swap_after(void *data) common_after(&outer->common); } +ZTEST_F(usbc_vconn_swap, vconn_swap_before_discovery) +{ + struct ec_response_typec_status status = + host_cmd_typec_status(TEST_PORT); + + zassert_equal(status.vconn_role, PD_ROLE_VCONN_SRC, + "TCPM did not initiate VCONN Swap after attach"); +} + ZTEST_SUITE(usbc_vconn_swap, drivers_predicate_post_main, usbc_vconn_swap_setup, usbc_vconn_swap_before, usbc_vconn_swap_after, NULL); |