@@ -825,6 +825,46 @@ static void test_hiomap_protocol_event_before_read(void)
825825 scenario_exit ();
826826}
827827
828+ static const struct scenario_event
829+ scenario_hiomap_protocol_event_during_read [] = {
830+ { .type = scenario_event_p , .p = & hiomap_ack_call , },
831+ { .type = scenario_event_p , .p = & hiomap_get_info_call , },
832+ { .type = scenario_event_p , .p = & hiomap_get_flash_info_call , },
833+ {
834+ .type = scenario_event_p ,
835+ .p = & hiomap_create_read_window_qs0l1_rs0l1_call ,
836+ },
837+ {
838+ .type = scenario_sel ,
839+ .s = {
840+ .bmc_state = HIOMAP_E_DAEMON_READY |
841+ HIOMAP_E_FLASH_LOST ,
842+ }
843+ },
844+ SCENARIO_SENTINEL ,
845+ };
846+
847+ static void test_hiomap_protocol_event_during_read (void )
848+ {
849+ struct blocklevel_device * bl ;
850+ struct ipmi_hiomap * ctx ;
851+ uint8_t * buf ;
852+ size_t len ;
853+ int rc ;
854+
855+ scenario_enter (scenario_hiomap_protocol_event_during_read );
856+ assert (!ipmi_hiomap_init (& bl ));
857+ ctx = container_of (bl , struct ipmi_hiomap , bl );
858+ len = 1 << ctx -> block_size_shift ;
859+ buf = calloc (1 , len );
860+ assert (buf );
861+ rc = bl -> read (bl , 0 , buf , len );
862+ assert (rc == FLASH_ERR_AGAIN );
863+ free (buf );
864+ ipmi_hiomap_exit (bl );
865+ scenario_exit ();
866+ }
867+
828868static const struct scenario_event
829869scenario_hiomap_protocol_persistent_error [] = {
830870 { .type = scenario_event_p , .p = & hiomap_ack_call , },
@@ -871,6 +911,7 @@ struct test_case test_cases[] = {
871911 TEST_CASE (test_hiomap_protocol_read_one_block ),
872912 TEST_CASE (test_hiomap_protocol_read_two_blocks ),
873913 TEST_CASE (test_hiomap_protocol_event_before_read ),
914+ TEST_CASE (test_hiomap_protocol_event_during_read ),
874915 TEST_CASE (test_hiomap_protocol_persistent_error ),
875916 { NULL , NULL },
876917};
0 commit comments