Adding CPUCore interface support
This commit introduces essential D-Bus infrastructure support for
hosting the `Item.CPUCore` D-Bus object. Additionally, it includes
getter and setter functions to enable get/set properties within the
`CPUCore` interface, such as core count and microcode.
Testing:
Unit test passed
Change-Id: I728522b34e96ee7d6609efb5746b40cf923812e8
Signed-off-by: Kamalkumar Patel <kamalkumar.patel@ibm.com>
diff --git a/host-bmc/test/custom_dbus_test.cpp b/host-bmc/test/custom_dbus_test.cpp
index be23924..cce0a92 100644
--- a/host-bmc/test/custom_dbus_test.cpp
+++ b/host-bmc/test/custom_dbus_test.cpp
@@ -14,3 +14,15 @@
EXPECT_NE(retLocationCode, std::nullopt);
EXPECT_EQ(locationCode, retLocationCode);
}
+
+TEST(CustomDBus, MicroCode)
+{
+ std::string tmpPath = "/abc/def";
+ uint32_t value = 32;
+
+ CustomDBus::getCustomDBus().setMicroCode(tmpPath, value);
+ auto retMicroCode = CustomDBus::getCustomDBus().getMicroCode(tmpPath);
+
+ EXPECT_NE(retMicroCode, std::nullopt);
+ EXPECT_EQ(value, retMicroCode);
+}
diff --git a/host-bmc/test/meson.build b/host-bmc/test/meson.build
index d102ff7..f994552 100644
--- a/host-bmc/test/meson.build
+++ b/host-bmc/test/meson.build
@@ -6,6 +6,7 @@
'../../common/utils.cpp',
'../utils.cpp',
'../dbus/custom_dbus.cpp',
+ '../dbus/cpu_core.cpp',
]
tests = [