From f12b57b27157418bbc2c1bf96f1d1cd9db52739b Mon Sep 17 00:00:00 2001 From: Sui Chen Date: Sun, 10 Apr 2022 23:08:53 -0700 Subject: Add OpenBMC.1.0.ServiceStarted to registry This change adds OpenBMC.1.0.ServiceStarted to the registry, and adds a test case for getMessage and getMessageFromRegistry. The getMessageFromRegistry function is moved to a .cpp file so it can be called from the test. Unit test passes. When tested in QEMU: With https://gerrit.openbmc-project.xyz/c/openbmc/openbmc/+/52591 applied, restarting a service generates a corresponding log entry. bmc# systemctl restart rsyslogd host$ wget -q -O - \ http://localhost:10080/redfish/v1/Systems/system/LogServices/EventLog/Entries/ ... { "@odata.id": /redfish/v1/Systems/system/LogServices/EventLog/Entries/47441_1", "@odata.type": "#LogEntry.v1_8_0.LogEntry", "Created": "1970-01-01T13:10:41+00:00", "EntryType": "Event", "Id": "47441_1", "Message": "Service rsyslog.service has started successfully.", "MessageArgs": [ "rsyslog.service" ], "MessageId": "OpenBMC.1.0.ServiceStarted", "Name": "System Event Log Entry", "Severity": "OK" }, Signed-off-by: Sui Chen Change-Id: Iea6fa6e3ea8591853169043c1c04f5a7cf00b2f6 --- .../include/registries/openbmc_message_registry.hpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'redfish-core/include/registries') diff --git a/redfish-core/include/registries/openbmc_message_registry.hpp b/redfish-core/include/registries/openbmc_message_registry.hpp index db624e73b6..80d30c30f6 100644 --- a/redfish-core/include/registries/openbmc_message_registry.hpp +++ b/redfish-core/include/registries/openbmc_message_registry.hpp @@ -21,12 +21,12 @@ namespace redfish::registries::openbmc const Header header = { "Copyright 2022 OpenBMC. All rights reserved.", "#MessageRegistry.v1_4_0.MessageRegistry", - "OpenBMC.0.3.1", + "OpenBMC.0.4.0", "OpenBMC Message Registry", "en", "This registry defines the base messages for OpenBMC.", "OpenBMC", - "0.3.1", + "0.4.0", "OpenBMC", }; constexpr std::array registry = { @@ -2120,6 +2120,15 @@ constexpr std::array registry = { {"string"}, "None.", }}, + MessageEntry{"ServiceStarted", + { + "Indicates that a service has started successfully.", + "Service %1 has started successfully.", + "OK", + 1, + {"string"}, + "None.", + }}, MessageEntry{"SparingRedundancyDegraded", { "Indicates the sparing redundancy state is degraded.", -- cgit v1.2.3