aboutsummaryrefslogtreecommitdiff
path: root/libflash
diff options
context:
space:
mode:
authorAndrew Jeffery <andrew@aj.id.au>2019-02-21 16:58:27 +1030
committerStewart Smith <stewart@linux.ibm.com>2019-02-24 17:43:37 -0600
commit077d19d8240552153688bef86a5f08c76197ed46 (patch)
treeee7370339080f415ab6765a16cb26210f545e1e0 /libflash
parentc2a4b4988eccbc8c73d366be6c7356f78385112f (diff)
downloadskiboot-077d19d8240552153688bef86a5f08c76197ed46.zip
skiboot-077d19d8240552153688bef86a5f08c76197ed46.tar.gz
skiboot-077d19d8240552153688bef86a5f08c76197ed46.tar.bz2
test-ipmi-hiomap: Add bad-sequence test
Cc: stable Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
Diffstat (limited to 'libflash')
-rw-r--r--libflash/test/test-ipmi-hiomap.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/libflash/test/test-ipmi-hiomap.c b/libflash/test/test-ipmi-hiomap.c
index 95bb353..6e9d8e7 100644
--- a/libflash/test/test-ipmi-hiomap.c
+++ b/libflash/test/test-ipmi-hiomap.c
@@ -1296,6 +1296,36 @@ static void test_hiomap_protocol_event_during_erase(void)
scenario_exit();
}
+static const struct scenario_event scenario_hiomap_protocol_bad_sequence[] = {
+ {
+ .type = scenario_cmd,
+ .c = {
+ .req = {
+ .cmd = HIOMAP_C_ACK,
+ .seq = 1,
+ .args = {
+ [0] = HIOMAP_E_ACK_MASK,
+ },
+ },
+ .cc = IPMI_CC_NO_ERROR,
+ .resp = {
+ .cmd = HIOMAP_C_ACK,
+ .seq = 0,
+ },
+ },
+ },
+ SCENARIO_SENTINEL,
+};
+
+static void test_hiomap_protocol_bad_sequence(void)
+{
+ struct blocklevel_device *bl;
+
+ scenario_enter(scenario_hiomap_protocol_bad_sequence);
+ 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, },
@@ -1351,6 +1381,7 @@ struct test_case test_cases[] = {
TEST_CASE(test_hiomap_protocol_erase_two_blocks),
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_persistent_error),
{ NULL, NULL },
};