From: Tomek Mrugalski Date: Fri, 4 Aug 2017 19:00:11 +0000 (+0200) Subject: [5280] leaseWipe4,6 implemented in lease managers (base and memfile) X-Git-Tag: trac5124a_base~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=574356fa9e6a3913fa298885fc2c59879f966283;p=thirdparty%2Fkea.git [5280] leaseWipe4,6 implemented in lease managers (base and memfile) --- diff --git a/src/lib/dhcpsrv/cql_lease_mgr.cc b/src/lib/dhcpsrv/cql_lease_mgr.cc index f7486c6054..c3030f1b04 100644 --- a/src/lib/dhcpsrv/cql_lease_mgr.cc +++ b/src/lib/dhcpsrv/cql_lease_mgr.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2015 - 2016 Deutsche Telekom AG. +// Copyright (C) 2015 - 2017 Deutsche Telekom AG. // // Author: Razvan Becheriu // @@ -1885,6 +1885,16 @@ CqlLeaseMgr::deleteExpiredReclaimedLeasesCommon(const uint32_t secs, return (result); } +size_t +CqlLeaseMgr::wipeLeases4(const SubnetID& /*subnet_id*/) { + isc_throw(NotImplemented, "wipeLeases4 is not implemented for Cassandra backend"); +} + +size_t +CqlLeaseMgr::wipeLeases6(const SubnetID& /*subnet_id*/) { + isc_throw(NotImplemented, "wipeLeases6 is not implemented for Cassandra backend"); +} + std::string CqlLeaseMgr::getName() const { std::string name = ""; diff --git a/src/lib/dhcpsrv/cql_lease_mgr.h b/src/lib/dhcpsrv/cql_lease_mgr.h index 2da7a46ec8..bff24148a4 100644 --- a/src/lib/dhcpsrv/cql_lease_mgr.h +++ b/src/lib/dhcpsrv/cql_lease_mgr.h @@ -1,4 +1,4 @@ -// Copyright (C) 2015 - 2016 Deutsche Telekom AG. +// Copyright (C) 2015 - 2017 Deutsche Telekom AG. // // Author: Razvan Becheriu // @@ -379,6 +379,28 @@ public: /// @return Number of leases deleted. virtual uint64_t deleteExpiredReclaimedLeases6(const uint32_t ); + /// @brief Removes specified IPv4 leases. + /// + /// This rather dangerous method is able to remove all leases from specified + /// subnet. + /// + /// @todo: Not implemented yet. + /// + /// @param subnet_id identifier of the subnet + /// @return number of leases removed. + virtual size_t wipeLeases4(const SubnetID& subnet_id); + + /// @brief Removed specified IPv6 leases. + /// + /// This rather dangerous method is able to remove all leases from specified + /// subnet. + /// + /// @todo: Not implemented yet. + /// + /// @param subnet_id identifier of the subnet + /// @return number of leases removed. + virtual size_t wipeLeases6(const SubnetID& subnet_id); + /// @brief Return backend type /// /// @return Type of the backend. diff --git a/src/lib/dhcpsrv/dhcpsrv_messages.mes b/src/lib/dhcpsrv/dhcpsrv_messages.mes index 83f2d51bd0..9ec4f33897 100644 --- a/src/lib/dhcpsrv/dhcpsrv_messages.mes +++ b/src/lib/dhcpsrv/dhcpsrv_messages.mes @@ -545,6 +545,27 @@ lease from the memory file database for the specified address. A debug message issued when the server is attempting to update IPv6 lease from the memory file database for the specified address. +% DHCPSRV_MEMFILE_WIPE_LEASES4 removing all IPv4 leases from subnet %1 +This informational message is printed when removal of all leases from +specified IPv4 subnet is commencing. This is a result of receiving administrative +command. + +% DHCPSRV_MEMFILE_WIPE_LEASES4_FINISHED removing all IPv4 leases from subnet %1 finished, removed %2 leases +This informational message is printed when removal of all leases from +a specified IPv4 subnet has finished. The number of removed leases is +printed. + +% DHCPSRV_MEMFILE_WIPE_LEASES6 removing all IPv6 leases from subnet %1 +This informational message is printed when removal of all leases from +specified IPv6 subnet is commencing. This is a result of receiving administrative +command. + +% DHCPSRV_MEMFILE_WIPE_LEASES6_FINISHED removing all IPv6 leases from subnet %1 finished, removed %2 leases +This informational message is printed when removal of all leases from +a specified IPv6 subnet has finished. The number of removed leases is +printed. + + % DHCPSRV_MULTIPLE_RAW_SOCKETS_PER_IFACE current configuration will result in opening multiple broadcast capable sockets on some interfaces and some DHCP messages may be duplicated A warning message issued when the current configuration indicates that multiple sockets, capable of receiving broadcast traffic, will be opened on some of the diff --git a/src/lib/dhcpsrv/lease_mgr.h b/src/lib/dhcpsrv/lease_mgr.h index c1baf8407c..5f70a55c13 100644 --- a/src/lib/dhcpsrv/lease_mgr.h +++ b/src/lib/dhcpsrv/lease_mgr.h @@ -1,4 +1,4 @@ -// Copyright (C) 2012-2016 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2012-2017 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -539,6 +539,24 @@ public: /// @return A populated LeaseStatsQuery virtual LeaseStatsQueryPtr startLeaseStatsQuery6(); + /// @brief Virtual method which removes specified leases. + /// + /// This rather dangerous method is able to remove all leases from specified + /// subnet. + /// + /// @param subnet_id identifier of the subnet (or 0 for all subnets) + /// @return number of leases removed. + virtual size_t wipeLeases4(const SubnetID& subnet_id) = 0; + + /// @brief Virtual method which removes specified leases. + /// + /// This rather dangerous method is able to remove all leases from specified + /// subnet. + /// + /// @param subnet_id identifier of the subnet (or 0 for all subnets) + /// @return number of leases removed. + virtual size_t wipeLeases6(const SubnetID& subnet_id) = 0; + /// @brief Return backend type /// /// Returns the type of the backend (e.g. "mysql", "memfile" etc.) @@ -588,10 +606,6 @@ public: /// Rolls back all pending database operations. On databases that don't /// support transactions, this is a no-op. virtual void rollback() = 0; - - /// @todo: Add host management here - /// As host reservation is outside of scope for 2012, support for hosts - /// is currently postponed. }; }; // end of isc::dhcp namespace diff --git a/src/lib/dhcpsrv/memfile_lease_mgr.cc b/src/lib/dhcpsrv/memfile_lease_mgr.cc index aee842d459..8f2267906a 100644 --- a/src/lib/dhcpsrv/memfile_lease_mgr.cc +++ b/src/lib/dhcpsrv/memfile_lease_mgr.cc @@ -1323,5 +1323,62 @@ Memfile_LeaseMgr::startLeaseStatsQuery6() { return(query); } +size_t Memfile_LeaseMgr::wipeLeases4(const SubnetID& subnet_id) { + LOG_INFO(dhcpsrv_logger, DHCPSRV_MEMFILE_WIPE_LEASES4) + .arg(subnet_id); + + // Get the index by DUID, IAID, lease type. + const Lease4StorageSubnetIdIndex& idx = storage4_.get(); + + // Try to get the lease using the DUID, IAID and lease type. + std::pair l = + idx.equal_range(subnet_id); + + // Let's collect all leases. + Lease4Collection leases; + for(auto lease = l.first; lease != l.second; ++lease) { + leases.push_back(*lease); + } + + size_t num = leases.size(); + for (auto l = leases.begin(); l != leases.end(); ++l) { + deleteLease((*l)->addr_); + } + LOG_INFO(dhcpsrv_logger, DHCPSRV_MEMFILE_WIPE_LEASES4_FINISHED) + .arg(subnet_id).arg(num); + + return (num); +} + +size_t Memfile_LeaseMgr::wipeLeases6(const SubnetID& subnet_id) { + LOG_INFO(dhcpsrv_logger, DHCPSRV_MEMFILE_WIPE_LEASES6) + .arg(subnet_id); + + // Get the index by DUID, IAID, lease type. + const Lease6StorageSubnetIdIndex& idx = storage6_.get(); + + // Try to get the lease using the DUID, IAID and lease type. + std::pair l = + idx.equal_range(subnet_id); + + // Let's collect all leases. + Lease6Collection leases; + for(auto lease = l.first; lease != l.second; ++lease) { + leases.push_back(*lease); + } + + size_t num = leases.size(); + for (auto l = leases.begin(); l != leases.end(); ++l) { + deleteLease((*l)->addr_); + } + LOG_INFO(dhcpsrv_logger, DHCPSRV_MEMFILE_WIPE_LEASES6_FINISHED) + .arg(subnet_id).arg(num); + + return (num); +} + + } // end of namespace isc::dhcp } // end of namespace isc diff --git a/src/lib/dhcpsrv/memfile_lease_mgr.h b/src/lib/dhcpsrv/memfile_lease_mgr.h index dcf2810689..3d76f94468 100644 --- a/src/lib/dhcpsrv/memfile_lease_mgr.h +++ b/src/lib/dhcpsrv/memfile_lease_mgr.h @@ -332,6 +332,24 @@ public: /// @return Number of leases deleted. virtual uint64_t deleteExpiredReclaimedLeases6(const uint32_t secs); + /// @brief Removes specified IPv4 leases. + /// + /// This rather dangerous method is able to remove all leases from specified + /// subnet. + /// + /// @param subnet_id identifier of the subnet + /// @return number of leases removed. + virtual size_t wipeLeases4(const SubnetID& subnet_id); + + /// @brief Removed specified IPv6 leases. + /// + /// This rather dangerous method is able to remove all leases from specified + /// subnet. + /// + /// @param subnet_id identifier of the subnet + /// @return number of leases removed. + virtual size_t wipeLeases6(const SubnetID& subnet_id); + private: /// @brief Deletes all expired-reclaimed leases. diff --git a/src/lib/dhcpsrv/memfile_lease_storage.h b/src/lib/dhcpsrv/memfile_lease_storage.h index d16fec4606..059210f8aa 100644 --- a/src/lib/dhcpsrv/memfile_lease_storage.h +++ b/src/lib/dhcpsrv/memfile_lease_storage.h @@ -42,6 +42,9 @@ struct ClientIdSubnetIdIndexTag { }; /// @brief Tag for indexes by client id, HW address and subnet id. struct ClientIdHWAddressSubnetIdIndexTag { }; +/// @brief Tag for indexs by subnet-id. +struct SubnetIdIndexTag { }; + /// @name Multi index containers holding DHCPv4 and DHCPv6 leases. /// //@{ @@ -103,6 +106,13 @@ typedef boost::multi_index_container< boost::multi_index::const_mem_fun > + >, + + // Specification of the fourth index starts here. + // This index sorts leases by SubnetID. + boost::multi_index::ordered_non_unique< + boost::multi_index::tag, + boost::multi_index::member > > > Lease6Storage; // Specify the type name of this container. @@ -210,7 +220,15 @@ typedef boost::multi_index_container< boost::multi_index::const_mem_fun > + >, + + // Specification of the sixth index starts here. + // This index sorts leases by SubnetID. + boost::multi_index::ordered_non_unique< + boost::multi_index::tag, + boost::multi_index::member > + > > Lease4Storage; // Specify the type name for this container. @@ -229,6 +247,9 @@ typedef Lease6Storage::index::type Lease6StorageDuidIaidTy /// @brief DHCPv6 lease storage index by expiration time. typedef Lease6Storage::index::type Lease6StorageExpirationIndex; +/// @brief DHCPv6 lease storage index by Subnet-id. +typedef Lease6Storage::index::type Lease6StorageSubnetIdIndex; + /// @brief DHCPv4 lease storage index by address. typedef Lease4Storage::index::type Lease4StorageAddressIndex; @@ -247,6 +268,9 @@ Lease4StorageClientIdSubnetIdIndex; typedef Lease4Storage::index::type Lease4StorageClientIdHWAddressSubnetIdIndex; +/// @brief DHCPv4 lease storage index by client id, HW address and subnet id. +typedef Lease4Storage::index::type Lease4StorageSubnetIdIndex; + //@} } // end of isc::dhcp namespace } // end of isc namespace diff --git a/src/lib/dhcpsrv/mysql_lease_mgr.cc b/src/lib/dhcpsrv/mysql_lease_mgr.cc index 3eb6062ed5..63d4cabdc3 100644 --- a/src/lib/dhcpsrv/mysql_lease_mgr.cc +++ b/src/lib/dhcpsrv/mysql_lease_mgr.cc @@ -2100,7 +2100,15 @@ MySqlLeaseMgr::deleteExpiredReclaimedLeasesCommon(const uint32_t secs, return (deleted_leases); } +size_t +MySqlLeaseMgr::wipeLeases4(const SubnetID& /*subnet_id*/) { + isc_throw(NotImplemented, "wipeLeases4 is not implemented for MySQL backend"); +} +size_t +MySqlLeaseMgr::wipeLeases6(const SubnetID& /*subnet_id*/) { + isc_throw(NotImplemented, "wipeLeases6 is not implemented for MySQL backend"); +} // Miscellaneous database methods. diff --git a/src/lib/dhcpsrv/mysql_lease_mgr.h b/src/lib/dhcpsrv/mysql_lease_mgr.h index f20e8681ee..5c47e8ede9 100644 --- a/src/lib/dhcpsrv/mysql_lease_mgr.h +++ b/src/lib/dhcpsrv/mysql_lease_mgr.h @@ -329,6 +329,28 @@ public: /// @return Number of leases deleted. virtual uint64_t deleteExpiredReclaimedLeases4(const uint32_t secs); + /// @brief Removes specified IPv4 leases. + /// + /// This rather dangerous method is able to remove all leases from specified + /// subnet. + /// + /// @todo: Not implemented yet. + /// + /// @param subnet_id identifier of the subnet + /// @return number of leases removed. + virtual size_t wipeLeases4(const SubnetID& subnet_id); + + /// @brief Removed specified IPv6 leases. + /// + /// This rather dangerous method is able to remove all leases from specified + /// subnet. + /// + /// @todo: Not implemented yet. + /// + /// @param subnet_id identifier of the subnet + /// @return number of leases removed. + virtual size_t wipeLeases6(const SubnetID& subnet_id); + /// @brief Deletes all expired-reclaimed DHCPv6 leases. /// /// @param secs Number of seconds since expiration of leases before diff --git a/src/lib/dhcpsrv/pgsql_lease_mgr.cc b/src/lib/dhcpsrv/pgsql_lease_mgr.cc index bb40366079..c2d0d43f39 100644 --- a/src/lib/dhcpsrv/pgsql_lease_mgr.cc +++ b/src/lib/dhcpsrv/pgsql_lease_mgr.cc @@ -1363,6 +1363,16 @@ PgSqlLeaseMgr::startLeaseStatsQuery6() { return(query); } +size_t +PgSqlLeaseMgr::wipeLeases4(const SubnetID& /*subnet_id*/) { + isc_throw(NotImplemented, "wipeLeases4 is not implemented for PgSQL backend"); +} + +size_t +PgSqlLeaseMgr::wipeLeases6(const SubnetID& /*subnet_id*/) { + isc_throw(NotImplemented, "wipeLeases6 is not implemented for PgSQL backend"); +} + string PgSqlLeaseMgr::getName() const { string name = ""; diff --git a/src/lib/dhcpsrv/pgsql_lease_mgr.h b/src/lib/dhcpsrv/pgsql_lease_mgr.h index ed8b192530..01b9ae41a9 100644 --- a/src/lib/dhcpsrv/pgsql_lease_mgr.h +++ b/src/lib/dhcpsrv/pgsql_lease_mgr.h @@ -319,7 +319,7 @@ public: /// invokes its start method, which fetches its statistical data /// result set by executing the RECOUNT_LEASE_STATS4 query. /// The query object is then returned. - /// + /// /// @return The populated query as a pointer to an LeaseStatsQuery virtual LeaseStatsQueryPtr startLeaseStatsQuery4(); @@ -329,10 +329,32 @@ public: /// invokes its start method, which fetches its statistical data /// result set by executing the RECOUNT_LEASE_STATS6 query. /// The query object is then returned. - /// + /// /// @return The populated query as a pointer to an LeaseStatsQuery virtual LeaseStatsQueryPtr startLeaseStatsQuery6(); + /// @brief Removes specified IPv4 leases. + /// + /// This rather dangerous method is able to remove all leases from specified + /// subnet. + /// + /// @todo: Not implemented yet. + /// + /// @param subnet_id identifier of the subnet + /// @return number of leases removed. + virtual size_t wipeLeases4(const SubnetID& subnet_id); + + /// @brief Removed specified IPv6 leases. + /// + /// This rather dangerous method is able to remove all leases from specified + /// subnet. + /// + /// @todo: Not implemented yet. + /// + /// @param subnet_id identifier of the subnet + /// @return number of leases removed. + virtual size_t wipeLeases6(const SubnetID& subnet_id); + /// @brief Return backend type /// /// Returns the type of the backend (e.g. "mysql", "memfile" etc.) diff --git a/src/lib/dhcpsrv/tests/cql_lease_mgr_unittest.cc b/src/lib/dhcpsrv/tests/cql_lease_mgr_unittest.cc index baa2f7190f..3da3658d1e 100644 --- a/src/lib/dhcpsrv/tests/cql_lease_mgr_unittest.cc +++ b/src/lib/dhcpsrv/tests/cql_lease_mgr_unittest.cc @@ -643,4 +643,14 @@ TEST_F(CqlLeaseMgrTest, deleteExpiredReclaimedLeases4) { testDeleteExpiredReclaimedLeases4(); } +// Tests that leases from specific subnet can be removed. +TEST_F(CqlLeaseMgrTest, DISABLED_wipeLeases4) { + testWipeLeases4(); +} + +// Tests that leases from specific subnet can be removed. +TEST_F(CqlLeaseMgrTest, DISABLED_wipeLeases6) { + testWipeLeases6(); +} + }; // Of anonymous namespace diff --git a/src/lib/dhcpsrv/tests/generic_lease_mgr_unittest.cc b/src/lib/dhcpsrv/tests/generic_lease_mgr_unittest.cc index b3d46c69e0..3a0c65783a 100644 --- a/src/lib/dhcpsrv/tests/generic_lease_mgr_unittest.cc +++ b/src/lib/dhcpsrv/tests/generic_lease_mgr_unittest.cc @@ -2684,6 +2684,69 @@ GenericLeaseMgrTest::testRecountLeaseStats6() { ASSERT_NO_FATAL_FAILURE(checkLeaseStats(expectedStats)); } +void +GenericLeaseMgrTest::testWipeLeases6() { + // Get the leases to be used for the test and add to the database + vector leases = createLeases6(); + leases[0]->subnet_id_ = 1; + leases[1]->subnet_id_ = 1; + leases[2]->subnet_id_ = 1; + leases[3]->subnet_id_ = 22; + leases[4]->subnet_id_ = 333; + leases[5]->subnet_id_ = 333; + leases[6]->subnet_id_ = 333; + leases[7]->subnet_id_ = 333; + + for (size_t i = 0; i < leases.size(); ++i) { + EXPECT_TRUE(lmptr_->addLease(leases[i])); + } + + // Let's try something simple. There shouldn't be any leases in + // subnet 2. The keep deleting the leases, perhaps in a different + // order they were added. + EXPECT_EQ(0, lmptr_->wipeLeases6(2)); + EXPECT_EQ(4, lmptr_->wipeLeases6(333)); + EXPECT_EQ(3, lmptr_->wipeLeases6(1)); + EXPECT_EQ(1, lmptr_->wipeLeases6(22)); + + // All the leases should be gone now. Check that that repeated + // attempt to delete them will not result in any additional removals. + EXPECT_EQ(0, lmptr_->wipeLeases6(1)); + EXPECT_EQ(0, lmptr_->wipeLeases6(22)); + EXPECT_EQ(0, lmptr_->wipeLeases6(333)); +} + +void +GenericLeaseMgrTest::testWipeLeases4() { + // Get the leases to be used for the test and add to the database + vector leases = createLeases4(); + leases[0]->subnet_id_ = 1; + leases[1]->subnet_id_ = 1; + leases[2]->subnet_id_ = 1; + leases[3]->subnet_id_ = 22; + leases[4]->subnet_id_ = 333; + leases[5]->subnet_id_ = 333; + leases[6]->subnet_id_ = 333; + leases[7]->subnet_id_ = 333; + + for (size_t i = 0; i < leases.size(); ++i) { + EXPECT_TRUE(lmptr_->addLease(leases[i])); + } + + // Let's try something simple. There shouldn't be any leases in + // subnet 2. The keep deleting the leases, perhaps in a different + // order they were added. + EXPECT_EQ(0, lmptr_->wipeLeases4(2)); + EXPECT_EQ(4, lmptr_->wipeLeases4(333)); + EXPECT_EQ(3, lmptr_->wipeLeases4(1)); + EXPECT_EQ(1, lmptr_->wipeLeases4(22)); + + // All the leases should be gone now. Check that that repeated + // attempt to delete them will not result in any additional removals. + EXPECT_EQ(0, lmptr_->wipeLeases4(1)); + EXPECT_EQ(0, lmptr_->wipeLeases4(22)); + EXPECT_EQ(0, lmptr_->wipeLeases4(333)); +} }; // namespace test }; // namespace dhcp diff --git a/src/lib/dhcpsrv/tests/generic_lease_mgr_unittest.h b/src/lib/dhcpsrv/tests/generic_lease_mgr_unittest.h index 5f23e4f5af..1a4b55277c 100644 --- a/src/lib/dhcpsrv/tests/generic_lease_mgr_unittest.h +++ b/src/lib/dhcpsrv/tests/generic_lease_mgr_unittest.h @@ -374,6 +374,19 @@ public: /// after altering the lease states in various ways. void testRecountLeaseStats6(); + + /// @brief Check if wipeLeases4 works properly. + /// + /// This test creates a bunch of leases in several subnets and then + /// attempts to delete them, one subnet at a time. + void testWipeLeases4(); + + /// @brief Check if wipeLeases6 works properly. + /// + /// This test creates a bunch of leases in several subnets and then + /// attempts to delete them, one subnet at a time. + void testWipeLeases6(); + /// @brief String forms of IPv4 addresses std::vector straddress4_; diff --git a/src/lib/dhcpsrv/tests/lease_mgr_unittest.cc b/src/lib/dhcpsrv/tests/lease_mgr_unittest.cc index 3a894da998..34b595286a 100644 --- a/src/lib/dhcpsrv/tests/lease_mgr_unittest.cc +++ b/src/lib/dhcpsrv/tests/lease_mgr_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2012-2015 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2012-2017 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -223,6 +223,16 @@ public: " is not implemented"); } + /// @brief Pretends to will all IPv4 leases from a subnet + virtual size_t wipeLeases4(const SubnetID&) { + isc_throw(NotImplemented, "ConreteLeaseMgr::wipeLeases4 not implemented"); + } + + /// @brief Pretends to will all IPv4 leases from a subnet + virtual size_t wipeLeases6(const SubnetID&) { + isc_throw(NotImplemented, "ConreteLeaseMgr::wipeLeases4 not implemented"); + } + /// @brief Returns backend type. /// /// Returns the type of the backend (e.g. "mysql", "memfile" etc.) diff --git a/src/lib/dhcpsrv/tests/memfile_lease_mgr_unittest.cc b/src/lib/dhcpsrv/tests/memfile_lease_mgr_unittest.cc index 3cf84c770e..8471ff7ed8 100644 --- a/src/lib/dhcpsrv/tests/memfile_lease_mgr_unittest.cc +++ b/src/lib/dhcpsrv/tests/memfile_lease_mgr_unittest.cc @@ -1894,4 +1894,16 @@ TEST_F(MemfileLeaseMgrTest, recountLeaseStats6) { testRecountLeaseStats6(); } +// Tests that leases from specific subnet can be removed. +TEST_F(MemfileLeaseMgrTest, wipeLeases4) { + startBackend(V4); + testWipeLeases4(); +} + +// Tests that leases from specific subnet can be removed. +TEST_F(MemfileLeaseMgrTest, wipeLeases6) { + startBackend(V6); + testWipeLeases6(); +} + }; // end of anonymous namespace diff --git a/src/lib/dhcpsrv/tests/mysql_lease_mgr_unittest.cc b/src/lib/dhcpsrv/tests/mysql_lease_mgr_unittest.cc index 4502bb23c7..bb2b5463f3 100644 --- a/src/lib/dhcpsrv/tests/mysql_lease_mgr_unittest.cc +++ b/src/lib/dhcpsrv/tests/mysql_lease_mgr_unittest.cc @@ -487,4 +487,14 @@ TEST_F(MySqlLeaseMgrTest, recountLeaseStats6) { testRecountLeaseStats6(); } +// Tests that leases from specific subnet can be removed. +TEST_F(MySqlLeaseMgrTest, DISABLED_wipeLeases4) { + testWipeLeases4(); +} + +// Tests that leases from specific subnet can be removed. +TEST_F(MySqlLeaseMgrTest, DISABLED_wipeLeases6) { + testWipeLeases6(); +} + }; // Of anonymous namespace diff --git a/src/lib/dhcpsrv/tests/pgsql_lease_mgr_unittest.cc b/src/lib/dhcpsrv/tests/pgsql_lease_mgr_unittest.cc index 19cf0c4d68..6b59fcdb2c 100644 --- a/src/lib/dhcpsrv/tests/pgsql_lease_mgr_unittest.cc +++ b/src/lib/dhcpsrv/tests/pgsql_lease_mgr_unittest.cc @@ -412,4 +412,14 @@ TEST_F(PgSqlLeaseMgrTest, recountLeaseStats6) { testRecountLeaseStats6(); } +// Tests that leases from specific subnet can be removed. +TEST_F(PgSqlLeaseMgrTest, DISABLED_wipeLeases4) { + testWipeLeases4(); +} + +// Tests that leases from specific subnet can be removed. +TEST_F(PgSqlLeaseMgrTest, DISABLED_wipeLeases6) { + testWipeLeases6(); +} + }; // namespace