1 #include "src/processing.hpp" 2 3 #include <gtest/gtest.h> 4 5 // Verify if name is empty, false is returned 6 TEST(NeedToIntrospect, PassEmptyName) 7 { 8 AllowDenyList allowList; 9 AllowDenyList denyList; 10 std::string process_name; 11 12 EXPECT_FALSE(needToIntrospect(process_name, allowList, denyList)); 13 } 14 15 // Verify if name is on allowlist, true is returned 16 TEST(NeedToIntrospect, ValidAllowListName) 17 { 18 AllowDenyList allowList = {"xyz.openbmc_project"}; 19 AllowDenyList denyList; 20 std::string process_name = "xyz.openbmc_project.State.Host"; 21 22 EXPECT_TRUE(needToIntrospect(process_name, allowList, denyList)); 23 } 24 25 // Verify if name is on denylist, false is returned 26 TEST(NeedToIntrospect, ValidDenyListName) 27 { 28 AllowDenyList allowList; 29 AllowDenyList denyList = {"xyz.openbmc_project.State.Host"}; 30 std::string process_name = "xyz.openbmc_project.State.Host"; 31 32 EXPECT_FALSE(needToIntrospect(process_name, allowList, denyList)); 33 } 34 35 // Verify if name is on allowlist and denylist, false is returned 36 TEST(NeedToIntrospect, ValidAllowAndDenyListName) 37 { 38 AllowDenyList allowList = {"xyz.openbmc_project"}; 39 AllowDenyList denyList = {"xyz.openbmc_project.State.Host"}; 40 std::string process_name = "xyz.openbmc_project.State.Host"; 41 42 EXPECT_FALSE(needToIntrospect(process_name, allowList, denyList)); 43 } 44