utils: Add function to check if PSU is associated
Add a helper function to check if a PSU is in an association list, which
will be used in future commits to check if a PSU is running a software
image.
Tested: added unit test case and verify it passes.
Signed-off-by: Lei YU <mine260309@gmail.com>
Change-Id: I99b5d3d8d09f8e09a1eb42ba104a4804b7214cf1
diff --git a/test/mocked_utils.hpp b/test/mocked_utils.hpp
index cd85c3c..71aac99 100644
--- a/test/mocked_utils.hpp
+++ b/test/mocked_utils.hpp
@@ -30,6 +30,9 @@
MOCK_CONST_METHOD1(getLatestVersion,
std::string(const std::set<std::string>& versions));
+ MOCK_CONST_METHOD2(isAssociated, bool(const std::string& psuInventoryPath,
+ const AssociationList& assocs));
+
MOCK_CONST_METHOD5(getPropertyImpl,
any(sdbusplus::bus::bus& bus, const char* service,
const char* path, const char* interface,