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/libpldmresponder/test/libpldmresponder_base_test.cpp b/libpldmresponder/test/libpldmresponder_base_test.cpp
index 60edae3..f1ecfc3 100644
--- a/libpldmresponder/test/libpldmresponder_base_test.cpp
+++ b/libpldmresponder/test/libpldmresponder_base_test.cpp
@@ -1,5 +1,7 @@
 #include "common/utils.hpp"
 #include "libpldmresponder/base.hpp"
+#include "pldmd/instance_id.hpp"
+#include "test/test_instance_id.hpp"
 
 #include <libpldm/base.h>
 #include <string.h>
@@ -16,11 +18,13 @@
 {
   protected:
     TestBaseCommands() :
-        requester(pldm::utils::DBusHandler::getBus(), "/abc/def"),
+        instanceIdDb(), requester(pldm::utils::DBusHandler::getBus(),
+                                  "/abc/def", this->instanceIdDb),
         event(sdeventplus::Event::get_default())
     {}
 
     uint8_t mctpEid = 0;
+    TestInstanceIdDb instanceIdDb;
     Requester requester;
     sdeventplus::Event event;
 };
diff --git a/libpldmresponder/test/meson.build b/libpldmresponder/test/meson.build
index 740e307..73938b4 100644
--- a/libpldmresponder/test/meson.build
+++ b/libpldmresponder/test/meson.build
@@ -21,19 +21,13 @@
   ]
 endif
 
-  dep_src_files = [
-  '../../pldmd/instance_id.cpp',
-  '../../pldmd/dbus_impl_requester.cpp'
-  ]
-dep_src = declare_dependency(sources: dep_src_files,include_directories: '../../requester')
-
 foreach t : tests
   test(t, executable(t.underscorify(), t + '.cpp',
                      implicit_include_directories: false,
+                     include_directories: [ '../../requester', '../../pldmd' ],
                      link_args: dynamic_linker,
                      build_rpath: get_option('oe-sdk').enabled() ? rpath : '',
                      dependencies: [
-                         dep_src,
                          libpldm_dep,
                          libpldmresponder_dep,
                          libpldmutils,