5 #include <boost/asio.hpp>
6 #include <boost/bind.hpp>
13 #include "testing/gunit.h"
27 class PolicyTest :
public ::testing::Test {
33 TEST_F(PolicyTest, Basic) {
38 policy_c_s1.
vpc_id = vpc_id1;
40 policy_c_s1.
name.clear();
41 policy_c_s1.
name.append(
"Contrail Employee SG");
58 pd->
Init(policy_c_s1);
63 EXPECT_TRUE(NULL != ptable->FindActiveEntry(
new PolicyKey(policy_id1)));
68 TEST_F(PolicyTest, ChangeAnEntry) {
73 policy_c_s1.
vpc_id = vpc_id1;
75 policy_c_s1.
name.clear();
76 policy_c_s1.
name.append(
"Contrail Employee SG");
93 pd->
Init(policy_c_s1);
99 EXPECT_TRUE(NULL != ptable->FindActiveEntry(
new PolicyKey(policy_id1)));
106 (ptable->FindActiveEntry(
new PolicyKey(policy_id1)));
107 EXPECT_TRUE(NULL != pe);
113 pd1->
Init(policy_c_s1);
114 req1.
data.reset(pd1);
120 EXPECT_TRUE(NULL != ap);
133 int main (
int argc,
char **argv) {
135 ::testing::InitGoogleTest(&argc, argv);
136 return RUN_ALL_TESTS();
static boost::uuids::uuid StringToUuid(const std::string &str)
DBTableBase * CreateTable(const std::string &name)
std::unique_ptr< DBRequestData > data
bool Enqueue(DBRequest *req)
std::unique_ptr< DBRequestKey > key
TEST_F(TestDummy, test_1)
void Init(const PolicyConfigSpec &policy_cfg)
void TableListener(DBTablePartBase *root, DBEntryBase *entry)
AclPtr FindAcl(const bool inbound, const uuid acl_id)
DBTableBase * FindTable(const std::string &name)