blob: 6912619b45a04e241aad77f7e4979b598b6406b1 [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{
8 WhiteBlackList whiteList;
9 WhiteBlackList blackList;
10 std::string process_name;
11
12 EXPECT_FALSE(needToIntrospect(process_name, whiteList, blackList));
13}
14
15// Verify if name is on whitelist, true is returned
16TEST(NeedToIntrospect, ValidWhiteListName)
17{
18 WhiteBlackList whiteList = {"xyz.openbmc_project"};
19 WhiteBlackList blackList;
20 std::string process_name = "xyz.openbmc_project.State.Host";
21
22 EXPECT_TRUE(needToIntrospect(process_name, whiteList, blackList));
23}
24
25// Verify if name is on blacklist, false is returned
26TEST(NeedToIntrospect, ValidBlackListName)
27{
28 WhiteBlackList whiteList;
29 WhiteBlackList blackList = {"xyz.openbmc_project.State.Host"};
30 std::string process_name = "xyz.openbmc_project.State.Host";
31
32 EXPECT_FALSE(needToIntrospect(process_name, whiteList, blackList));
33}
34
35// Verify if name is on whitelist and blacklist, false is returned
36TEST(NeedToIntrospect, ValidWhiteAndBlackListName)
37{
38 WhiteBlackList whiteList = {"xyz.openbmc_project"};
39 WhiteBlackList blackList = {"xyz.openbmc_project.State.Host"};
40 std::string process_name = "xyz.openbmc_project.State.Host";
41
42 EXPECT_FALSE(needToIntrospect(process_name, whiteList, blackList));
43}