Anastasia Klimchuk has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/59742 )
Change subject: tests: Upgrade linux_spi test to run probe lifecycle ......................................................................
tests: Upgrade linux_spi test to run probe lifecycle
No additional mocks are needed, because ioctl is already mocked for some of existing tests. Default behaviour for the mock to do nothing and return success is sufficient to test probe for linux_spi.
BUG=b:181803212 TEST=ninja test
Change-Id: I32d8e972d99b52c2b18f688aa6aeae75dd170f72 Signed-off-by: Anastasia Klimchuk aklm@chromium.org --- M tests/lifecycle.c M tests/tests.c M tests/tests.h 3 files changed, 4 insertions(+), 4 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/42/59742/1
diff --git a/tests/lifecycle.c b/tests/lifecycle.c index 4fd554a..d25681a 100644 --- a/tests/lifecycle.c +++ b/tests/lifecycle.c @@ -302,7 +302,7 @@ return memcpy(buf, max_buf_size, min(len, strlen(max_buf_size) + 1)); }
-void linux_spi_basic_lifecycle_test_success(void **state) +void linux_spi_probe_lifecycle_test_success(void **state) { /* * Current implementation tests a particular path of the init procedure. @@ -315,7 +315,7 @@
io_mock_register(&linux_spi_io);
- run_basic_lifecycle(state, &programmer_linux_spi, "dev=/dev/null"); + run_probe_lifecycle(state, &programmer_linux_spi, "dev=/dev/null", "W25Q128.V");
io_mock_register(NULL); #else diff --git a/tests/tests.c b/tests/tests.c index c840ba4..3d9ef5f 100644 --- a/tests/tests.c +++ b/tests/tests.c @@ -354,7 +354,7 @@ cmocka_unit_test(raiden_debug_basic_lifecycle_test_success), cmocka_unit_test(dediprog_basic_lifecycle_test_success), cmocka_unit_test(linux_mtd_basic_lifecycle_test_success), - cmocka_unit_test(linux_spi_basic_lifecycle_test_success), + cmocka_unit_test(linux_spi_probe_lifecycle_test_success), cmocka_unit_test(realtek_mst_basic_lifecycle_test_success), }; ret |= cmocka_run_group_tests_name("lifecycle.c tests", lifecycle_tests, NULL, NULL); diff --git a/tests/tests.h b/tests/tests.h index e450f15..f77f9e5 100644 --- a/tests/tests.h +++ b/tests/tests.h @@ -46,7 +46,7 @@ void raiden_debug_basic_lifecycle_test_success(void **state); void dediprog_basic_lifecycle_test_success(void **state); void linux_mtd_basic_lifecycle_test_success(void **state); -void linux_spi_basic_lifecycle_test_success(void **state); +void linux_spi_probe_lifecycle_test_success(void **state); void realtek_mst_basic_lifecycle_test_success(void **state);
/* layout.c */