]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3758] Removes declineAfterRelease tests
authorFrancis Dupont <fdupont@isc.org>
Tue, 4 Mar 2025 22:10:30 +0000 (23:10 +0100)
committerFrancis Dupont <fdupont@isc.org>
Wed, 5 Mar 2025 15:05:15 +0000 (16:05 +0100)
src/bin/dhcp4/tests/decline_unittest.cc
src/bin/dhcp6/tests/decline_unittest.cc

index 325184fa3b6441f010c3f13da60a3348b491f4c4..e632aed2d2b0e4584c56fdf42ce04d2767c9ee00 100644 (file)
@@ -364,31 +364,6 @@ TEST_F(DeclineTest, declineNonMatchingIPAddress) {
     EXPECT_EQ(Lease::STATE_DEFAULT, lease->state_);
 }
 
-// Test that the released lease cannot be declined.
-TEST_F(DeclineTest, declineAfterRelease) {
-    Dhcp4Client client(Dhcp4Client::SELECTING);
-    // Configure DHCP server.
-    configure(DECLINE_CONFIGS[0], *client.getServer(), true, true, true, false, LEASE_AFFINITY_ENABLED);
-    // Perform 4-way exchange to obtain a new lease.
-    acquireLease(client);
-
-    // Remember the acquired address.
-    IOAddress leased_address = client.config_.lease_.addr_;
-
-    // Release the acquired lease.
-    client.doRelease();
-
-    // Try to decline the released address.
-    client.config_.lease_.addr_ = leased_address;
-    ASSERT_NO_THROW(client.doDecline());
-
-    // The address should not be declined. It should still be in the
-    // released state.
-    Lease4Ptr lease = LeaseMgrFactory::instance().getLease4(leased_address);
-    ASSERT_TRUE(lease);
-    EXPECT_EQ(Lease::STATE_RELEASED, lease->state_);
-}
-
 // Test that the expired lease cannot be declined.
 TEST_F(DeclineTest, declineAfterExpire) {
     Dhcp4Client client(Dhcp4Client::SELECTING);
index e5c28ee0d3adb9bb95565886545ac70bf1b967a2..1d2c0ed1da65b89640e0ba048419783d6f9dedf7 100644 (file)
@@ -329,35 +329,6 @@ TEST_F(DeclineTest, noIAs) {
                       NO_IA, SHOULD_FAIL);
 }
 
-// Test that the released lease cannot be declined.
-TEST_F(DeclineTest, declineAfterRelease) {
-    Dhcp6Client client;
-    uint32_t iaid = 1;
-    client.requestAddress(iaid);
-
-    // Configure DHCP server.
-    configure(DECLINE_CONFIGS[0], *client.getServer());
-    // Perform 4-way exchange to obtain a new lease.
-    client.doSARR();
-    auto leases = client.getLeasesByType(Lease::TYPE_NA);
-    ASSERT_EQ(1, leases.size());
-    EXPECT_EQ(STATUS_Success, client.getStatusCode(iaid));
-
-    // Release the acquired lease.
-    auto lease = LeaseMgrFactory::instance().getLease6(Lease::TYPE_NA, leases[0].addr_);
-    lease->state_ = Lease::STATE_RELEASED;
-    LeaseMgrFactory::instance().updateLease6(lease);
-
-    // Try to decline the released address.
-    ASSERT_NO_THROW(client.doDecline());
-
-    // The address should not be declined. It should still be in the
-    // released state.
-    lease = LeaseMgrFactory::instance().getLease6(Lease::TYPE_NA, lease->addr_);
-    ASSERT_TRUE(lease);
-    EXPECT_EQ(Lease::STATE_RELEASED, lease->state_);
-}
-
 // Test that the released lease cannot be declined.
 TEST_F(DeclineTest, declineAfterExpire) {
     Dhcp6Client client;