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/platform_manager_test.cpp b/platform-mc/test/platform_manager_test.cpp
index 5f0fe35..b1353e7 100644
--- a/platform-mc/test/platform_manager_test.cpp
+++ b/platform-mc/test/platform_manager_test.cpp
@@ -35,7 +35,8 @@
 TEST_F(PlatformManagerTest, initTerminusTest)
 {
     // Add terminus
-    auto mappedTid = mockTerminusManager.mapTid(pldm::MctpInfo(10, "", "", 1));
+    auto mappedTid =
+        mockTerminusManager.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);
@@ -184,7 +185,7 @@
     EXPECT_EQ(rc, PLDM_SUCCESS);
 
     mockTerminusManager.updateMctpEndpointAvailability(
-        pldm::MctpInfo(10, "", "", 1), true);
+        pldm::MctpInfo(10, "", "", 1, std::nullopt), true);
 
     stdexec::sync_wait(platformManager.initTerminus());
     EXPECT_EQ(true, terminus->initialized);
@@ -200,7 +201,8 @@
 TEST_F(PlatformManagerTest, parseTerminusNameTest)
 {
     // Add terminus
-    auto mappedTid = mockTerminusManager.mapTid(pldm::MctpInfo(10, "", "", 1));
+    auto mappedTid =
+        mockTerminusManager.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);
@@ -349,7 +351,7 @@
     EXPECT_EQ(rc, PLDM_SUCCESS);
 
     mockTerminusManager.updateMctpEndpointAvailability(
-        pldm::MctpInfo(10, "", "", 1), true);
+        pldm::MctpInfo(10, "", "", 1, std::nullopt), true);
 
     stdexec::sync_wait(platformManager.initTerminus());
     EXPECT_EQ(true, terminus->initialized);
@@ -360,7 +362,8 @@
 TEST_F(PlatformManagerTest, initTerminusDontSupportGetPDRTest)
 {
     // Add terminus
-    auto mappedTid = mockTerminusManager.mapTid(pldm::MctpInfo(10, "", "", 1));
+    auto mappedTid =
+        mockTerminusManager.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);
@@ -478,7 +481,8 @@
 TEST_F(PlatformManagerTest, negativeInitTerminusTest1)
 {
     // terminus doesn't Type2 support
-    auto mappedTid = mockTerminusManager.mapTid(pldm::MctpInfo(10, "", "", 1));
+    auto mappedTid =
+        mockTerminusManager.mapTid(pldm::MctpInfo(10, "", "", 1, std::nullopt));
     auto tid = mappedTid.value();
     termini[tid] = std::make_shared<pldm::platform_mc::Terminus>(
         tid, 1 << PLDM_BASE, event);
@@ -496,7 +500,8 @@
 TEST_F(PlatformManagerTest, negativeInitTerminusTest2)
 {
     // terminus responses error
-    auto mappedTid = mockTerminusManager.mapTid(pldm::MctpInfo(10, "", "", 1));
+    auto mappedTid =
+        mockTerminusManager.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);