Skip to content

Commit

Permalink
test-ipmi-hiomap: Add action-error test
Browse files Browse the repository at this point in the history
Cc: stable
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
  • Loading branch information
amboar authored and stewartsmith committed Feb 24, 2019
1 parent 077d19d commit ecf6430
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions libflash/test/test-ipmi-hiomap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1326,6 +1326,35 @@ static void test_hiomap_protocol_bad_sequence(void)
scenario_exit();
}

static const struct scenario_event scenario_hiomap_protocol_action_error[] = {
{
.type = scenario_cmd,
.c = {
/* Ack is legitimate, but we'll pretend it's invalid */
.req = {
.cmd = HIOMAP_C_ACK,
.seq = 1,
.args = { [0] = 0x3 },
},
.cc = IPMI_INVALID_COMMAND_ERR,
.resp = {
.cmd = HIOMAP_C_ACK,
.seq = 1,
},
},
},
SCENARIO_SENTINEL,
};

static void test_hiomap_protocol_action_error(void)
{
struct blocklevel_device *bl;

scenario_enter(scenario_hiomap_protocol_action_error);
assert(ipmi_hiomap_init(&bl) > 0);
scenario_exit();
}

static const struct scenario_event
scenario_hiomap_protocol_persistent_error[] = {
{ .type = scenario_event_p, .p = &hiomap_ack_call, },
Expand Down Expand Up @@ -1382,6 +1411,7 @@ struct test_case test_cases[] = {
TEST_CASE(test_hiomap_protocol_event_before_erase),
TEST_CASE(test_hiomap_protocol_event_during_erase),
TEST_CASE(test_hiomap_protocol_bad_sequence),
TEST_CASE(test_hiomap_protocol_action_error),
TEST_CASE(test_hiomap_protocol_persistent_error),
{ NULL, NULL },
};
Expand Down

0 comments on commit ecf6430

Please sign in to comment.