blob: 3150e3fbcf75fcc5383bc9ff686d7ac02a0020e1 [file] [log] [blame]
Andrew Geissler82815da2019-02-04 12:19:41 -06001#include "src/processing.hpp"
2
3#include <gtest/gtest.h>
4
5// Verify if name is empty, false is returned
6TEST(NeedToIntrospect, PassEmptyName)
7{
Brad Bishopf944a452022-05-05 15:06:46 -04008 AllowDenyList allowList;
Brad Bishopa098a372022-05-05 15:19:04 -04009 std::string processName;
Andrew Geissler82815da2019-02-04 12:19:41 -060010
Brad Bishopd5542322022-06-02 19:56:23 -040011 EXPECT_FALSE(needToIntrospect(processName, allowList));
Andrew Geissler82815da2019-02-04 12:19:41 -060012}
13
Brad Bishopf944a452022-05-05 15:06:46 -040014// Verify if name is on allowlist, true is returned
15TEST(NeedToIntrospect, ValidAllowListName)
Andrew Geissler82815da2019-02-04 12:19:41 -060016{
Brad Bishopf944a452022-05-05 15:06:46 -040017 AllowDenyList allowList = {"xyz.openbmc_project"};
Brad Bishopa098a372022-05-05 15:19:04 -040018 std::string processName = "xyz.openbmc_project.State.Host";
Andrew Geissler82815da2019-02-04 12:19:41 -060019
Brad Bishopd5542322022-06-02 19:56:23 -040020 EXPECT_TRUE(needToIntrospect(processName, allowList));
Andrew Geissler82815da2019-02-04 12:19:41 -060021}