setAllocator(Lease::TYPE_V4,
boost::make_shared<FreeLeaseQueueAllocator>
(Lease::TYPE_V4, shared_from_this()));
+ setAllocationState(Lease::TYPE_V4, SubnetAllocationStatePtr());
+
for (auto pool : pools_) {
pool->setAllocationState(PoolFreeLeaseQueueAllocationState::create(pool));
}
setAllocator(Lease::TYPE_V4,
boost::make_shared<IterativeAllocator>
(Lease::TYPE_V4, shared_from_this()));
+ setAllocationState(Lease::TYPE_V4,
+ SubnetIterativeAllocationState::create(shared_from_this()));
+
for (auto pool : pools_) {
pool->setAllocationState(PoolIterativeAllocationState::create(pool));
}
// Expect random allocator.
EXPECT_TRUE(boost::dynamic_pointer_cast<RandomAllocator>
(subnet->getAllocator(Lease::TYPE_V4)));
+ // Expect null subnet allocation state.
+ EXPECT_FALSE(subnet->getAllocationState(Lease::TYPE_V4));
// Expect random allocation state for the pool.
EXPECT_TRUE(boost::dynamic_pointer_cast<PoolRandomAllocationState>
(pool->getAllocationState()));
// Expect FLQ allocator.
EXPECT_TRUE(boost::dynamic_pointer_cast<FreeLeaseQueueAllocator>
(subnet->getAllocator(Lease::TYPE_V4)));
+ // Expect null subnet allocation state.
+ EXPECT_FALSE(subnet->getAllocationState(Lease::TYPE_V4));
// Expect FLQ allocation state for the pool.
EXPECT_TRUE(boost::dynamic_pointer_cast<PoolFreeLeaseQueueAllocationState>
(pool->getAllocationState()));
// Expect random allocator for PD.
EXPECT_TRUE(boost::dynamic_pointer_cast<RandomAllocator>
(subnet->getAllocator(Lease::TYPE_PD)));
+ // Expect null subnet allocation state for NA.
+ EXPECT_FALSE(subnet->getAllocationState(Lease::TYPE_NA));
+ // Expect null subnet allocation state for TA.
+ EXPECT_FALSE(subnet->getAllocationState(Lease::TYPE_TA));
+ // Expect null subnet allocation state for PD.
+ EXPECT_FALSE(subnet->getAllocationState(Lease::TYPE_PD));
// Expect random allocation state for the NA pool.
EXPECT_TRUE(boost::dynamic_pointer_cast<PoolRandomAllocationState>
(pool->getAllocationState()));
// Expect FLQ allocator for PD.
EXPECT_TRUE(boost::dynamic_pointer_cast<FreeLeaseQueueAllocator>
(subnet->getAllocator(Lease::TYPE_PD)));
+ // Expect null subnet allocation state for NA.
+ EXPECT_FALSE(subnet->getAllocationState(Lease::TYPE_NA));
+ // Expect null subnet allocation state for TA.
+ EXPECT_FALSE(subnet->getAllocationState(Lease::TYPE_TA));
+ // Expect null subnet allocation state for PD.
+ EXPECT_FALSE(subnet->getAllocationState(Lease::TYPE_PD));
// Expect random allocation state for the NA pool.
EXPECT_TRUE(boost::dynamic_pointer_cast<PoolRandomAllocationState>
(pool->getAllocationState()));