TEST_F(AllocEngine4Test, simpleAlloc4) {
boost::scoped_ptr<AllocEngine> engine;
ASSERT_NO_THROW(engine.reset(new AllocEngine(AllocEngine::ALLOC_ITERATIVE,
- 100, false)));
+ 0, false)));
ASSERT_TRUE(engine);
// Assigned addresses should be zero.
TEST_F(AllocEngine4Test, fakeAlloc4) {
boost::scoped_ptr<AllocEngine> engine;
ASSERT_NO_THROW(engine.reset(new AllocEngine(AllocEngine::ALLOC_ITERATIVE,
- 100, false)));
+ 0, false)));
ASSERT_TRUE(engine);
// Assigned addresses should be zero.
TEST_F(AllocEngine4Test, allocWithValidHint4) {
boost::scoped_ptr<AllocEngine> engine;
ASSERT_NO_THROW(engine.reset(new AllocEngine(AllocEngine::ALLOC_ITERATIVE,
- 100, false)));
+ 0, false)));
ASSERT_TRUE(engine);
AllocEngine::ClientContext4 ctx(subnet_, clientid_, hwaddr_,
TEST_F(AllocEngine4Test, allocWithUsedHint4) {
boost::scoped_ptr<AllocEngine> engine;
ASSERT_NO_THROW(engine.reset(new AllocEngine(AllocEngine::ALLOC_ITERATIVE,
- 100, false)));
+ 0, false)));
ASSERT_TRUE(engine);
// Let's create a lease and put it in the LeaseMgr
TEST_F(AllocEngine4Test, allocBogusHint4) {
boost::scoped_ptr<AllocEngine> engine;
ASSERT_NO_THROW(engine.reset(new AllocEngine(AllocEngine::ALLOC_ITERATIVE,
- 100, false)));
+ 0, false)));
ASSERT_TRUE(engine);
// Client would like to get a 10.1.1.1 lease, which does not belong to any
TEST_F(AllocEngine4Test, allocateLease4Nulls) {
boost::scoped_ptr<AllocEngine> engine;
ASSERT_NO_THROW(engine.reset(new AllocEngine(AllocEngine::ALLOC_ITERATIVE,
- 100, false)));
+ 0, false)));
ASSERT_TRUE(engine);
// Allocations without subnet are not allowed
TEST_F(AllocEngine4Test, simpleRenew4) {
boost::scoped_ptr<AllocEngine> engine;
ASSERT_NO_THROW(engine.reset(new AllocEngine(AllocEngine::ALLOC_ITERATIVE,
- 100, false)));
+ 0, false)));
ASSERT_TRUE(engine);
EXPECT_TRUE(testStatistics("assigned-addresses", 0, subnet_->getID()));
TEST_F(AllocEngine4Test, smallPool4) {
boost::scoped_ptr<AllocEngine> engine;
ASSERT_NO_THROW(engine.reset(new AllocEngine(AllocEngine::ALLOC_ITERATIVE,
- 100, false)));
+ 0, false)));
ASSERT_TRUE(engine);
IOAddress addr("192.0.2.17");
TEST_F(AllocEngine4Test, outOfAddresses4) {
boost::scoped_ptr<AllocEngine> engine;
ASSERT_NO_THROW(engine.reset(new AllocEngine(AllocEngine::ALLOC_ITERATIVE,
- 100, false)));
+ 0, false)));
ASSERT_TRUE(engine);
IOAddress addr("192.0.2.17");
// different subnet than orginally selected, when the address pool in
// the first subnet is exhausted.
TEST_F(AllocEngine4Test, discoverSharedNetwork) {
- AllocEngine engine(AllocEngine::ALLOC_ITERATIVE, 100, false);
+ AllocEngine engine(AllocEngine::ALLOC_ITERATIVE, 0, false);
// Create two subnets, each with a single address pool. The first subnet
// has only one address in its address pool to make it easier to simulate
ASSERT_TRUE(LeaseMgrFactory::instance().addLease(lease));
// Create context which will be used to try to allocate leases from the
- // shared network. The context poits to subnet1, which address space
+ // shared network. The context points to subnet1, which address space
// is exhausted. We expect the allocation engine to find another subnet
// within the same shared network and offer an address from there.
AllocEngine::ClientContext4
// different subnet than orginally selected, when the address pool in
// the first subnet is exhausted.
TEST_F(AllocEngine4Test, discoverSharedNetworkClassification) {
- AllocEngine engine(AllocEngine::ALLOC_ITERATIVE, 100, false);
+ AllocEngine engine(AllocEngine::ALLOC_ITERATIVE, 0, false);
// Create two subnets, each with a single address pool. The first subnet
// has only one address in its address pool to make it easier to simulate
// existing leases regardless in which subnet belonging to a shared network
// reservations belong.
TEST_F(AllocEngine4Test, discoverSharedNetworkReservations) {
- AllocEngine engine(AllocEngine::ALLOC_ITERATIVE, 100, false);
+ AllocEngine engine(AllocEngine::ALLOC_ITERATIVE, 0, false);
// Create two subnets, each with a single address pool. The first subnet
// has only one address in its address pool to make it easier to simulate
// different subnet than orginally selected, when the address pool in
// the first subnet is exhausted.
TEST_F(AllocEngine4Test, reuqestSharedNetwork) {
- AllocEngine engine(AllocEngine::ALLOC_ITERATIVE, 100, false);
+ AllocEngine engine(AllocEngine::ALLOC_ITERATIVE, 0, false);
// Create two subnets, each with a single address pool. The first subnet
// has only one address in its address pool to make it easier to simulate
ASSERT_TRUE(LeaseMgrFactory::instance().addLease(lease));
// Create context which will be used to try to allocate leases from the
- // shared network. The context poits to subnet1, which address space
+ // shared network. The context points to subnet1, which address space
// is exhausted. We expect the allocation engine to find another subnet
// within the same shared network and offer an address from there.
AllocEngine::ClientContext4
// different subnet than orginally selected, when the address pool in
// the first subnet is exhausted.
TEST_F(AllocEngine4Test, requestSharedNetworkClassification) {
- AllocEngine engine(AllocEngine::ALLOC_ITERATIVE, 100, false);
+ AllocEngine engine(AllocEngine::ALLOC_ITERATIVE, 0, false);
// Create two subnets, each with a single address pool. The first subnet
// has only one address in its address pool to make it easier to simulate
// existing leases regardless in which subnet belonging to a shared network
// reservations belong (DHCPREQUEST case).
TEST_F(AllocEngine4Test, requestSharedNetworkReservations) {
- AllocEngine engine(AllocEngine::ALLOC_ITERATIVE, 100, false);
+ AllocEngine engine(AllocEngine::ALLOC_ITERATIVE, 0, false);
// Create two subnets, each with a single address pool. The first subnet
// has only one address in its address pool to make it easier to simulate
TEST_F(AllocEngine4Test, discoverReuseExpiredLease4) {
boost::scoped_ptr<AllocEngine> engine;
ASSERT_NO_THROW(engine.reset(new AllocEngine(AllocEngine::ALLOC_ITERATIVE,
- 100, false)));
+ 0, false)));
ASSERT_TRUE(engine);
IOAddress addr("192.0.2.15");
TEST_F(AllocEngine4Test, requestReuseExpiredLease4) {
boost::scoped_ptr<AllocEngine> engine;
ASSERT_NO_THROW(engine.reset(new AllocEngine(AllocEngine::ALLOC_ITERATIVE,
- 100, false)));
+ 0, false)));
ASSERT_TRUE(engine);
IOAddress addr("192.0.2.105");
TEST_F(AllocEngine4Test, discoverReuseDeclinedLease4) {
AllocEnginePtr engine(new AllocEngine(AllocEngine::ALLOC_ITERATIVE,
- 100, false));
+ 0, false));
ASSERT_TRUE(engine);
// Now prepare a configuration with single address pool.
// Now prepare for DISCOVER processing
AllocEnginePtr engine(new AllocEngine(AllocEngine::ALLOC_ITERATIVE,
- 100, false));
+ 0, false));
ASSERT_TRUE(engine);
// Now prepare a configuration with single address pool.
TEST_F(AllocEngine4Test, requestReuseDeclinedLease4) {
AllocEnginePtr engine(new AllocEngine(AllocEngine::ALLOC_ITERATIVE,
- 100, false));
+ 0, false));
ASSERT_TRUE(engine);
// Now prepare a configuration with single address pool.
TEST_F(AllocEngine4Test, requestReuseDeclinedLease4Stats) {
AllocEnginePtr engine(new AllocEngine(AllocEngine::ALLOC_ITERATIVE,
- 100, false));
+ 0, false));
ASSERT_TRUE(engine);
// Now prepare a configuration with single address pool.
100, 30, 60, time(NULL), subnet_->getID()));
LeaseMgrFactory::instance().addLease(lease);
- AllocEngine engine(AllocEngine::ALLOC_ITERATIVE, 100, false);
+ AllocEngine engine(AllocEngine::ALLOC_ITERATIVE, 0, false);
AllocEngine::ClientContext4 ctx(subnet_, clientid_, hwaddr_,
IOAddress::IPV4_ZERO_ADDRESS(),
false, false, "", true);
LeaseMgrFactory::instance().addLease(lease);
LeaseMgrFactory::instance().addLease(lease2);
- AllocEngine engine(AllocEngine::ALLOC_ITERATIVE, 100, false);
+ AllocEngine engine(AllocEngine::ALLOC_ITERATIVE, 0, false);
// First client requests the lease which belongs to the second client.
AllocEngine::ClientContext4 ctx(subnet_, clientid_, hwaddr_, IOAddress("192.0.2.102"),
CfgMgr::instance().getStagingCfg()->getCfgHosts()->add(host);
CfgMgr::instance().commit();
- AllocEngine engine(AllocEngine::ALLOC_ITERATIVE, 100, false);
+ AllocEngine engine(AllocEngine::ALLOC_ITERATIVE, 0, false);
// Try to allocate a lease without specifying a hint. This is actually
// incorrect behavior of the client to not send an address it wants to
CfgMgr::instance().getStagingCfg()->getCfgHosts()->add(host);
CfgMgr::instance().commit();
- AllocEngine engine(AllocEngine::ALLOC_ITERATIVE, 100, false);
+ AllocEngine engine(AllocEngine::ALLOC_ITERATIVE, 0, false);
// Query allocation engine for the lease to be assigned to this
// client without specifying the address to be assigned.
CfgMgr::instance().getStagingCfg()->getCfgHosts()->add(host);
CfgMgr::instance().commit();
- AllocEngine engine(AllocEngine::ALLOC_ITERATIVE, 100, false);
+ AllocEngine engine(AllocEngine::ALLOC_ITERATIVE, 0, false);
AllocEngine::ClientContext4 ctx1(subnet_, clientid_, hwaddr_,
IOAddress("192.0.2.234"), false, false,
CfgMgr::instance().getStagingCfg()->getCfgHosts()->add(host);
CfgMgr::instance().commit();
- AllocEngine engine(AllocEngine::ALLOC_ITERATIVE, 100, false);
+ AllocEngine engine(AllocEngine::ALLOC_ITERATIVE, 0, false);
// Query the allocation engine for the lease to be assigned to the client
// and specify a hint being a different address than the reserved one.
false, false, ""));
LeaseMgrFactory::instance().addLease(lease);
- AllocEngine engine(AllocEngine::ALLOC_ITERATIVE, 100, false);
+ AllocEngine engine(AllocEngine::ALLOC_ITERATIVE, 0, false);
// Request allocation of the reserved address.
AllocEngine::ClientContext4 ctx(subnet_, clientid_, hwaddr_,
false, false, ""));
LeaseMgrFactory::instance().addLease(lease);
- AllocEngine engine(AllocEngine::ALLOC_ITERATIVE, 100, false);
+ AllocEngine engine(AllocEngine::ALLOC_ITERATIVE, 0, false);
// Try to allocate the reserved lease to client B.
AllocEngine::ClientContext4 ctx1(subnet_, clientid_, hwaddr_,
false, false, ""));
LeaseMgrFactory::instance().addLease(lease);
- AllocEngine engine(AllocEngine::ALLOC_ITERATIVE, 100, false);
+ AllocEngine engine(AllocEngine::ALLOC_ITERATIVE, 0, false);
// Query allocation engine for the lease to be allocated to the client B.
// The allocation engine is not able to allocate the lease to the client
false, false, ""));
LeaseMgrFactory::instance().addLease(lease);
- AllocEngine engine(AllocEngine::ALLOC_ITERATIVE, 100, false);
+ AllocEngine engine(AllocEngine::ALLOC_ITERATIVE, 0, false);
// Try to allocate a lease and specify a different address than reserved
// and different from the one that client is currently using.
false, false, ""));
LeaseMgrFactory::instance().addLease(lease);
- AllocEngine engine(AllocEngine::ALLOC_ITERATIVE, 100, false);
+ AllocEngine engine(AllocEngine::ALLOC_ITERATIVE, 0, false);
// Try to allocate a lease and use a completely different address
// as a hint.
false, false, ""));
LeaseMgrFactory::instance().addLease(lease);
- AllocEngine engine(AllocEngine::ALLOC_ITERATIVE, 100, false);
+ AllocEngine engine(AllocEngine::ALLOC_ITERATIVE, 0, false);
// Try to allocate a lease with providing no hint.
AllocEngine::ClientContext4 ctx(subnet_, clientid_, hwaddr_,
false, false, ""));
LeaseMgrFactory::instance().addLease(lease);
- AllocEngine engine(AllocEngine::ALLOC_ITERATIVE, 100, false);
+ AllocEngine engine(AllocEngine::ALLOC_ITERATIVE, 0, false);
// Query the allocation engine for the lease to be allocated for the
// client.
false, false, ""));
LeaseMgrFactory::instance().addLease(lease);
- AllocEngine engine(AllocEngine::ALLOC_ITERATIVE, 100, false);
+ AllocEngine engine(AllocEngine::ALLOC_ITERATIVE, 0, false);
// Client B sends a DHCPREQUEST to allocate a reserved lease. The
CfgMgr::instance().getStagingCfg()->getCfgHosts()->add(host);
CfgMgr::instance().commit();
- AllocEngine engine(AllocEngine::ALLOC_ITERATIVE, 100, false);
+ AllocEngine engine(AllocEngine::ALLOC_ITERATIVE, 0, false);
// Different client tries to allocate a lease. Note, that we're using
// an iterative allocator which would pick the first address from the
CfgMgr::instance().getStagingCfg()->getCfgHosts()->add(host);
CfgMgr::instance().commit();
- AllocEngine engine(AllocEngine::ALLOC_ITERATIVE, 100, false);
+ AllocEngine engine(AllocEngine::ALLOC_ITERATIVE, 0, false);
// Different client is requesting this address.
AllocEngine::ClientContext4 ctx1(subnet_, ClientIdPtr(), hwaddr_,
// address when the pool is exhausted, and the only available
// address is reserved for a different client.
TEST_F(AllocEngine4Test, reservedAddressShortPool) {
- AllocEngine engine(AllocEngine::ALLOC_ITERATIVE, 100, false);
+ AllocEngine engine(AllocEngine::ALLOC_ITERATIVE, 0, false);
// Create short pool with only one address.
initSubnet(IOAddress("192.0.2.100"), IOAddress("192.0.2.100"));
// dynamic pool if the client's reservation is made for a hostname but
// not for an address.
TEST_F(AllocEngine4Test, reservedHostname) {
- AllocEngine engine(AllocEngine::ALLOC_ITERATIVE, 100, false);
+ AllocEngine engine(AllocEngine::ALLOC_ITERATIVE, 0, false);
// Create a reservation for a hostname. Address is set to 0 which
// indicates that there is no reservation.
// the value of NULL in the host_ field of the client context.
TEST_F(AllocEngine4Test, findReservation) {
// Create the instance of the allocation engine.
- AllocEngine engine(AllocEngine::ALLOC_ITERATIVE, 100, false);
+ AllocEngine engine(AllocEngine::ALLOC_ITERATIVE, 0, false);
// Context is required to call the AllocEngine::findReservation.
AllocEngine::ClientContext4 ctx(subnet_, clientid_, hwaddr_,
TEST_F(AllocEngine4Test, simpleAlloc4Stats) {
boost::scoped_ptr<AllocEngine> engine;
ASSERT_NO_THROW(engine.reset(new AllocEngine(AllocEngine::ALLOC_ITERATIVE,
- 100, false)));
+ 0, false)));
ASSERT_TRUE(engine);
AllocEngine::ClientContext4 ctx(subnet_, clientid_, hwaddr_, IOAddress("0.0.0.0"),