Skip to content

Commit

Permalink
test-ipmi-hiomap: Add event-before-write test
Browse files Browse the repository at this point in the history
[ Upstream commit 7f246ff ]

Cc: stable
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
  • Loading branch information
amboar authored and Vasant Hegde committed Mar 4, 2019
1 parent bf722c0 commit 4cc5d42
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions libflash/test/test-ipmi-hiomap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1073,6 +1073,20 @@ static void test_hiomap_protocol_write_two_blocks(void)
scenario_exit();
}

static void test_hiomap_protocol_event_before_write(void)
{
struct blocklevel_device *bl;
char buf;
int rc;

scenario_enter(scenario_hiomap_protocol_event_before_action);
assert(!ipmi_hiomap_init(&bl));
rc = bl->write(bl, 0, &buf, sizeof(buf));
assert(rc == FLASH_ERR_AGAIN);
ipmi_hiomap_exit(bl);
scenario_exit();
}

static const struct scenario_event
scenario_hiomap_protocol_persistent_error[] = {
{ .type = scenario_event_p, .p = &hiomap_ack_call, },
Expand Down Expand Up @@ -1122,6 +1136,7 @@ struct test_case test_cases[] = {
TEST_CASE(test_hiomap_protocol_event_during_read),
TEST_CASE(test_hiomap_protocol_write_one_block),
TEST_CASE(test_hiomap_protocol_write_two_blocks),
TEST_CASE(test_hiomap_protocol_event_before_write),
TEST_CASE(test_hiomap_protocol_persistent_error),
{ NULL, NULL },
};
Expand Down

0 comments on commit 4cc5d42

Please sign in to comment.