diff options
author | Kevin Shelton <kmshelton@chromium.org> | 2020-07-21 14:40:15 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-05-08 00:48:06 +0000 |
commit | 89d35ca465a8053b26ac8158a992c6098fc37ac1 (patch) | |
tree | 481de9154b3cec08697ddd4b89e91d1b9b192b24 /test | |
parent | ceb21b1f8379cd5c481ba118c68d94e61ac925cb (diff) | |
download | chrome-ec-89d35ca465a8053b26ac8158a992c6098fc37ac1.tar.gz |
fingerprint: Add test that reads hwid
BUG=b:157576189
BRANCH=none
TEST=make buildall -j,
Using dragonclaw v0.2 and servo_micro:
./test/run_device_test.py -t fpsensor_hw
--flasher=servo_micro,
Using icetower and servo_micro:
./test/run_device_test.py -t fpsensor_wh
--flasher=servo_micro --board dartmonkey;
note: the testrunner hung after printing Test
"fpsensor_hw": PASSED, but this hang seems
unrelated
Cq-Depend: chromium:2872432
Change-Id: I2a3b31776cd40d7f0b422f4845869953b8f07249
Signed-off-by: Kevin Shelton <kmshelton@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2314101
Reviewed-by: Tom Hughes <tomhughes@chromium.org>
Diffstat (limited to 'test')
-rw-r--r-- | test/build.mk | 1 | ||||
-rw-r--r-- | test/fpsensor_hw.c | 27 | ||||
-rw-r--r-- | test/fpsensor_hw.tasklist | 9 | ||||
-rwxr-xr-x | test/run_device_tests.py | 2 |
4 files changed, 39 insertions, 0 deletions
diff --git a/test/build.mk b/test/build.mk index 9dd576aa41..d0dd3eab25 100644 --- a/test/build.mk +++ b/test/build.mk @@ -146,6 +146,7 @@ flash_physical-y=flash_physical.o flash_write_protect-y=flash_write_protect.o fpsensor-y=fpsensor.o fpsensor_crypto-y=fpsensor_crypto.o +fpsensor_hw-y=fpsensor_hw.o fpsensor_state-y=fpsensor_state.o gyro_cal-y=gyro_cal.o gyro_cal_init_for_test.o hooks-y=hooks.o diff --git a/test/fpsensor_hw.c b/test/fpsensor_hw.c new file mode 100644 index 0000000000..1ca4a9f505 --- /dev/null +++ b/test/fpsensor_hw.c @@ -0,0 +1,27 @@ +/* Copyright 2021 The Chromium OS Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +#include "common.h" +#include "test_util.h" +#include "fpc_private.h" + +/* Hardware-dependent smoke test that makes a SPI transaction with the + * fingerprint sensor. + */ +test_static int test_fp_check_hwid(void) +{ + /* TODO(b/187134801): modify fpc_check_hwid() to return the hwid. */ + if (IS_ENABLED(SECTION_IS_RW)) + TEST_EQ(fpc_check_hwid(), EC_SUCCESS, "%d"); + + return EC_SUCCESS; +} + + +void run_test(int argc, char **argv) +{ + RUN_TEST(test_fp_check_hwid); + test_print_result(); +} diff --git a/test/fpsensor_hw.tasklist b/test/fpsensor_hw.tasklist new file mode 100644 index 0000000000..299cf25390 --- /dev/null +++ b/test/fpsensor_hw.tasklist @@ -0,0 +1,9 @@ +/* Copyright 2021 The Chromium OS Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * See CONFIG_TASK_LIST in config.h for details. + */ +#define CONFIG_TEST_TASK_LIST diff --git a/test/run_device_tests.py b/test/run_device_tests.py index 4bc4b020ea..7a9730286e 100755 --- a/test/run_device_tests.py +++ b/test/run_device_tests.py @@ -123,6 +123,8 @@ class AllTests: TestConfig(name='flash_write_protect', image_to_use=ImageType.RO, toggle_power=True, enable_hw_write_protect=True), + 'fpsensor_hw': + TestConfig(name='fpsensor_hw'), 'fpsensor_spi_ro': TestConfig(name='fpsensor', image_to_use=ImageType.RO, test_args=['spi']), |