]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#2780] Fixed unit tests
authorMarcin Siodelski <msiodelski@gmail.com>
Wed, 22 Mar 2023 14:02:52 +0000 (15:02 +0100)
committerMarcin Siodelski <msiodelski@gmail.com>
Wed, 29 Mar 2023 12:45:15 +0000 (14:45 +0200)
src/lib/dhcpsrv/tests/flq_allocation_state_unittest.cc

index 8ca8c5bf5185521b534ffc2f2e5002cd0c624977..859f3c687a0d0e66b2bf95b8d8695bc532474647 100644 (file)
@@ -124,7 +124,7 @@ TEST(PoolFreeLeaseAllocationState, addDeleteFreeLeaseNA) {
 }
 
 // Test that duplicate leases are not added to the queue.
-TEST(PoolFreeLeaseAllocationState, addFreeLeasNASeveralTimes) {
+TEST(PoolFreeLeaseAllocationState, addFreeLeaseNASeveralTimes) {
     auto pool = boost::make_shared<Pool6>(Lease::TYPE_NA, IOAddress("2001:db8:1::"),
                                           IOAddress("2001:db8:1::10"));
     auto state = PoolFreeLeaseQueueAllocationState::create(pool);
@@ -149,6 +149,15 @@ TEST(PoolFreeLeaseAllocationState, addFreeLeasNASeveralTimes) {
     EXPECT_TRUE(state->exhausted());
 }
 
+// Test creating a new free lease queue allocation state for an IPv6
+// prefix pool.
+TEST(PoolFreeLeaseAllocationState, createPD) {
+    auto pool = boost::make_shared<Pool6>(Lease::TYPE_PD, IOAddress("3000::"), 112, 120);
+    auto state = PoolFreeLeaseQueueAllocationState::create(pool);
+    ASSERT_TRUE(state);
+    EXPECT_TRUE(state->exhausted());
+}
+
 // Test creating a new free lease queue allocation state for a
 // delegated prefix pool.
 TEST(PoolFreeLeaseAllocationState, addDeleteFreeLeasePD) {