aboutsummaryrefslogtreecommitdiff
path: root/libflash
diff options
context:
space:
mode:
authorAndrew Jeffery <andrew@aj.id.au>2019-02-21 16:58:28 +1030
committerVasant Hegde <hegdevasant@linux.vnet.ibm.com>2019-03-05 09:56:25 +0530
commit243b5e2766913c9594ab47ebc8f9374f3c22f8f8 (patch)
tree2df12273741262e01ec6286a1c951d4a762af3e3 /libflash
parent7722b3fab3acb75cb6b533bfe0a3fc38124b124b (diff)
downloadskiboot-243b5e2766913c9594ab47ebc8f9374f3c22f8f8.zip
skiboot-243b5e2766913c9594ab47ebc8f9374f3c22f8f8.tar.gz
skiboot-243b5e2766913c9594ab47ebc8f9374f3c22f8f8.tar.bz2
test-ipmi-hiomap: Add action-error test
[ Upstream commit ecf6430d1ee99368bfdacc808cabfec5e515610b ] 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>
Diffstat (limited to 'libflash')
-rw-r--r--libflash/test/test-ipmi-hiomap.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/libflash/test/test-ipmi-hiomap.c b/libflash/test/test-ipmi-hiomap.c
index 6e9d8e7..7e76891 100644
--- a/libflash/test/test-ipmi-hiomap.c
+++ b/libflash/test/test-ipmi-hiomap.c
@@ -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, },
@@ -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 },
};