// Create V4 (ipv6=false) Allocation Engine that will try at most
// 100 attempts to pick up a lease
- ASSERT_NO_THROW(x.reset(new AllocEngine(100, false)));
+ ASSERT_NO_THROW(x.reset(new AllocEngine(100)));
}
// This test checks if two simple IPv4 allocations succeed and that the
// not interfere with the allocation.
TEST_F(AllocEngine4Test, simpleAlloc4) {
boost::scoped_ptr<AllocEngine> engine;
- ASSERT_NO_THROW(engine.reset(new AllocEngine(0, false)));
+ ASSERT_NO_THROW(engine.reset(new AllocEngine(0)));
ASSERT_TRUE(engine);
// Assigned addresses should be zero.
// This test checks that simple allocation uses the default valid lifetime.
TEST_F(AllocEngine4Test, defaultAlloc4) {
boost::scoped_ptr<AllocEngine> engine;
- ASSERT_NO_THROW(engine.reset(new AllocEngine(0, false)));
+ ASSERT_NO_THROW(engine.reset(new AllocEngine(0)));
ASSERT_TRUE(engine);
AllocEngine::ClientContext4 ctx(subnet_, clientid_, hwaddr_, IOAddress("0.0.0.0"),
// This test checks that simple allocation uses the specified valid lifetime.
TEST_F(AllocEngine4Test, hintAlloc4) {
boost::scoped_ptr<AllocEngine> engine;
- ASSERT_NO_THROW(engine.reset(new AllocEngine(0, false)));
+ ASSERT_NO_THROW(engine.reset(new AllocEngine(0)));
ASSERT_TRUE(engine);
AllocEngine::ClientContext4 ctx(subnet_, clientid_, hwaddr_, IOAddress("0.0.0.0"),
// This test checks that simple allocation uses the min valid lifetime.
TEST_F(AllocEngine4Test, minAlloc4) {
boost::scoped_ptr<AllocEngine> engine;
- ASSERT_NO_THROW(engine.reset(new AllocEngine(0, false)));
+ ASSERT_NO_THROW(engine.reset(new AllocEngine(0)));
ASSERT_TRUE(engine);
AllocEngine::ClientContext4 ctx(subnet_, clientid_, hwaddr_, IOAddress("0.0.0.0"),
// This test checks that simple allocation uses the max valid lifetime.
TEST_F(AllocEngine4Test, maxAlloc4) {
boost::scoped_ptr<AllocEngine> engine;
- ASSERT_NO_THROW(engine.reset(new AllocEngine(0, false)));
+ ASSERT_NO_THROW(engine.reset(new AllocEngine(0)));
ASSERT_TRUE(engine);
AllocEngine::ClientContext4 ctx(subnet_, clientid_, hwaddr_, IOAddress("0.0.0.0"),
// This test checks that simple allocation handles BOOTP queries.
TEST_F(AllocEngine4Test, bootpAlloc4) {
boost::scoped_ptr<AllocEngine> engine;
- ASSERT_NO_THROW(engine.reset(new AllocEngine(0, false)));
+ ASSERT_NO_THROW(engine.reset(new AllocEngine(0)));
ASSERT_TRUE(engine);
AllocEngine::ClientContext4 ctx(subnet_, clientid_, hwaddr_, IOAddress("0.0.0.0"),
// This test checks if the fake allocation (for DHCPDISCOVER) can succeed
TEST_F(AllocEngine4Test, fakeAlloc4) {
boost::scoped_ptr<AllocEngine> engine;
- ASSERT_NO_THROW(engine.reset(new AllocEngine(0, false)));
+ ASSERT_NO_THROW(engine.reset(new AllocEngine(0)));
ASSERT_TRUE(engine);
// Assigned addresses should be zero.
// in pool and free) can succeed
TEST_F(AllocEngine4Test, allocWithValidHint4) {
boost::scoped_ptr<AllocEngine> engine;
- ASSERT_NO_THROW(engine.reset(new AllocEngine(0, false)));
+ ASSERT_NO_THROW(engine.reset(new AllocEngine(0)));
ASSERT_TRUE(engine);
AllocEngine::ClientContext4 ctx(subnet_, clientid_, hwaddr_,
// in pool, but is currently used can succeed
TEST_F(AllocEngine4Test, allocWithUsedHint4) {
boost::scoped_ptr<AllocEngine> engine;
- ASSERT_NO_THROW(engine.reset(new AllocEngine(0, false)));
+ ASSERT_NO_THROW(engine.reset(new AllocEngine(0)));
ASSERT_TRUE(engine);
// Let's create a lease and put it in the LeaseMgr
// can succeed. The invalid hint should be ignored completely.
TEST_F(AllocEngine4Test, allocBogusHint4) {
boost::scoped_ptr<AllocEngine> engine;
- ASSERT_NO_THROW(engine.reset(new AllocEngine(0, false)));
+ ASSERT_NO_THROW(engine.reset(new AllocEngine(0)));
ASSERT_TRUE(engine);
// Client would like to get a 10.1.1.1 lease, which does not belong to any
// This test checks that NULL values are handled properly
TEST_F(AllocEngine4Test, allocateLease4Nulls) {
boost::scoped_ptr<AllocEngine> engine;
- ASSERT_NO_THROW(engine.reset(new AllocEngine(0, false)));
+ ASSERT_NO_THROW(engine.reset(new AllocEngine(0)));
ASSERT_TRUE(engine);
// Allocations without subnet are not allowed
// an existing lease and assigned-leases increments accordingly
TEST_F(AllocEngine4Test, simpleRenew4) {
boost::scoped_ptr<AllocEngine> engine;
- ASSERT_NO_THROW(engine.reset(new AllocEngine(0, false)));
+ ASSERT_NO_THROW(engine.reset(new AllocEngine(0)));
ASSERT_TRUE(engine);
EXPECT_TRUE(testStatistics("assigned-addresses", 0, subnet_->getID()));
// This test checks simple renewal uses the default valid lifetime.
TEST_F(AllocEngine4Test, defaultRenew4) {
boost::scoped_ptr<AllocEngine> engine;
- ASSERT_NO_THROW(engine.reset(new AllocEngine(0, false)));
+ ASSERT_NO_THROW(engine.reset(new AllocEngine(0)));
ASSERT_TRUE(engine);
AllocEngine::ClientContext4 ctx(subnet_, clientid_, hwaddr_, IOAddress("0.0.0.0"),
// This test checks simple renewal uses the specified valid lifetime.
TEST_F(AllocEngine4Test, hintRenew4) {
boost::scoped_ptr<AllocEngine> engine;
- ASSERT_NO_THROW(engine.reset(new AllocEngine(0, false)));
+ ASSERT_NO_THROW(engine.reset(new AllocEngine(0)));
ASSERT_TRUE(engine);
AllocEngine::ClientContext4 ctx(subnet_, clientid_, hwaddr_, IOAddress("0.0.0.0"),
// This test checks simple renewal uses the min valid lifetime.
TEST_F(AllocEngine4Test, minRenew4) {
boost::scoped_ptr<AllocEngine> engine;
- ASSERT_NO_THROW(engine.reset(new AllocEngine(0, false)));
+ ASSERT_NO_THROW(engine.reset(new AllocEngine(0)));
ASSERT_TRUE(engine);
AllocEngine::ClientContext4 ctx(subnet_, clientid_, hwaddr_, IOAddress("0.0.0.0"),
// This test checks simple renewal uses the max valid lifetime.
TEST_F(AllocEngine4Test, maxRenew4) {
boost::scoped_ptr<AllocEngine> engine;
- ASSERT_NO_THROW(engine.reset(new AllocEngine(0, false)));
+ ASSERT_NO_THROW(engine.reset(new AllocEngine(0)));
ASSERT_TRUE(engine);
AllocEngine::ClientContext4 ctx(subnet_, clientid_, hwaddr_, IOAddress("0.0.0.0"),
// This test checks simple renewal handles BOOTP queries.
TEST_F(AllocEngine4Test, bootpRenew4) {
boost::scoped_ptr<AllocEngine> engine;
- ASSERT_NO_THROW(engine.reset(new AllocEngine(0, false)));
+ ASSERT_NO_THROW(engine.reset(new AllocEngine(0)));
ASSERT_TRUE(engine);
AllocEngine::ClientContext4 ctx(subnet_, clientid_, hwaddr_, IOAddress("0.0.0.0"),
// This test checks if really small pools are working
TEST_F(AllocEngine4Test, smallPool4) {
boost::scoped_ptr<AllocEngine> engine;
- ASSERT_NO_THROW(engine.reset(new AllocEngine(0, false)));
+ ASSERT_NO_THROW(engine.reset(new AllocEngine(0)));
ASSERT_TRUE(engine);
IOAddress addr("192.0.2.17");
// to find out a new lease fails.
TEST_F(AllocEngine4Test, outOfAddresses4) {
boost::scoped_ptr<AllocEngine> engine;
- ASSERT_NO_THROW(engine.reset(new AllocEngine(0, false)));
+ ASSERT_NO_THROW(engine.reset(new AllocEngine(0)));
ASSERT_TRUE(engine);
IOAddress addr("192.0.2.17");
/// @brief Initializes configuration (2 subnets, 1 shared network)
SharedNetworkAlloc4Test()
- :engine_(0, false) {
+ :engine_(0) {
// 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
// address exhaustion.
// allocation)
TEST_F(AllocEngine4Test, discoverReuseExpiredLease4) {
boost::scoped_ptr<AllocEngine> engine;
- ASSERT_NO_THROW(engine.reset(new AllocEngine(0, false)));
+ ASSERT_NO_THROW(engine.reset(new AllocEngine(0)));
ASSERT_TRUE(engine);
IOAddress addr("192.0.2.15");
// This test checks if an expired lease can be reused in REQUEST (actual allocation)
TEST_F(AllocEngine4Test, requestReuseExpiredLease4) {
boost::scoped_ptr<AllocEngine> engine;
- ASSERT_NO_THROW(engine.reset(new AllocEngine(0, false)));
+ ASSERT_NO_THROW(engine.reset(new AllocEngine(0)));
ASSERT_TRUE(engine);
IOAddress addr("192.0.2.105");
// to DHCPDISCOVER (fake allocation)
TEST_F(AllocEngine4Test, discoverReuseDeclinedLease4) {
- AllocEnginePtr engine(new AllocEngine( 0, false));
+ AllocEnginePtr engine(new AllocEngine( 0));
ASSERT_TRUE(engine);
// Now prepare a configuration with single address pool.
TEST_F(AllocEngine4Test, discoverReuseDeclinedLease4Stats) {
// Now prepare for DISCOVER processing
- AllocEnginePtr engine(new AllocEngine( 0, false));
+ AllocEnginePtr engine(new AllocEngine( 0));
ASSERT_TRUE(engine);
// Now prepare a configuration with single address pool.
// to REQUEST (actual allocation)
TEST_F(AllocEngine4Test, requestReuseDeclinedLease4) {
- AllocEnginePtr engine(new AllocEngine( 0, false));
+ AllocEnginePtr engine(new AllocEngine( 0));
ASSERT_TRUE(engine);
// Now prepare a configuration with single address pool.
// is reused when responding to DHCPREQUEST (actual allocation)
TEST_F(AllocEngine4Test, requestReuseDeclinedLease4Stats) {
- AllocEnginePtr engine(new AllocEngine( 0, false));
+ AllocEnginePtr engine(new AllocEngine( 0));
ASSERT_TRUE(engine);
// Now prepare a configuration with single address pool.
100, time(NULL), subnet_->getID()));
LeaseMgrFactory::instance().addLease(lease);
- AllocEngine engine(0, false);
+ AllocEngine engine(0);
AllocEngine::ClientContext4 ctx(subnet_, clientid_, hwaddr_,
IOAddress::IPV4_ZERO_ADDRESS(),
false, false, "", true);
LeaseMgrFactory::instance().addLease(lease);
LeaseMgrFactory::instance().addLease(lease2);
- AllocEngine engine(0, false);
+ AllocEngine engine(0);
// 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(0, false);
+ AllocEngine engine(0);
// 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(0, false);
+ AllocEngine engine(0);
// 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(0, false);
+ AllocEngine engine(0);
AllocEngine::ClientContext4 ctx1(subnet_, clientid_, hwaddr_,
IOAddress("192.0.2.234"), false, false,
CfgMgr::instance().getStagingCfg()->getCfgHosts()->add(host);
CfgMgr::instance().commit();
- AllocEngine engine(0, false);
+ AllocEngine engine(0);
// 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(0, false);
+ AllocEngine engine(0);
// Request allocation of the reserved address.
AllocEngine::ClientContext4 ctx(subnet_, clientid_, hwaddr_,
false, false, ""));
LeaseMgrFactory::instance().addLease(lease);
- AllocEngine engine(0, false);
+ AllocEngine engine(0);
// Try to allocate the reserved lease to client B.
AllocEngine::ClientContext4 ctx1(subnet_, clientid_, hwaddr_,
false, false, ""));
LeaseMgrFactory::instance().addLease(lease);
- AllocEngine engine(0, false);
+ AllocEngine engine(0);
// 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(0, false);
+ AllocEngine engine(0);
// 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(0, false);
+ AllocEngine engine(0);
// Try to allocate a lease and use a completely different address
// as a hint.
false, false, ""));
LeaseMgrFactory::instance().addLease(lease);
- AllocEngine engine(0, false);
+ AllocEngine engine(0);
// Try to allocate a lease with providing no hint.
AllocEngine::ClientContext4 ctx(subnet_, clientid_, hwaddr_,
false, false, ""));
LeaseMgrFactory::instance().addLease(lease);
- AllocEngine engine(0, false);
+ AllocEngine engine(0);
// Query the allocation engine for the lease to be allocated for the
// client.
false, false, ""));
LeaseMgrFactory::instance().addLease(lease);
- AllocEngine engine(0, false);
+ AllocEngine engine(0);
// Client B sends a DHCPREQUEST to allocate a reserved lease. The
// allocation engine can't allocate a reserved lease for this client
CfgMgr::instance().getStagingCfg()->getCfgHosts()->add(host);
CfgMgr::instance().commit();
- AllocEngine engine(0, false);
+ AllocEngine engine(0);
// 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(0, false);
+ AllocEngine engine(0);
// 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(0, false);
+ AllocEngine engine(0);
// 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(0, false);
+ AllocEngine engine(0);
// 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(0, false);
+ AllocEngine engine(0);
// Context is required to call the AllocEngine::findReservation.
AllocEngine::ClientContext4 ctx(subnet_, clientid_, hwaddr_,
// statistic for allocated addresses is increased appropriately.
TEST_F(AllocEngine4Test, simpleAlloc4Stats) {
boost::scoped_ptr<AllocEngine> engine;
- ASSERT_NO_THROW(engine.reset(new AllocEngine(0, false)));
+ ASSERT_NO_THROW(engine.reset(new AllocEngine(0)));
ASSERT_TRUE(engine);
AllocEngine::ClientContext4 ctx(subnet_, clientid_, hwaddr_, IOAddress("0.0.0.0"),
// and that it doesn't increase allocated-addresses statistic.
TEST_F(AllocEngine4Test, fakeAlloc4Stat) {
boost::scoped_ptr<AllocEngine> engine;
- ASSERT_NO_THROW(engine.reset(new AllocEngine(100, false)));
+ ASSERT_NO_THROW(engine.reset(new AllocEngine(100)));
ASSERT_TRUE(engine);
AllocEngine::ClientContext4 ctx(subnet_, clientid_, hwaddr_,
false, false, ""));
LeaseMgrFactory::instance().addLease(lease);
- AllocEngine engine(100, false);
+ AllocEngine engine(100);
// Let's pretend 100 addresses were allocated already
string name = StatsMgr::generateName("subnet", subnet_->getID(),
CfgMgr::instance().getStagingCfg()->getCfgHosts()->add(host);
CfgMgr::instance().commit();
- AllocEngine engine(0, false);
+ AllocEngine engine(0);
subnet_->setReservationsGlobal(true);
CfgMgr::instance().getStagingCfg()->getCfgHosts()->add(host);
CfgMgr::instance().commit();
- AllocEngine engine(0, false);
+ AllocEngine engine(0);
subnet_->setReservationsGlobal(true);
CfgMgr::instance().getStagingCfg()->getCfgHosts()->add(host);
CfgMgr::instance().commit();
- AllocEngine engine(0, false);
+ AllocEngine engine(0);
subnet_->setReservationsGlobal(true);
CfgMgr::instance().getStagingCfg()->getCfgHosts()->add(host);
CfgMgr::instance().commit();
- AllocEngine engine(0, false);
+ AllocEngine engine(0);
subnet_->setReservationsGlobal(true);
CfgMgr::instance().getStagingCfg()->getCfgHosts()->add(host);
CfgMgr::instance().commit();
- AllocEngine engine(0, false);
+ AllocEngine engine(0);
subnet_->setReservationsGlobal(true);
subnet_->setReservationsInSubnet(true);
CfgMgr::instance().getStagingCfg()->getCfgHosts()->add(host);
CfgMgr::instance().commit();
- AllocEngine engine(0, false);
+ AllocEngine engine(0);
subnet_->setReservationsGlobal(true);
subnet_->setReservationsInSubnet(true);
CfgMgr::instance().getStagingCfg()->getCfgHosts()->add(host);
CfgMgr::instance().commit();
- AllocEngine engine(0, false);
+ AllocEngine engine(0);
subnet_->setReservationsGlobal(true);
subnet_->setReservationsInSubnet(true);
CfgMgr::instance().getStagingCfg()->getCfgHosts()->add(host);
CfgMgr::instance().commit();
- AllocEngine engine(0, false);
+ AllocEngine engine(0);
subnet_->setReservationsGlobal(true);
subnet_->setReservationsInSubnet(true);
}};
// Create the allocation engine, context and lease.
- NakedAllocEngine engine(0, false);
+ NakedAllocEngine engine(0);
AllocEngine::ClientContext4 ctx(subnet_, clientid_, hwaddr_,
IOAddress::IPV4_ZERO_ADDRESS(),
}};
// Create the allocation engine, context and lease.
- NakedAllocEngine engine(0, false);
+ NakedAllocEngine engine(0);
// All of the scenarios require storage to be enabled.
subnet_->setStoreExtendedInfo(true);
}};
// Create the allocation engine, context and lease.
- NakedAllocEngine engine(0, false);
+ NakedAllocEngine engine(0);
// All of the scenarios require storage to be disabled.
subnet_->setStoreExtendedInfo(false);
// using cache threshold.
TEST_F(AllocEngine4Test, discoverCacheThreshold4) {
boost::scoped_ptr<AllocEngine> engine;
- ASSERT_NO_THROW(engine.reset(new AllocEngine(0, false)));
+ ASSERT_NO_THROW(engine.reset(new AllocEngine(0)));
ASSERT_TRUE(engine);
// Set valid lifetime to 500.
// using cache threshold.
TEST_F(AllocEngine4Test, requestCacheThreshold4) {
boost::scoped_ptr<AllocEngine> engine;
- ASSERT_NO_THROW(engine.reset(new AllocEngine(0, false)));
+ ASSERT_NO_THROW(engine.reset(new AllocEngine(0)));
ASSERT_TRUE(engine);
// Set valid lifetime to 500.
// using cache max age.
TEST_F(AllocEngine4Test, discoverCacheMaxAge4) {
boost::scoped_ptr<AllocEngine> engine;
- ASSERT_NO_THROW(engine.reset(new AllocEngine(0, false)));
+ ASSERT_NO_THROW(engine.reset(new AllocEngine(0)));
ASSERT_TRUE(engine);
// Set valid lifetime to 500.
// using both cache threshold and max age.
TEST_F(AllocEngine4Test, requestCacheBoth4) {
boost::scoped_ptr<AllocEngine> engine;
- ASSERT_NO_THROW(engine.reset(new AllocEngine(0, false)));
+ ASSERT_NO_THROW(engine.reset(new AllocEngine(0)));
ASSERT_TRUE(engine);
// Set valid lifetime to 500.
// using too small cache threshold.
TEST_F(AllocEngine4Test, discoverCacheBadThreshold4) {
boost::scoped_ptr<AllocEngine> engine;
- ASSERT_NO_THROW(engine.reset(new AllocEngine(0, false)));
+ ASSERT_NO_THROW(engine.reset(new AllocEngine(0)));
ASSERT_TRUE(engine);
// Set valid lifetime to 500.
// using too small cache max age.
TEST_F(AllocEngine4Test, requestCacheBadMaxAge4) {
boost::scoped_ptr<AllocEngine> engine;
- ASSERT_NO_THROW(engine.reset(new AllocEngine(0, false)));
+ ASSERT_NO_THROW(engine.reset(new AllocEngine(0)));
ASSERT_TRUE(engine);
// Set valid lifetime to 500.
// when the valid lifetime was reduced.
TEST_F(AllocEngine4Test, discoverCacheReducedValid4) {
boost::scoped_ptr<AllocEngine> engine;
- ASSERT_NO_THROW(engine.reset(new AllocEngine(0, false)));
+ ASSERT_NO_THROW(engine.reset(new AllocEngine(0)));
ASSERT_TRUE(engine);
// Set valid lifetime to 200.
// when DDNS parameter changed.
TEST_F(AllocEngine4Test, requestCacheFwdDDNS4) {
boost::scoped_ptr<AllocEngine> engine;
- ASSERT_NO_THROW(engine.reset(new AllocEngine(0, false)));
+ ASSERT_NO_THROW(engine.reset(new AllocEngine(0)));
ASSERT_TRUE(engine);
// Set valid lifetime to 500.
// when DDNS parameter changed.
TEST_F(AllocEngine4Test, discoverCacheRevDDNS4) {
boost::scoped_ptr<AllocEngine> engine;
- ASSERT_NO_THROW(engine.reset(new AllocEngine(0, false)));
+ ASSERT_NO_THROW(engine.reset(new AllocEngine(0)));
ASSERT_TRUE(engine);
// Set valid lifetime to 500.
// when hostname changed.
TEST_F(AllocEngine4Test, requestCacheHostname4) {
boost::scoped_ptr<AllocEngine> engine;
- ASSERT_NO_THROW(engine.reset(new AllocEngine(0, false)));
+ ASSERT_NO_THROW(engine.reset(new AllocEngine(0)));
ASSERT_TRUE(engine);
// Set valid lifetime to 500.
// Verifies that AllocEngine::getValidLft(ctx4) returns the appropriate
// lifetime value based on the context content.
TEST_F(AllocEngine4Test, getValidLft4) {
- AllocEngine engine(0, false);
+ AllocEngine engine(0);
// Let's make three classes, two with valid-lifetime and one without,
// and add them to the dictionary.
// Verifies that AllocEngine::getValidLft(ctx4) returns the appropriate
// lifetime value based on the context content.
TEST_F(AllocEngine4Test, getTemplateClassValidLft4) {
- AllocEngine engine(AllocEngine::ALLOC_ITERATIVE, 0, false);
+ AllocEngine engine(0);
// Let's make three classes, two with valid-lifetime and one without,
// and add them to the dictionary.
// This test checks that deleteRelease handles BOOTP leases.
TEST_F(AllocEngine4Test, bootpDelete) {
boost::scoped_ptr<AllocEngine> engine;
- ASSERT_NO_THROW(engine.reset(new AllocEngine(0, false)));
+ ASSERT_NO_THROW(engine.reset(new AllocEngine(0)));
ASSERT_TRUE(engine);
AllocEngine::ClientContext4 ctx(subnet_, clientid_, hwaddr_, IOAddress("0.0.0.0"),
// This test checks that simple allocation handles BOOTP queries.
TEST_F(MySqlAllocEngine4Test, bootpAlloc4) {
boost::scoped_ptr<AllocEngine> engine;
- ASSERT_NO_THROW(engine.reset(new AllocEngine(0, false)));
+ ASSERT_NO_THROW(engine.reset(new AllocEngine(0)));
ASSERT_TRUE(engine);
AllocEngine::ClientContext4 ctx(subnet_, clientid_, hwaddr_, IOAddress("0.0.0.0"),
// This test checks simple renewal handles BOOTP queries.
TEST_F(MySqlAllocEngine4Test, bootpRenew4) {
boost::scoped_ptr<AllocEngine> engine;
- ASSERT_NO_THROW(engine.reset(new AllocEngine(0, false)));
+ ASSERT_NO_THROW(engine.reset(new AllocEngine(0)));
ASSERT_TRUE(engine);
AllocEngine::ClientContext4 ctx(subnet_, clientid_, hwaddr_, IOAddress("0.0.0.0"),
// This test checks that deleteRelease handles BOOTP leases.
TEST_F(MySqlAllocEngine4Test, bootpDelete) {
boost::scoped_ptr<AllocEngine> engine;
- ASSERT_NO_THROW(engine.reset(new AllocEngine(0, false)));
+ ASSERT_NO_THROW(engine.reset(new AllocEngine(0)));
ASSERT_TRUE(engine);
AllocEngine::ClientContext4 ctx(subnet_, clientid_, hwaddr_, IOAddress("0.0.0.0"),
// This test checks that simple allocation handles BOOTP queries.
TEST_F(PgSqlAllocEngine4Test, bootpAlloc4) {
boost::scoped_ptr<AllocEngine> engine;
- ASSERT_NO_THROW(engine.reset(new AllocEngine(0, false)));
+ ASSERT_NO_THROW(engine.reset(new AllocEngine(0)));
ASSERT_TRUE(engine);
AllocEngine::ClientContext4 ctx(subnet_, clientid_, hwaddr_, IOAddress("0.0.0.0"),
// This test checks simple renewal handles BOOTP queries.
TEST_F(PgSqlAllocEngine4Test, bootpRenew4) {
boost::scoped_ptr<AllocEngine> engine;
- ASSERT_NO_THROW(engine.reset(new AllocEngine(0, false)));
+ ASSERT_NO_THROW(engine.reset(new AllocEngine(0)));
ASSERT_TRUE(engine);
AllocEngine::ClientContext4 ctx(subnet_, clientid_, hwaddr_, IOAddress("0.0.0.0"),
// This test checks that deleteRelease handles BOOTP leases.
TEST_F(PgSqlAllocEngine4Test, bootpDelete) {
boost::scoped_ptr<AllocEngine> engine;
- ASSERT_NO_THROW(engine.reset(new AllocEngine(0, false)));
+ ASSERT_NO_THROW(engine.reset(new AllocEngine(0)));
ASSERT_TRUE(engine);
AllocEngine::ClientContext4 ctx(subnet_, clientid_, hwaddr_, IOAddress("0.0.0.0"),
TEST_F(AllocEngine6Test, constructor) {
boost::scoped_ptr<AllocEngine> x;
- ASSERT_NO_THROW(x.reset(new AllocEngine(100, true)));
+ ASSERT_NO_THROW(x.reset(new AllocEngine(100)));
}
// This test checks if two simple IPv6 allocations succeed and that the
// as the pool is 2001:db8:1::10 - 2001:db8:1::20.
createHost6(true, IPv6Resrv::TYPE_NA, IOAddress("2001:db8:1::1c"), 128);
- AllocEngine engine(100, false);
+ AllocEngine engine(100);
Lease6Ptr lease = simpleAlloc6Test(pool_, IOAddress("::"), true);
ASSERT_TRUE(lease);
// as the pool is 2001:db8:1::10 - 2001:db8:1::20.
createHost6(true, IPv6Resrv::TYPE_NA, IOAddress("2001:db8:1::1c"), 128);
- AllocEngine engine(100, false);
+ AllocEngine engine(100);
// Assigned count should be zero.
EXPECT_TRUE(testStatistics("assigned-nas", 0, subnet_->getID()));
// as the pool is 2001:db8:1::10 - 2001:db8:1::20.
createHost6(true, IPv6Resrv::TYPE_NA, IOAddress("2001:db8:1::1c"), 128);
- AllocEngine engine(100, false);
+ AllocEngine engine(100);
// Assigned count should be zero.
EXPECT_TRUE(testStatistics("assigned-nas", 0, subnet_->getID()));
// as the pool is 2001:db8:1::10 - 2001:db8:1::20.
createHost6(true, IPv6Resrv::TYPE_NA, IOAddress("2001:db8:1::1c"), 128);
- AllocEngine engine(100, false);
+ AllocEngine engine(100);
// Assigned count should be zero.
EXPECT_TRUE(testStatistics("assigned-nas", 0, subnet_->getID()));
// as the pool is 2001:db8:1::10 - 2001:db8:1::20.
createHost6(true, IPv6Resrv::TYPE_NA, IOAddress("2001:db8:1::1c"), 128);
- AllocEngine engine(100, false);
+ AllocEngine engine(100);
// Assigned count should be zero.
EXPECT_TRUE(testStatistics("assigned-nas", 0, subnet_->getID()));
// as the pool is 2001:db8:1::10 - 2001:db8:1::20.
createHost6(true, IPv6Resrv::TYPE_NA, IOAddress("2001:db8:1::1c"), 128);
- AllocEngine engine(100, false);
+ AllocEngine engine(100);
// Assigned count should be zero.
EXPECT_TRUE(testStatistics("assigned-nas", 0, subnet_->getID()));
// as the pool is 2001:db8:1::10 - 2001:db8:1::20.
createHost6(true, IPv6Resrv::TYPE_NA, IOAddress("2001:db8::abcd"), 128);
- AllocEngine engine(100, false);
+ AllocEngine engine(100);
// Assigned count should be zero.
EXPECT_TRUE(testStatistics("assigned-nas", 0, subnet_->getID()));
// as the pool is 2001:db8:1::10 - 2001:db8:1::20.
createHost6(true, IPv6Resrv::TYPE_NA, IOAddress("2001:db8::abcd"), 128);
- AllocEngine engine(100, false);
+ AllocEngine engine(100);
// Assigned count should be zero.
EXPECT_TRUE(testStatistics("assigned-nas", 0, subnet_->getID()));
// as the pool is 2001:db8:1::10 - 2001:db8:1::20.
createHost6(true, IPv6Resrv::TYPE_NA, IOAddress("2001:db8::abcd"), 128);
- AllocEngine engine(100, false);
+ AllocEngine engine(100);
// Assigned count should be zero.
EXPECT_TRUE(testStatistics("assigned-nas", 0, subnet_->getID()));
// as the pool is 2001:db8:1::10 - 2001:db8:1::20.
createHost6(true, IPv6Resrv::TYPE_NA, IOAddress("2001:db8::abcd"), 128);
- AllocEngine engine(100, false);
+ AllocEngine engine(100);
// Assigned count should be zero.
EXPECT_TRUE(testStatistics("assigned-nas", 0, subnet_->getID()));
// as the pool is 2001:db8:1::10 - 2001:db8:1::20.
createHost6(true, IPv6Resrv::TYPE_NA, IOAddress("2001:db8::abcd"), 128);
- AllocEngine engine(100, false);
+ AllocEngine engine(100);
// Assigned count should be zero.
EXPECT_TRUE(testStatistics("assigned-nas", 0, subnet_->getID()));
// as the pool is 2001:db8:1::10 - 2001:db8:1::20.
createHost6(true, IPv6Resrv::TYPE_NA, IOAddress("2001:db8::abcd"), 128);
- AllocEngine engine(100, false);
+ AllocEngine engine(100);
// Assigned count should be zero.
EXPECT_TRUE(testStatistics("assigned-nas", 0, subnet_->getID()));
// Check that he is assigned a new lease for B
// - verify that the number of assigned address behaves as expected
TEST_F(AllocEngine6Test, reservedAddressInPoolReassignedThis) {
- AllocEngine engine(100, false);
+ AllocEngine engine(100);
// Assigned count should be zero.
EXPECT_TRUE(testStatistics("assigned-nas", 0, subnet_->getID()));
// Check that his existing lease for lease A is removed
// Check that he is assigned a new lease
TEST_F(AllocEngine6Test, reservedAddressInPoolReassignedOther) {
- AllocEngine engine(100, false);
+ AllocEngine engine(100);
// Assigned count should be zero.
EXPECT_TRUE(testStatistics("assigned-nas", 0, subnet_->getID()));
// we run out of addresses and remaining 14 clients will get nothing.
// Finally, we check that client A still can get his reserved address.
TEST_F(AllocEngine6Test, reservedAddress) {
- AllocEngine engine(100, true);
+ AllocEngine engine(100);
// Create reservation for the client. This is in-pool reservation,
// as the pool is 2001:db8:1::10 - 2001:db8:1::20.
// Checks if the allocateLeases throws exceptions for invalid input data.
TEST_F(AllocEngine6Test, allocateLeasesInvalidData) {
- AllocEngine engine(100, true);
+ AllocEngine engine(100);
// That looks like a valid context.
AllocEngine::ClientContext6 ctx(subnet_, duid_, false, false, "", false,
createHost6HWAddr(true, IPv6Resrv::TYPE_NA, hwaddr_,
IOAddress("2001:db8:1::1c"), 128);
- AllocEngine engine(100, false);
+ AllocEngine engine(100);
Lease6Ptr lease = simpleAlloc6Test(pool_, IOAddress("::"), true);
ASSERT_TRUE(lease);
createHost6HWAddr(true, IPv6Resrv::TYPE_NA, hwaddr_,
IOAddress("2001:db8:1::1c"), 128);
- AllocEngine engine(100, false);
+ AllocEngine engine(100);
Lease6Ptr lease = simpleAlloc6Test(pool_, IOAddress("::"), false);
ASSERT_TRUE(lease);
createHost6HWAddr(true, IPv6Resrv::TYPE_NA, hwaddr_,
IOAddress("2001:db8:1::1c"), 128);
- AllocEngine engine(100, false);
+ AllocEngine engine(100);
// Let's pretend the client sends hint 2001:db8:1::10.
Lease6Ptr lease = simpleAlloc6Test(pool_, IOAddress("2001:db8:1::10"), true);
createHost6HWAddr(true, IPv6Resrv::TYPE_NA, hwaddr_,
IOAddress("2001:db8:1::1c"), 128);
- AllocEngine engine(100, false);
+ AllocEngine engine(100);
// Let's pretend the client sends hint 2001:db8:1::10.
Lease6Ptr lease = simpleAlloc6Test(pool_, IOAddress("2001:db8:1::10"), false);
// to REQUEST (actual allocation)
TEST_F(AllocEngine6Test, requestReuseDeclinedLease6) {
- AllocEnginePtr engine(new AllocEngine(100, true));
+ AllocEnginePtr engine(new AllocEngine(100));
ASSERT_TRUE(engine);
// Now prepare a configuration with single address pool.
TEST_F(AllocEngine6Test, solicitReuseDeclinedLease6Stats) {
// Now prepare for SOLICIT processing
- AllocEnginePtr engine(new AllocEngine(100, true));
+ AllocEnginePtr engine(new AllocEngine(100));
ASSERT_TRUE(engine);
// Now prepare a configuration with single address pool.
TEST_F(AllocEngine6Test, requestReuseDeclinedLease6Stats) {
// Prepare for REQUEST processing.
- AllocEnginePtr engine(new AllocEngine(100, true));
+ AllocEnginePtr engine(new AllocEngine(100));
ASSERT_TRUE(engine);
// Now prepare a configuration with single address pool.
public:
/// @brief Constructor
AllocEngine6ExtendedInfoTest()
- : engine_(100, true),
+ : engine_(100),
duid1_(), duid2_(), duid3_(), relay1_(), relay2_(), relay3_(),
duid1_addr_("::"), duid2_addr_("::") {
duid1_.reset(new DUID(std::vector<uint8_t>(8, 0x84)));
duid2_addr_ = IOAddress("2001:db8:1::11");
// Create the allocation engine, context and lease.
- NakedAllocEngine engine(100, true);
+ NakedAllocEngine engine(100);
}
/// Configuration elements. These are initialized in the constructor
// valid lifetime value based on the context content.
TEST_F(AllocEngine6Test, getTemplateClassValidLifetime) {
boost::scoped_ptr<AllocEngine> engine;
- ASSERT_NO_THROW(engine.reset(new AllocEngine(AllocEngine::ALLOC_ITERATIVE, 100)));
+ ASSERT_NO_THROW(engine.reset(new AllocEngine(100)));
ASSERT_TRUE(engine);
// Let's make three classes, two with valid-lifetime and one without,
// preferred lifetime value based on the context content.
TEST_F(AllocEngine6Test, getTemplateClassPreferredLifetime) {
boost::scoped_ptr<AllocEngine> engine;
- ASSERT_NO_THROW(engine.reset(new AllocEngine(AllocEngine::ALLOC_ITERATIVE, 100)));
+ ASSERT_NO_THROW(engine.reset(new AllocEngine(100)));
ASSERT_TRUE(engine);
// Let's make three classes, two with preferred-lifetime and one without,