Event : add MemberId in TestEvent
Currently the memberId is missing in the Event structure of
TestEvent but memeberId
must be present in the Event structure as per DMTF schema
https://redfish.dmtf.org/schemas/v1/Event.v1_10_1.json
Therefore added MemberId in Test event structure.
Tested :
```
curl -k -u root:0penBmc -X POST /redfish/v1/EventService/Actions/
EventService.SubmitTestEvent -d '{"MessageId":""}'
Event received at the Redfish-Event-Listener
bodydata: {
"@odata.type": "#Event.v1_4_0.Event",
"Events": [
{
"Context": "",
"EventId": "TestID",
"EventTimestamp": "2024-08-13T08:14:56+00:00",
"EventType": "Event",
"MemberId": 0,
"Message": "Generated test event",
"MessageArgs": [],
"MessageId": "OpenBMC.0.2.TestEventLog",
"Severity": "OK"
}
],
"Id": "1",
"Name": "Event Log"
}
```
Change-Id: I285e41ce377127fb1429f643e5068635384c7bfd
Signed-off-by: Chandramohan Harkude <chandramohan.harkude@gmail.com>
diff --git a/redfish-core/include/event_service_manager.hpp b/redfish-core/include/event_service_manager.hpp
index b004bde..f1903d4 100644
--- a/redfish-core/include/event_service_manager.hpp
+++ b/redfish-core/include/event_service_manager.hpp
@@ -380,6 +380,8 @@
logEntryJson["Severity"] = log_entry::EventSeverity::OK;
logEntryJson["Message"] = "Generated test event";
logEntryJson["MessageId"] = "OpenBMC.0.2.TestEventLog";
+ // MemberId is 0 : since we are sending one event record.
+ logEntryJson["MemberId"] = 0;
logEntryJson["MessageArgs"] = nlohmann::json::array();
logEntryJson["EventTimestamp"] =
redfish::time_utils::getDateTimeOffsetNow().first;