]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#1442] Added FillFdHoles to lease db lost test
authorFrancis Dupont <fdupont@isc.org>
Tue, 3 Nov 2020 11:43:01 +0000 (12:43 +0100)
committerFrancis Dupont <fdupont@isc.org>
Mon, 16 Nov 2020 10:15:27 +0000 (11:15 +0100)
src/lib/dhcpsrv/tests/generic_lease_mgr_unittest.cc

index 9d7a3f4d843f1926b9d44c6982d56ca4e811d804..51c85b0fce842cc2e8282af18f9dcb18b4aa2fca 100644 (file)
@@ -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()));