pldmd: move to libpldm instance ID alloc/free

Refactor the dbus_api::Requester class to be implemented in terms of
libpldm's instance ID database. To make that easier to deal with we
introduce a light-weight RAII C++ binding along with a helper class for
unit tests.

Change-Id: Ia03de8245dfb114e6266ba36dcf26ca4398a4ce0
Signed-off-by: Rashmica Gupta <rashmica@linux.ibm.com>
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
diff --git a/fw-update/test/inventory_manager_test.cpp b/fw-update/test/inventory_manager_test.cpp
index dbf5722..1f7d142 100644
--- a/fw-update/test/inventory_manager_test.cpp
+++ b/fw-update/test/inventory_manager_test.cpp
@@ -1,6 +1,7 @@
 #include "common/utils.hpp"
 #include "fw-update/inventory_manager.hpp"
 #include "requester/test/mock_request.hpp"
+#include "test/test_instance_id.hpp"
 
 #include <libpldm/firmware_update.h>
 
@@ -14,9 +15,9 @@
 {
   protected:
     InventoryManagerTest() :
-        event(sdeventplus::Event::get_default()),
+        event(sdeventplus::Event::get_default()), instanceIdDb(),
         dbusImplRequester(pldm::utils::DBusHandler::getBus(),
-                          "/xyz/openbmc_project/pldm"),
+                          "/xyz/openbmc_project/pldm", instanceIdDb),
         reqHandler(fd, event, dbusImplRequester, false, 90000, seconds(1), 2,
                    milliseconds(100)),
         inventoryManager(reqHandler, dbusImplRequester, outDescriptorMap,
@@ -25,6 +26,7 @@
 
     int fd = -1;
     sdeventplus::Event event;
+    TestInstanceIdDb instanceIdDb;
     pldm::dbus_api::Requester dbusImplRequester;
     requester::Handler<requester::Request> reqHandler;
     InventoryManager inventoryManager;
diff --git a/fw-update/test/meson.build b/fw-update/test/meson.build
index 9b3cfd6..ee1bdb1 100644
--- a/fw-update/test/meson.build
+++ b/fw-update/test/meson.build
@@ -5,8 +5,7 @@
             '../device_updater.cpp',
             '../update_manager.cpp',
             '../../common/utils.cpp',
-            '../../pldmd/dbus_impl_requester.cpp',
-            '../../pldmd/instance_id.cpp'])
+          ])
 
 tests = [
   'inventory_manager_test',
@@ -17,6 +16,7 @@
 foreach t : tests
   test(t, executable(t.underscorify(), t + '.cpp',
                      implicit_include_directories: false,
+                     include_directories: '../../pldmd',
                      link_args: dynamic_linker,
                      build_rpath: get_option('oe-sdk').enabled() ? rpath : '',
                      dependencies: [