mirror of
https://review.coreboot.org/flashrom.git
synced 2025-07-02 14:33:18 +02:00
tests: Test allow_brick is required for i2c programmers init
Add tests for i2c programmers that assert that initialisation fails when allow_brick parameter is not provided. Example of logs from test run: [ RUN ] parade_lspcon_no_allow_brick_test_success Testing init error path for programmer=parade_lspcon with params: bus=254 ... ... init failed with error code -1 as expected [ OK ] parade_lspcon_no_allow_brick_test_success BUG=b:181803212 TEST=ninja test Change-Id: I382f563016502f3342131d5f9c0de41dc665b03a Signed-off-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-on: https://review.coreboot.org/c/flashrom/+/66508 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Felix Singer <felixsinger@posteo.net> Reviewed-by: Thomas Heijligen <src@posteo.de>
This commit is contained in:
@ -31,6 +31,22 @@ void parade_lspcon_basic_lifecycle_test_success(void **state)
|
||||
run_basic_lifecycle(state, ¶de_lspcon_io, &programmer_parade_lspcon, "bus=254,allow_brick=yes");
|
||||
}
|
||||
|
||||
void parade_lspcon_no_allow_brick_test_success(void **state)
|
||||
{
|
||||
struct io_mock_fallback_open_state parade_lspcon_fallback_open_state = {
|
||||
.noc = 0,
|
||||
.paths = { "/dev/i2c-254", NULL },
|
||||
.flags = { O_RDWR },
|
||||
};
|
||||
const struct io_mock parade_lspcon_io = {
|
||||
.fallback_open_state = ¶de_lspcon_fallback_open_state,
|
||||
};
|
||||
|
||||
run_init_error_path(state, ¶de_lspcon_io, &programmer_parade_lspcon,
|
||||
"bus=254", SPI_GENERIC_ERROR);
|
||||
}
|
||||
|
||||
#else
|
||||
SKIP_TEST(parade_lspcon_basic_lifecycle_test_success)
|
||||
SKIP_TEST(parade_lspcon_no_allow_brick_test_success)
|
||||
#endif /* CONFIG_PARADE_LSPCON */
|
||||
|
Reference in New Issue
Block a user