AllocEngine::ClientContext4 ctx(subnet_, clientid_, hwaddr_,
IOAddress("0.0.0.0"), false, false,
"", false);
+ AllocEngine::findReservation(ctx);
Lease4Ptr lease = engine.allocateLease4(ctx);
ASSERT_TRUE(lease);
AllocEngine::ClientContext4 ctx(subnet_, clientid_, hwaddr_,
IOAddress("0.0.0.0"), false, false,
"", true);
+ AllocEngine::findReservation(ctx);
Lease4Ptr lease = engine.allocateLease4(ctx);
ASSERT_TRUE(lease);
AllocEngine::ClientContext4 ctx1(subnet_, clientid_, hwaddr_,
IOAddress("192.0.2.234"), false, false,
"", false);
+ AllocEngine::findReservation(ctx1);
Lease4Ptr lease = engine.allocateLease4(ctx1);
// The client requested a different address than reserved, so
AllocEngine::ClientContext4 ctx2(subnet_, clientid_, hwaddr_,
IOAddress("192.0.2.123"), false, false,
"", false);
+ AllocEngine::findReservation(ctx2);
lease = engine.allocateLease4(ctx2);
ASSERT_TRUE(lease);
EXPECT_EQ("192.0.2.123", lease->addr_.toText());
AllocEngine::ClientContext4 ctx(subnet_, clientid_, hwaddr_,
IOAddress("192.0.2.234"), false, false,
"", true);
+ AllocEngine::findReservation(ctx);
Lease4Ptr lease = engine.allocateLease4(ctx);
ASSERT_TRUE(lease);
AllocEngine::ClientContext4 ctx(subnet_, clientid_, hwaddr_,
IOAddress("192.0.2.123"), false, false,
"", false);
+ AllocEngine::findReservation(ctx);
Lease4Ptr allocated_lease = engine.allocateLease4(ctx);
ASSERT_TRUE(allocated_lease);
AllocEngine::ClientContext4 ctx1(subnet_, clientid_, hwaddr_,
IOAddress("192.0.2.123"), false, false,
"", false);
+ AllocEngine::findReservation(ctx1);
Lease4Ptr allocated_lease = engine.allocateLease4(ctx1);
// The lease is allocated to someone else, so the allocation should not
// succeed.
AllocEngine::ClientContext4 ctx2(subnet_, clientid_, hwaddr_,
IOAddress("0.0.0.0"), false, false,
"", false);
+ AllocEngine::findReservation(ctx2);
allocated_lease = engine.allocateLease4(ctx2);
ASSERT_FALSE(allocated_lease);
EXPECT_FALSE(ctx2.old_lease_);
AllocEngine::ClientContext4 ctx1(subnet_, clientid_, hwaddr_,
IOAddress("192.0.2.123"), false, false,
"", true);
+ AllocEngine::findReservation(ctx1);
Lease4Ptr allocated_lease = engine.allocateLease4(ctx1);
// The allocation engine should return a lease but for a different address
AllocEngine::ClientContext4 ctx2(subnet_, clientid_, hwaddr_,
IOAddress("0.0.0.0"), false, false,
"", true);
+ AllocEngine::findReservation(ctx2);
allocated_lease = engine.allocateLease4(ctx2);
ASSERT_TRUE(allocated_lease);
AllocEngine::ClientContext4 ctx1(subnet_, clientid_, hwaddr_,
IOAddress("192.0.2.102"), false, false,
"", false);
+ AllocEngine::findReservation(ctx1);
Lease4Ptr allocated_lease = engine.allocateLease4(ctx1);
ASSERT_FALSE(allocated_lease);
ASSERT_FALSE(ctx1.old_lease_);
AllocEngine::ClientContext4 ctx1(subnet_, clientid_, hwaddr_,
IOAddress("192.0.2.102"), false, false,
"", true);
+ AllocEngine::findReservation(ctx1);
Lease4Ptr allocated_lease = engine.allocateLease4(ctx1);
// Server should offer a lease for a reserved address.
AllocEngine::ClientContext4 ctx2(subnet_, clientid_, hwaddr_,
IOAddress("192.0.2.101"), false, false,
"", true);
+ AllocEngine::findReservation(ctx2);
allocated_lease = engine.allocateLease4(ctx2);
// The server should offer the lease, but not for the address that
AllocEngine::ClientContext4 ctx(subnet_, clientid_, hwaddr_,
IOAddress("0.0.0.0"), false, false,
"", false);
+ AllocEngine::findReservation(ctx);
Lease4Ptr allocated_lease = engine.allocateLease4(ctx);
// The reserved address should be allocated.
AllocEngine::ClientContext4 ctx(subnet_, clientid_, hwaddr_,
IOAddress("0.0.0.0"), false, false,
"", true);
+ AllocEngine::findReservation(ctx);
Lease4Ptr allocated_lease = engine.allocateLease4(ctx);
// The server should offer the reserved address.
AllocEngine::ClientContext4 ctx1(subnet_, ClientIdPtr(), hwaddr2_,
IOAddress("192.0.2.101"), false, false,
"", false);
+ AllocEngine::findReservation(ctx1);
Lease4Ptr offered_lease = engine.allocateLease4(ctx1);
ASSERT_FALSE(offered_lease);
AllocEngine::ClientContext4 ctx2(subnet_, clientid_, hwaddr_,
IOAddress("192.0.2.101"), false, false,
"", false);
+ AllocEngine::findReservation(ctx2);
ASSERT_FALSE(engine.allocateLease4(ctx2));
ASSERT_FALSE(ctx2.old_lease_);
AllocEngine::ClientContext4 ctx3(subnet_, clientid_, hwaddr_,
IOAddress("192.0.2.101"), false, false,
"", true);
+ AllocEngine::findReservation(ctx3);
offered_lease = engine.allocateLease4(ctx3);
ASSERT_TRUE(offered_lease);
EXPECT_NE(offered_lease->addr_.toText(), "192.0.2.101");
AllocEngine::ClientContext4 ctx4(subnet_, clientid_, hwaddr_,
offered_lease->addr_, false, false,
"", false);
+ AllocEngine::findReservation(ctx4);
Lease4Ptr allocated_lease = engine.allocateLease4(ctx4);
ASSERT_TRUE(allocated_lease);
AllocEngine::ClientContext4 ctx5(subnet_, ClientIdPtr(), hwaddr2_,
IOAddress("0.0.0.0"), false, false,
"", true);
+ AllocEngine::findReservation(ctx5);
offered_lease = engine.allocateLease4(ctx5);
ASSERT_TRUE(offered_lease);
AllocEngine::ClientContext4 ctx(subnet_, ClientIdPtr(), hwaddr_,
IOAddress("0.0.0.0"), false, false,
"", false);
+ AllocEngine::findReservation(ctx);
Lease4Ptr allocated_lease = engine.allocateLease4(ctx);
ASSERT_TRUE(allocated_lease);
// Different client is requesting this address.
AllocEngine::ClientContext4 ctx1(subnet_, ClientIdPtr(), hwaddr_,
IOAddress("192.0.2.100"), false, false,
- "", false);
+ "", false);
+ AllocEngine::findReservation(ctx1);
Lease4Ptr allocated_lease = engine.allocateLease4(ctx1);
// The client should get no lease (DHCPNAK).
// if is sending a DHCPDISCOVER (fake allocation is true).
AllocEngine::ClientContext4 ctx2(subnet_, ClientIdPtr(), hwaddr_,
IOAddress("192.0.2.100"), false, false,
- "", true);
+ "", true);
+ AllocEngine::findReservation(ctx2);
allocated_lease = engine.allocateLease4(ctx2);
ASSERT_TRUE(allocated_lease);
AllocEngine::ClientContext4 ctx1(subnet_, ClientIdPtr(), hwaddr_,
IOAddress("0.0.0.0"), false, false,
"", false);
+ AllocEngine::findReservation(ctx1);
Lease4Ptr allocated_lease = engine.allocateLease4(ctx1);
EXPECT_FALSE(allocated_lease);
AllocEngine::ClientContext4 ctx2(subnet_, ClientIdPtr(), hwaddr_,
IOAddress("0.0.0.0"), false, false,
"", false);
+ AllocEngine::findReservation(ctx2);
allocated_lease = engine.allocateLease4(ctx2);
ASSERT_TRUE(allocated_lease);
AllocEngine::ClientContext4 ctx(subnet_, ClientIdPtr(), hwaddr_,
IOAddress::IPV4_ZERO_ADDRESS(), false, false,
"foo.example.org", true);
+ AllocEngine::findReservation(ctx);
Lease4Ptr allocated_lease = engine.allocateLease4(ctx);
ASSERT_TRUE(allocated_lease);
ASSERT_FALSE(allocated_lease->addr_.isV4Zero());