From 05b59d2ca30548f8460d87dbf8353ab1437cb204 Mon Sep 17 00:00:00 2001 From: Anastasia Klimchuk Date: Thu, 19 Aug 2021 15:15:19 +1000 Subject: tests: Mock file i/o for linux_mtd and linux_spi tests This patch adds an init-shutdown test for linux_mtd. Since linux_mtd is using file i/o operations, those are added to the framework and mocked. Another driver linux_spi which is also using file i/o, got an upgrade in this patch, and it is now reading max buffer size from sysfs (using mocked file i/o). A good side-effect is that linux_mtd is the first test for opaque masters, which is great to have in preparation for a change like CB:56103 but for opaque masters. BUG=b:181803212 TEST=builds and ninja test Change-Id: I73f0d6ff2ad5074add7a721ed3416230d3647e3f Signed-off-by: Anastasia Klimchuk Reviewed-on: https://review.coreboot.org/c/flashrom/+/56413 Tested-by: build bot (Jenkins) Reviewed-by: Nico Huber Reviewed-by: Edward O'Callaghan --- tests/tests.h | 1 + 1 file changed, 1 insertion(+) (limited to 'tests/tests.h') diff --git a/tests/tests.h b/tests/tests.h index 512b72d0..df4a41cc 100644 --- a/tests/tests.h +++ b/tests/tests.h @@ -46,6 +46,7 @@ void mec1308_init_and_shutdown_test_success(void **state); void nicrealtek_init_and_shutdown_test_success(void **state); void dediprog_init_and_shutdown_test_success(void **state); void ene_lpc_init_and_shutdown_test_success(void **state); +void linux_mtd_init_and_shutdown_test_success(void **state); void linux_spi_init_and_shutdown_test_success(void **state); void realtek_mst_init_and_shutdown_test_success(void **state); -- cgit v1.2.3