mapper: remove configurable service allowlists
Remove the ability to specify an allow list at runtime. Instead,
introspect any DBus service except those that start with
org.freedesktop. This removes the need for argument parsing code and
complex bitbake metadata.
Skip org.freedesktop because applications (OpenBMC or otherwise) should
access org.freedesktop services directly and not indirectly via the
OpenBMC mapper.
Change-Id: I83038a121580dcde2a2b3b1f994b3066cc9d955f
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/src/test/need_to_introspect.cpp b/src/test/need_to_introspect.cpp
index 3150e3f..e0cb044 100644
--- a/src/test/need_to_introspect.cpp
+++ b/src/test/need_to_introspect.cpp
@@ -5,17 +5,55 @@
// Verify if name is empty, false is returned
TEST(NeedToIntrospect, PassEmptyName)
{
- AllowDenyList allowList;
std::string processName;
- EXPECT_FALSE(needToIntrospect(processName, allowList));
+ EXPECT_FALSE(needToIntrospect(processName));
}
-// Verify if name is on allowlist, true is returned
-TEST(NeedToIntrospect, ValidAllowListName)
+// Verify if name is org, true is returned
+TEST(NeedToIntrospect, NameOrg)
{
- AllowDenyList allowList = {"xyz.openbmc_project"};
- std::string processName = "xyz.openbmc_project.State.Host";
+ std::string processName = "org";
- EXPECT_TRUE(needToIntrospect(processName, allowList));
+ EXPECT_TRUE(needToIntrospect(processName));
+}
+
+// Verify if name is org.freedesktop, false is returned
+TEST(NeedToIntrospect, NameOrgFreedesktop)
+{
+ std::string processName = "org.freedesktop";
+
+ EXPECT_FALSE(needToIntrospect(processName));
+}
+
+// Verify if name is org.freedesktop.foo, false is returned
+TEST(NeedToIntrospect, nameOrgFreeDesktopFoo)
+{
+ std::string processName = "org.freedesktop.foo";
+
+ EXPECT_FALSE(needToIntrospect(processName));
+}
+
+// Verify if name is org.openbmc, true is returned
+TEST(NeedToIntrospect, nameOrgOpenBMC)
+{
+ std::string processName = "org.openbmc";
+
+ EXPECT_TRUE(needToIntrospect(processName));
+}
+
+// Verify if name is a colon, false is returned
+TEST(NeedToIntrospect, NameColon)
+{
+ std::string processName = ":";
+
+ EXPECT_FALSE(needToIntrospect(processName));
+}
+
+// Verify if name is a unique name, false is returned
+TEST(NeedToIntrospect, NameUnique)
+{
+ std::string processName = ":1.32";
+
+ EXPECT_FALSE(needToIntrospect(processName));
}