redfish: systems: eventlog: fix "Verify Subscribe An Event" test failed
Symptom:
"Verify Subscribe An Event" test item in test_event_service.robotgot failed.
Root cause:
From test report that error message is
Key HttpHeaders: [] != [{'Content': 'application/json'}]
The HttpHeaders content is not same as between ${payload} and ${resp.dict}
Thus, cause this test item got failed.
However, we found that bmcweb seems change the HttpHeaders response as NULL
in this commit "Nullify HttpHeaders per the specification".
Thus, the response "HttpHeaders": [] that didn't match payload Content in test item.
More detail can refer to below bmcweb commit:
Per the definition of HttpHeaders in the schema "This object shall be
null or an empty array in responses." This commit does as the
specification commands.
https://github.com/openbmc/bmcweb/commit/ad22fefecaf7988fd7072dc71042efbf86fc5162
Solution:
Correct payload content to match bmcweb current design.
Tested:
Run robot "Verify Subscribe An Event" of test_event_service.robot
Signed-off-by: Tim Lee <timlee660101@gmail.com>
Change-Id: Id877bba7093508209ed2eb486ced775c8c26f1a7
diff --git a/redfish/systems/eventlog/test_event_service.robot b/redfish/systems/eventlog/test_event_service.robot
index bde18fb..ab25fdf 100644
--- a/redfish/systems/eventlog/test_event_service.robot
+++ b/redfish/systems/eventlog/test_event_service.robot
@@ -34,16 +34,13 @@
Should Be Empty ${subscription_list}
- ${HttpHeaders_dict}= Create Dictionary Content=application/json
- ${HttpHeaders_list}= Create List ${HttpHeaders_dict}
${RegistryPrefixes_list}= Create List Base OpenBMC TaskEvent
${ResourceTypes_list}= Create List Task
${payload}= Create Dictionary
... Context=Test_Context Destination=https://${REMOTE_SERVER_IP}:${HTTPS_PORT}/
- ... EventFormatType=Event Protocol=Redfish HttpHeaders=${HttpHeaders_list}
- ... SubscriptionType=RedfishEvent RegistryPrefixes=${RegistryPrefixes_list}
- ... ResourceTypes=${ResourceTypes_list}
+ ... EventFormatType=Event Protocol=Redfish SubscriptionType=RedfishEvent
+ ... RegistryPrefixes=${RegistryPrefixes_list} ResourceTypes=${ResourceTypes_list}
Redfish.Post /redfish/v1/EventService/Subscriptions body=&{payload}
... valid_status_codes=[${HTTP_CREATED}]