From: Francis Dupont Date: Wed, 19 Jun 2019 10:47:48 +0000 (+0200) Subject: [295-min-max-lease-time-configuration-options] Fixed rebase errors X-Git-Tag: Kea-1.6.0-beta2~233 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a8b91c6d8805dd05711682c7424c9dc8b9a6ed4e;p=thirdparty%2Fkea.git [295-min-max-lease-time-configuration-options] Fixed rebase errors --- diff --git a/src/bin/dhcp4/tests/dhcp4_srv_unittest.cc b/src/bin/dhcp4/tests/dhcp4_srv_unittest.cc index 699b1a86f7..50d87eb78c 100644 --- a/src/bin/dhcp4/tests/dhcp4_srv_unittest.cc +++ b/src/bin/dhcp4/tests/dhcp4_srv_unittest.cc @@ -1522,9 +1522,7 @@ TEST_F(Dhcpv4SrvTest, RenewDefaultLifetime) { l = checkLease(ack, clientid, req->getHWAddr(), addr); ASSERT_TRUE(l); - // Check that T1, T2, preferred, valid and cltt were really updated - EXPECT_EQ(l->t1_, subnet_->getT1()); - EXPECT_EQ(l->t2_, subnet_->getT2()); + // Check that valid and cltt were really updated EXPECT_EQ(l->valid_lft_, subnet_->getValid()); // Checking for CLTT is a bit tricky if we want to avoid off by 1 errors @@ -1616,9 +1614,7 @@ TEST_F(Dhcpv4SrvTest, RenewHintLifetime) { l = checkLease(ack, clientid, req->getHWAddr(), addr); ASSERT_TRUE(l); - // Check that T1, T2, preferred, valid and cltt were really updated - EXPECT_EQ(l->t1_, subnet_->getT1()); - EXPECT_EQ(l->t2_, subnet_->getT2()); + // Check that valid and cltt were really updated EXPECT_EQ(l->valid_lft_, hint); // Checking for CLTT is a bit tricky if we want to avoid off by 1 errors @@ -1710,9 +1706,7 @@ TEST_F(Dhcpv4SrvTest, RenewMinLifetime) { l = checkLease(ack, clientid, req->getHWAddr(), addr); ASSERT_TRUE(l); - // Check that T1, T2, preferred, valid and cltt were really updated - EXPECT_EQ(l->t1_, subnet_->getT1()); - EXPECT_EQ(l->t2_, subnet_->getT2()); + // Check that valid and cltt were really updated EXPECT_EQ(l->valid_lft_, subnet_->getValid().getMin()); // Checking for CLTT is a bit tricky if we want to avoid off by 1 errors @@ -1803,9 +1797,7 @@ TEST_F(Dhcpv4SrvTest, RenewMaxLifetime) { l = checkLease(ack, clientid, req->getHWAddr(), addr); ASSERT_TRUE(l); - // Check that T1, T2, preferred, valid and cltt were really updated - EXPECT_EQ(l->t1_, subnet_->getT1()); - EXPECT_EQ(l->t2_, subnet_->getT2()); + // Check that valid and cltt were really updated EXPECT_EQ(l->valid_lft_, subnet_->getValid().getMax()); // Checking for CLTT is a bit tricky if we want to avoid off by 1 errors diff --git a/src/lib/dhcpsrv/tests/alloc_engine6_unittest.cc b/src/lib/dhcpsrv/tests/alloc_engine6_unittest.cc index 1e1e348de8..a988482ccc 100644 --- a/src/lib/dhcpsrv/tests/alloc_engine6_unittest.cc +++ b/src/lib/dhcpsrv/tests/alloc_engine6_unittest.cc @@ -933,7 +933,7 @@ TEST_F(AllocEngine6Test, defaultReuseExpiredLease6) { DuidPtr other_duid = DuidPtr(new DUID(vector(12, 0xff))); const uint32_t other_iaid = 3568; Lease6Ptr lease(new Lease6(Lease::TYPE_NA, addr, other_duid, other_iaid, - 501, 502, 503, 504, subnet_->getID(), + 501, 502, subnet_->getID(), HWAddrPtr(), 0)); lease->cltt_ = time(NULL) - 500; // Allocated 500 seconds ago lease->valid_lft_ = 495; // Lease was valid for 495 seconds @@ -979,7 +979,7 @@ TEST_F(AllocEngine6Test, hintReuseExpiredLease6) { DuidPtr other_duid = DuidPtr(new DUID(vector(12, 0xff))); const uint32_t other_iaid = 3568; Lease6Ptr lease(new Lease6(Lease::TYPE_NA, addr, other_duid, other_iaid, - 501, 502, 503, 504, subnet_->getID(), + 501, 502, subnet_->getID(), HWAddrPtr(), 0)); lease->cltt_ = time(NULL) - 500; // Allocated 500 seconds ago lease->valid_lft_ = 495; // Lease was valid for 495 seconds @@ -1025,7 +1025,7 @@ TEST_F(AllocEngine6Test, minReuseExpiredLease6) { DuidPtr other_duid = DuidPtr(new DUID(vector(12, 0xff))); const uint32_t other_iaid = 3568; Lease6Ptr lease(new Lease6(Lease::TYPE_NA, addr, other_duid, other_iaid, - 501, 502, 503, 504, subnet_->getID(), + 501, 502, subnet_->getID(), HWAddrPtr(), 0)); lease->cltt_ = time(NULL) - 500; // Allocated 500 seconds ago lease->valid_lft_ = 495; // Lease was valid for 495 seconds @@ -1071,7 +1071,7 @@ TEST_F(AllocEngine6Test, maxReuseExpiredLease6) { DuidPtr other_duid = DuidPtr(new DUID(vector(12, 0xff))); const uint32_t other_iaid = 3568; Lease6Ptr lease(new Lease6(Lease::TYPE_NA, addr, other_duid, other_iaid, - 501, 502, 503, 504, subnet_->getID(), + 501, 502, subnet_->getID(), HWAddrPtr(), 0)); lease->cltt_ = time(NULL) - 500; // Allocated 500 seconds ago lease->valid_lft_ = 495; // Lease was valid for 495 seconds @@ -1254,7 +1254,7 @@ TEST_F(AllocEngine6Test, renewExtendLeaseLifetime) { TEST_F(AllocEngine6Test, defaultRenewLeaseLifetime) { // Create a lease for the client. Lease6Ptr lease(new Lease6(Lease::TYPE_NA, IOAddress("2001:db8:1::15"), - duid_, iaid_, 300, 400, 100, 200, + duid_, iaid_, 300, 400, subnet_->getID(), HWAddrPtr(), 128)); // Allocated 200 seconds ago - half of the lifetime. @@ -1289,7 +1289,7 @@ TEST_F(AllocEngine6Test, defaultRenewLeaseLifetime) { TEST_F(AllocEngine6Test, hintRenewLeaseLifetime) { // Create a lease for the client. Lease6Ptr lease(new Lease6(Lease::TYPE_NA, IOAddress("2001:db8:1::15"), - duid_, iaid_, 300, 400, 100, 200, + duid_, iaid_, 300, 400, subnet_->getID(), HWAddrPtr(), 128)); // Allocated 200 seconds ago - half of the lifetime. @@ -1324,7 +1324,7 @@ TEST_F(AllocEngine6Test, hintRenewLeaseLifetime) { TEST_F(AllocEngine6Test, minRenewLeaseLifetime) { // Create a lease for the client. Lease6Ptr lease(new Lease6(Lease::TYPE_NA, IOAddress("2001:db8:1::15"), - duid_, iaid_, 300, 400, 100, 200, + duid_, iaid_, 300, 400, subnet_->getID(), HWAddrPtr(), 128)); // Allocated 200 seconds ago - half of the lifetime. @@ -1359,7 +1359,7 @@ TEST_F(AllocEngine6Test, minRenewLeaseLifetime) { TEST_F(AllocEngine6Test, maxRenewLeaseLifetime) { // Create a lease for the client. Lease6Ptr lease(new Lease6(Lease::TYPE_NA, IOAddress("2001:db8:1::15"), - duid_, iaid_, 300, 400, 100, 200, + duid_, iaid_, 300, 400, subnet_->getID(), HWAddrPtr(), 128)); // Allocated 200 seconds ago - half of the lifetime.