Skip to content

Commit

Permalink
test-ipmi-hiomap: Add get-info-error test
Browse files Browse the repository at this point in the history
[ Upstream commit bcdd3f1 ]

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 b20312e commit 852d388
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions libflash/test/test-ipmi-hiomap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1428,6 +1428,34 @@ static void test_hiomap_protocol_persistent_error(void)
scenario_exit();
}

static const struct scenario_event
scenario_hiomap_get_info_error[] = {
{ .type = scenario_event_p, .p = &hiomap_ack_call, },
{
.type = scenario_cmd,
.c = {
.req = {
.cmd = HIOMAP_C_GET_INFO,
.seq = 2,
.args = {
[0] = HIOMAP_V2,
},
},
.cc = IPMI_INVALID_COMMAND_ERR,
},
},
SCENARIO_SENTINEL,
};

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

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

struct test_case {
const char *name;
void (*fn)(void);
Expand Down Expand Up @@ -1459,6 +1487,7 @@ struct test_case test_cases[] = {
TEST_CASE(test_hiomap_protocol_action_error),
TEST_CASE(test_hiomap_protocol_persistent_error),
TEST_CASE(test_hiomap_protocol_get_flash_info),
TEST_CASE(test_hiomap_get_info_error),
{ NULL, NULL },
};

Expand Down

0 comments on commit 852d388

Please sign in to comment.