From 2ead25cbea048aa1a01c773e878e07fcbe279cec Mon Sep 17 00:00:00 2001 From: Marcin Siodelski Date: Fri, 11 Sep 2015 09:34:37 +0200 Subject: [PATCH] [3973] Added todos for the lease reclamation routines. --- src/lib/dhcpsrv/alloc_engine.cc | 4 ++++ .../dhcpsrv/tests/alloc_engine_expiration_unittest.cc | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/src/lib/dhcpsrv/alloc_engine.cc b/src/lib/dhcpsrv/alloc_engine.cc index af97beb83f..35cf3c49be 100644 --- a/src/lib/dhcpsrv/alloc_engine.cc +++ b/src/lib/dhcpsrv/alloc_engine.cc @@ -1291,6 +1291,8 @@ AllocEngine::reclaimExpiredLeases6(const size_t max_leases, const uint16_t timeo // Create stopwatch and automatically start it to measure the time // taken by the routine. + /// @todo Monitor time elapsed and return from the lease reclamation routine + /// if it hits the timeout value. util::Stopwatch stopwatch; LeaseMgr& lease_mgr = LeaseMgrFactory::instance(); @@ -1371,6 +1373,8 @@ AllocEngine::reclaimExpiredLeases4(const size_t max_leases, const uint16_t timeo // Create stopwatch and automatically start it to measure the time // taken by the routine. + /// @todo Monitor time elapsed and return from the lease reclamation routine + /// if it hits the timeout value. util::Stopwatch stopwatch; LeaseMgr& lease_mgr = LeaseMgrFactory::instance(); diff --git a/src/lib/dhcpsrv/tests/alloc_engine_expiration_unittest.cc b/src/lib/dhcpsrv/tests/alloc_engine_expiration_unittest.cc index 819e8fcfbe..3347553d00 100644 --- a/src/lib/dhcpsrv/tests/alloc_engine_expiration_unittest.cc +++ b/src/lib/dhcpsrv/tests/alloc_engine_expiration_unittest.cc @@ -146,6 +146,16 @@ struct UpperBound { /// "expired-reclaimed". /// /// See @c ExpirationAllocEngineTest::testLeases for further details. +/// +/// @todo These tests should be extended to cover the following cases: +/// - timeout value in the lease reclamation routines - the most reliable +/// way to test it will be by attaching a lease4_expire/lease6_expire +/// hooks which would block for a specific period of time. This will +/// allow for calculating the approximate number of reclaimed leases +/// within a given timeout. See ticket #3972. +/// - declined leases - declined leases expire and should be removed +/// from the lease database by the lease reclamation routine. See +/// ticket #3976. template class ExpirationAllocEngineTest : public ::testing::Test { public: