libpldmresponder: construct BMC PDRs lazily

BMC's PDRs were constructed when the pldm daemon starts up. However, the
pldm daemon might rely on other services to start in order to create
PDRs. To solve this problem, construct the PDRs when the first GetPDR
call comes in. From a practical timing perspective, this ensures the
pldm daemon and the services it needs to build PDRs are all up and
running.

An alternative would be to add 'After' directives in pldm's service
file, however that can get complex when some of the services are not
present on all platforms.

Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
Change-Id: Id6ac9fd47b293f7e84e3837432b32b0e3c3f8a5a
diff --git a/test/libpldmresponder_pdr_effecter_test.cpp b/test/libpldmresponder_pdr_effecter_test.cpp
index e0a54bf..60181d6 100644
--- a/test/libpldmresponder_pdr_effecter_test.cpp
+++ b/test/libpldmresponder_pdr_effecter_test.cpp
@@ -27,7 +27,7 @@
     auto inPDRRepo = pldm_pdr_init();
     auto outPDRRepo = pldm_pdr_init();
     Repo outRepo(outPDRRepo);
-    Handler handler(mockedUtils, "./pdr_jsons/state_effecter/good",
+    Handler handler(&mockedUtils, "./pdr_jsons/state_effecter/good",
                     "./event_jsons/good", inPDRRepo, nullptr, nullptr);
     Repo inRepo(inPDRRepo);
     getRepoByType(inRepo, outRepo, PLDM_STATE_EFFECTER_PDR);
@@ -126,7 +126,7 @@
     auto inPDRRepo = pldm_pdr_init();
     auto outPDRRepo = pldm_pdr_init();
     Repo outRepo(outPDRRepo);
-    Handler handler(mockedUtils, "./pdr_jsons/state_effecter/good", "",
+    Handler handler(&mockedUtils, "./pdr_jsons/state_effecter/good", "",
                     inPDRRepo, nullptr, nullptr);
     Repo inRepo(inPDRRepo);
     getRepoByType(inRepo, outRepo, PLDM_NUMERIC_EFFECTER_PDR);
@@ -172,7 +172,7 @@
     auto inPDRRepo = pldm_pdr_init();
     auto outPDRRepo = pldm_pdr_init();
     Repo outRepo(outPDRRepo);
-    Handler handler(mockedUtils, "./pdr_jsons/state_effecter/good",
+    Handler handler(&mockedUtils, "./pdr_jsons/state_effecter/good",
                     "./event_jsons/good", inPDRRepo, nullptr, nullptr);
     Repo inRepo(inPDRRepo);
     getRepoByType(inRepo, outRepo, PLDM_STATE_EFFECTER_PDR);
@@ -193,7 +193,7 @@
         .WillRepeatedly(Return("foo.bar"));
 
     auto inPDRRepo = pldm_pdr_init();
-    Handler handler(mockedUtils, "./pdr_jsons/state_effecter/good", "",
+    Handler handler(&mockedUtils, "./pdr_jsons/state_effecter/good", "",
                     inPDRRepo, nullptr, nullptr);
     uint16_t entityType = 33;
     uint16_t entityInstance = 0;