From: Francis Dupont Date: Tue, 3 Nov 2020 11:43:01 +0000 (+0100) Subject: [#1442] Added FillFdHoles to lease db lost test X-Git-Tag: Kea-1.9.2~159 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=845d8b9c4fbf2f322b8c0602fcdb82166c3dd259;p=thirdparty%2Fkea.git [#1442] Added FillFdHoles to lease db lost test --- diff --git a/src/lib/dhcpsrv/tests/generic_lease_mgr_unittest.cc b/src/lib/dhcpsrv/tests/generic_lease_mgr_unittest.cc index 9d7a3f4d84..51c85b0fce 100644 --- a/src/lib/dhcpsrv/tests/generic_lease_mgr_unittest.cc +++ b/src/lib/dhcpsrv/tests/generic_lease_mgr_unittest.cc @@ -3287,6 +3287,13 @@ LeaseMgrDbLostCallbackTest::testDbLostCallback() { DatabaseConnection::db_lost_callback = std::bind(&LeaseMgrDbLostCallbackTest::db_lost_callback, this, ph::_1); + // Find the most recently opened socket. Our SQL client's socket should + // be the next one. + int last_open_socket = findLastSocketFd(); + + // Fill holes. + FillFdHoles holes(last_open_socket); + // Connect to the lease backend. ASSERT_NO_THROW(LeaseMgrFactory::create(validConnectString()));