]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#1680] fixed unittests
authorRazvan Becheriu <razvan@isc.org>
Thu, 29 Apr 2021 14:05:00 +0000 (17:05 +0300)
committerRazvan Becheriu <razvan@isc.org>
Thu, 29 Apr 2021 14:05:00 +0000 (17:05 +0300)
src/lib/dhcpsrv/tests/memfile_lease_mgr_unittest.cc

index 749cebe30c7ca7590fbae6cacd59ea8f70218a12..5137b5b0ab837218230f0500b082ec2201f90cad 100644 (file)
@@ -695,18 +695,8 @@ TEST_F(MemfileLeaseMgrTest, leaseFileCleanupStartFail) {
     pmap["universe"] = "4";
     pmap["name"] = getLeaseFilePath("leasefile4_0.csv");
     pmap["lfc-interval"] = "1";
-    boost::scoped_ptr<NakedMemfileLeaseMgr> lease_mgr(new NakedMemfileLeaseMgr(pmap));
-
-    // Try to run the lease file cleanup.
-    ASSERT_NO_THROW(lease_mgr->lfcCallback());
-
-    // Wait for the LFC process to complete.
-    ASSERT_TRUE(waitForProcess(*lease_mgr, 2));
-
-    // And make sure it has returned an error.
-    EXPECT_EQ(EXIT_FAILURE, lease_mgr->getLFCExitStatus())
-        << "Executing the LFC process failed: make sure that"
-        " the kea-lfc program has been compiled.";
+    boost::scoped_ptr<NakedMemfileLeaseMgr> lease_mgr;
+    ASSERT_THROW(lease_mgr.reset(new NakedMemfileLeaseMgr(pmap)), ProcessSpawnError);
 }
 
 /// @brief This test checks that the callback function executing the cleanup of the