PEL: Support 'PossibleSubsystems' in msg registry
Add a 'PossibleSubsystems' field to the message registry schema where
someone can list which subsystems they might pass into the PEL_SUBSYSTEM
AdditionalData property field when creating a PEL.
The PossibleSubsystems value will be used by a off-BMC script that
generates field documentation for SRCs, so it knows what all SRC ASCII
string values are possible for that entry since the subsystem is part of
them. For example, if that field was ['processor', 'memory'], then that
means the possible SRCs are BD10AAAA and BD20AAAA for reason code
'AAAA'.
The Subsystem and PossibleSubsystems fields are mutually exclusive in
the message registry, so code changes had to be made to support the
subsystem field now being optional.
There is now a chance that even though the subsystem is supposed to be
passed in using PEL_SUBSYSTEM, it isn't. In that case, the 'Other'
subsystem will be used, since it seems fairly generic.
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: Ic8087fc46b2a192459b7287186f8972610e84730
diff --git a/test/openpower-pels/registry_test.cpp b/test/openpower-pels/registry_test.cpp
index c7d88c9..5cfd5e5 100644
--- a/test/openpower-pels/registry_test.cpp
+++ b/test/openpower-pels/registry_test.cpp
@@ -101,6 +101,21 @@
"dump that provides debug information."
]
}
+ },
+
+ {
+ "Name": "xyz.openbmc_project.Common.Error.Timeout",
+ "PossibleSubsystems": ["processor", "memory"],
+
+ "SRC":
+ {
+ "ReasonCode": "0x2030"
+ },
+ "Documentation":
+ {
+ "Description": "A PGOOD Fault",
+ "Message": "PS had a PGOOD Fault"
+ }
}
]
}
@@ -651,3 +666,14 @@
}
}
}
+
+TEST_F(RegistryTest, TestNoSubsystem)
+{
+ auto path = RegistryTest::writeData(registryData);
+ Registry registry{path};
+
+ auto entry = registry.lookup("xyz.openbmc_project.Common.Error.Timeout",
+ LookupType::name);
+ ASSERT_TRUE(entry);
+ EXPECT_FALSE(entry->subsystem);
+}