requester: associate Entity Manager configs with MCTP endpoints
Currently, pldmd listens for new MCTP endpoint exposed by mctpd, but
they only shows their EID, Network Id, and SupportedMessageTypes, which
cannot fulfill some requirements, e.g., get the device's name or which
board it belongs to.
In openbmc, the additional information are exposed by Entity
Manager[1][2], so add this ability to `MctpDiscovery, it queries the
association between MCTP endpoints and Entity Manager configurations
from MCTP Reactor, when a new MCTP endpoint has been register by mctpd.
Added unit test for this commit to validate the association does work,
passed.
[1]: https://github.com/openbmc/entity-manager/blob/master/schemas/mctp.json
[2]: https://gerrit.openbmc.org/c/openbmc/dbus-sensors/+/69111
Change-Id: Ibf1717f1840e527f21bd8397e747ae121e2dcd25
Signed-off-by: Unive Tien <unive.tien.wiwynn@gmail.com>
diff --git a/common/test/mocked_utils.hpp b/common/test/mocked_utils.hpp
index ad6f8dc..1cec506 100644
--- a/common/test/mocked_utils.hpp
+++ b/common/test/mocked_utils.hpp
@@ -72,4 +72,13 @@
MOCK_METHOD(pldm::utils::GetSubTreePathsResponse, getSubTreePaths,
(const std::string&, int, const std::vector<std::string>&),
(const override));
+
+ MOCK_METHOD(pldm::utils::GetAssociatedSubTreeResponse, getAssociatedSubTree,
+ (const sdbusplus::message::object_path&,
+ const sdbusplus::message::object_path&, int,
+ const std::vector<std::string>&),
+ (const override));
+
+ MOCK_METHOD(pldm::utils::PropertyMap, getDbusPropertiesVariant,
+ (const char*, const char*, const char*), (const override));
};