aboutsummaryrefslogtreecommitdiff
path: root/libflash
diff options
context:
space:
mode:
authorAndrew Jeffery <andrew@aj.id.au>2019-02-21 16:58:27 +1030
committerVasant Hegde <hegdevasant@linux.vnet.ibm.com>2019-03-04 21:15:05 +0530
commitd69b6567669b32d2801a746eb1336ec60177a184 (patch)
treefa1799ed2a27f06c284ccc5fb8e9ed212130c647 /libflash
parent7d666e226bd99ea7a2005b21412d43d4a2523380 (diff)
downloadskiboot-d69b6567669b32d2801a746eb1336ec60177a184.zip
skiboot-d69b6567669b32d2801a746eb1336ec60177a184.tar.gz
skiboot-d69b6567669b32d2801a746eb1336ec60177a184.tar.bz2
test-ipmi-hiomap: Add bad-sequence test
[ Upstream commit 077d19d8240552153688bef86a5f08c76197ed46 ] 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.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 },
};