Commit 8732c7a0 authored by Francis Dupont's avatar Francis Dupont
Browse files

[295-min-max-lease-time-configuration-options] Fixed rebase errors (2)

parent a8b91c6d
......@@ -1456,8 +1456,6 @@ TEST_F(Dhcpv4SrvTest, RenewDefaultLifetime) {
ASSERT_NO_THROW(srv.reset(new NakedDhcpv4Srv(0)));
const IOAddress addr("192.0.2.106");
const uint32_t temp_t1 = 50;
const uint32_t temp_t2 = 75;
const uint32_t temp_valid = 100;
const time_t temp_timestamp = time(NULL) - 10;
......@@ -1472,18 +1470,15 @@ TEST_F(Dhcpv4SrvTest, RenewDefaultLifetime) {
HWAddrPtr hwaddr2(new HWAddr(hwaddr2_data, sizeof(hwaddr2_data), HTYPE_ETHER));
Lease4Ptr used(new Lease4(IOAddress("192.0.2.106"), hwaddr2,
&client_id_->getDuid()[0], client_id_->getDuid().size(),
temp_valid, temp_t1, temp_t2, temp_timestamp,
subnet_->getID()));
temp_valid, temp_timestamp, subnet_->getID()));
ASSERT_TRUE(LeaseMgrFactory::instance().addLease(used));
// Check that the lease is really in the database
Lease4Ptr l = LeaseMgrFactory::instance().getLease4(addr);
ASSERT_TRUE(l);
// Check that T1, T2, preferred, valid and cltt really set.
// Check that valid and cltt really set.
// Constructed lease looks as if it was assigned 10 seconds ago
// EXPECT_EQ(l->t1_, temp_t1);
// EXPECT_EQ(l->t2_, temp_t2);
EXPECT_EQ(l->valid_lft_, temp_valid);
EXPECT_EQ(l->cltt_, temp_timestamp);
......@@ -1544,8 +1539,6 @@ TEST_F(Dhcpv4SrvTest, RenewHintLifetime) {
ASSERT_NO_THROW(srv.reset(new NakedDhcpv4Srv(0)));
const IOAddress addr("192.0.2.106");
const uint32_t temp_t1 = 50;
const uint32_t temp_t2 = 75;
const uint32_t temp_valid = 100;
const time_t temp_timestamp = time(NULL) - 10;
......@@ -1560,18 +1553,15 @@ TEST_F(Dhcpv4SrvTest, RenewHintLifetime) {
HWAddrPtr hwaddr2(new HWAddr(hwaddr2_data, sizeof(hwaddr2_data), HTYPE_ETHER));
Lease4Ptr used(new Lease4(IOAddress("192.0.2.106"), hwaddr2,
&client_id_->getDuid()[0], client_id_->getDuid().size(),
temp_valid, temp_t1, temp_t2, temp_timestamp,
subnet_->getID()));
temp_valid, temp_timestamp, subnet_->getID()));
ASSERT_TRUE(LeaseMgrFactory::instance().addLease(used));
// Check that the lease is really in the database
Lease4Ptr l = LeaseMgrFactory::instance().getLease4(addr);
ASSERT_TRUE(l);
// Check that T1, T2, preferred, valid and cltt really set.
// Check that valid and cltt really set.
// Constructed lease looks as if it was assigned 10 seconds ago
// EXPECT_EQ(l->t1_, temp_t1);
// EXPECT_EQ(l->t2_, temp_t2);
EXPECT_EQ(l->valid_lft_, temp_valid);
EXPECT_EQ(l->cltt_, temp_timestamp);
......@@ -1636,8 +1626,6 @@ TEST_F(Dhcpv4SrvTest, RenewMinLifetime) {
ASSERT_NO_THROW(srv.reset(new NakedDhcpv4Srv(0)));
const IOAddress addr("192.0.2.106");
const uint32_t temp_t1 = 50;
const uint32_t temp_t2 = 75;
const uint32_t temp_valid = 100;
const time_t temp_timestamp = time(NULL) - 10;
......@@ -1652,18 +1640,15 @@ TEST_F(Dhcpv4SrvTest, RenewMinLifetime) {
HWAddrPtr hwaddr2(new HWAddr(hwaddr2_data, sizeof(hwaddr2_data), HTYPE_ETHER));
Lease4Ptr used(new Lease4(IOAddress("192.0.2.106"), hwaddr2,
&client_id_->getDuid()[0], client_id_->getDuid().size(),
temp_valid, temp_t1, temp_t2, temp_timestamp,
subnet_->getID()));
temp_valid, temp_timestamp, subnet_->getID()));
ASSERT_TRUE(LeaseMgrFactory::instance().addLease(used));
// Check that the lease is really in the database
Lease4Ptr l = LeaseMgrFactory::instance().getLease4(addr);
ASSERT_TRUE(l);
// Check that T1, T2, preferred, valid and cltt really set.
// Check that valid and cltt really set.
// Constructed lease looks as if it was assigned 10 seconds ago
// EXPECT_EQ(l->t1_, temp_t1);
// EXPECT_EQ(l->t2_, temp_t2);
EXPECT_EQ(l->valid_lft_, temp_valid);
EXPECT_EQ(l->cltt_, temp_timestamp);
......@@ -1728,8 +1713,6 @@ TEST_F(Dhcpv4SrvTest, RenewMaxLifetime) {
ASSERT_NO_THROW(srv.reset(new NakedDhcpv4Srv(0)));
const IOAddress addr("192.0.2.106");
const uint32_t temp_t1 = 50;
const uint32_t temp_t2 = 75;
const uint32_t temp_valid = 100;
const time_t temp_timestamp = time(NULL) - 10;
......@@ -1744,18 +1727,15 @@ TEST_F(Dhcpv4SrvTest, RenewMaxLifetime) {
HWAddrPtr hwaddr2(new HWAddr(hwaddr2_data, sizeof(hwaddr2_data), HTYPE_ETHER));
Lease4Ptr used(new Lease4(IOAddress("192.0.2.106"), hwaddr2,
&client_id_->getDuid()[0], client_id_->getDuid().size(),
temp_valid, temp_t1, temp_t2, temp_timestamp,
subnet_->getID()));
temp_valid, temp_timestamp, subnet_->getID()));
ASSERT_TRUE(LeaseMgrFactory::instance().addLease(used));
// Check that the lease is really in the database
Lease4Ptr l = LeaseMgrFactory::instance().getLease4(addr);
ASSERT_TRUE(l);
// Check that T1, T2, preferred, valid and cltt really set.
// Check that valid and cltt really set.
// Constructed lease looks as if it was assigned 10 seconds ago
// EXPECT_EQ(l->t1_, temp_t1);
// EXPECT_EQ(l->t2_, temp_t2);
EXPECT_EQ(l->valid_lft_, temp_valid);
EXPECT_EQ(l->cltt_, temp_timestamp);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment