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/platform-mc/test/event_manager_test.cpp b/platform-mc/test/event_manager_test.cpp
index bb4706f..79aa0f4 100644
--- a/platform-mc/test/event_manager_test.cpp
+++ b/platform-mc/test/event_manager_test.cpp
@@ -171,7 +171,8 @@
 TEST_F(EventManagerTest, SetEventReceiverTest)
 {
     // Add terminus
-    auto mappedTid = terminusManager.mapTid(pldm::MctpInfo(10, "", "", 1));
+    auto mappedTid =
+        terminusManager.mapTid(pldm::MctpInfo(10, "", "", 1, std::nullopt));
     auto tid = mappedTid.value();
     termini[tid] = std::make_shared<pldm::platform_mc::Terminus>(
         tid, 1 << PLDM_BASE | 1 << PLDM_PLATFORM, event);
@@ -363,7 +364,7 @@
     EXPECT_EQ(rc, PLDM_SUCCESS);
 
     terminusManager.updateMctpEndpointAvailability(
-        pldm::MctpInfo(10, "", "", 1), true);
+        pldm::MctpInfo(10, "", "", 1, std::nullopt), true);
 
     // queue SetEventReceiver response
     const size_t SetEventReceiverLen = 1;
@@ -401,7 +402,8 @@
 TEST_F(EventManagerTest, pollForPlatformEventTaskMultipartTransferTest)
 {
     // Add terminus
-    auto mappedTid = terminusManager.mapTid(pldm::MctpInfo(10, "", "", 1));
+    auto mappedTid =
+        terminusManager.mapTid(pldm::MctpInfo(10, "", "", 1, std::nullopt));
     auto tid = mappedTid.value();
     termini[tid] = std::make_shared<pldm::platform_mc::Terminus>(
         tid, 1 << PLDM_BASE | 1 << PLDM_PLATFORM, event);
@@ -493,7 +495,7 @@
     EXPECT_EQ(rc, PLDM_SUCCESS);
 
     terminusManager.updateMctpEndpointAvailability(
-        pldm::MctpInfo(10, "", "", 1), true);
+        pldm::MctpInfo(10, "", "", 1, std::nullopt), true);
 
     EXPECT_CALL(eventManager, processCperEvent(_, _, _, _))
         .Times(1)