[Skiboot] [PATCH 29/51] test-ipmi-hiomap: Add get-info-error test

Andrew Jeffery andrew at aj.id.au
Fri Feb 15 17:56:46 AEDT 2019


Signed-off-by: Andrew Jeffery <andrew at aj.id.au>
---
 libflash/test/test-ipmi-hiomap.c | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/libflash/test/test-ipmi-hiomap.c b/libflash/test/test-ipmi-hiomap.c
index e29242f73b69..4d050e804302 100644
--- a/libflash/test/test-ipmi-hiomap.c
+++ b/libflash/test/test-ipmi-hiomap.c
@@ -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);
@@ -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 },
 };
 
-- 
2.19.1



More information about the Skiboot mailing list