]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#1040] updated unittests
authorRazvan Becheriu <razvan@isc.org>
Fri, 17 Jan 2020 13:37:27 +0000 (15:37 +0200)
committerRazvan Becheriu <razvan@isc.org>
Fri, 17 Jan 2020 13:37:27 +0000 (15:37 +0200)
src/lib/dhcpsrv/tests/cql_lease_mgr_unittest.cc
src/lib/dhcpsrv/tests/mysql_lease_mgr_unittest.cc
src/lib/dhcpsrv/tests/pgsql_lease_mgr_unittest.cc

index 742b36dc79ca239bac4bc919200f3b22a90d6209..618febbe0c2a1f82c9ab8ee9b92f444dbe855888 100644 (file)
@@ -443,6 +443,7 @@ TEST(CqlOpenTest, OpenDatabase) {
 
     // Tidy up after the test
     destroyCqlSchema();
+    LeaseMgrFactory::destroy();
 }
 
 /// @brief Check the getType() method
index 61e2cdbe6ac4a88c3948b56847c46a6b6e0a3db9..37511bcf62256aa8b0bbeb091e2e57ce2e976ace 100644 (file)
@@ -335,6 +335,12 @@ TEST_F(MySqlLeaseMgrTest, updateLease4) {
     testUpdateLease4();
 }
 
+/// @brief Lease4 update tests
+TEST_F(MySqlLeaseMgrTest, updateLease4MultiThreading) {
+    MultiThreadingMgr::instance().setMode(true);
+    testUpdateLease4();
+}
+
 /// @brief Lease4 concurrent update tests
 ///
 /// Checks that we are not able to concurrently update a lease in the database.
@@ -342,10 +348,12 @@ TEST_F(MySqlLeaseMgrTest, concurrentUpdateLease4) {
     testConcurrentUpdateLease4();
 }
 
-/// @brief Lease4 update tests
-TEST_F(MySqlLeaseMgrTest, updateLease4MultiThreading) {
+/// @brief Lease4 concurrent update tests
+///
+/// Checks that we are not able to concurrently update a lease in the database.
+TEST_F(MySqlLeaseMgrTest, concurrentUpdateLease4MultiThreading) {
     MultiThreadingMgr::instance().setMode(true);
-    testUpdateLease4();
+    testConcurrentUpdateLease4();
 }
 
 /// @brief Check GetLease4 methods - access by Hardware Address
@@ -777,6 +785,12 @@ TEST_F(MySqlLeaseMgrTest, updateLease6) {
     testUpdateLease6();
 }
 
+/// @brief Lease6 update tests
+TEST_F(MySqlLeaseMgrTest, updateLease6MultiThreading) {
+    MultiThreadingMgr::instance().setMode(true);
+    testUpdateLease6();
+}
+
 /// @brief Lease6 concurrent update tests
 ///
 /// Checks that we are not able to concurrently update a lease in the database.
@@ -784,10 +798,12 @@ TEST_F(MySqlLeaseMgrTest, concurrentUpdateLease6) {
     testConcurrentUpdateLease6();
 }
 
-/// @brief Lease6 update tests
-TEST_F(MySqlLeaseMgrTest, updateLease6MultiThreading) {
+/// @brief Lease6 concurrent update tests
+///
+/// Checks that we are not able to concurrently update a lease in the database.
+TEST_F(MySqlLeaseMgrTest, concurrentUpdateLease6MultiThreading) {
     MultiThreadingMgr::instance().setMode(true);
-    testUpdateLease6();
+    testConcurrentUpdateLease6();
 }
 
 /// @brief DHCPv4 Lease recreation tests
index cf93a4a5ed3470fc8120195c5882bcb05e031e12..ab14d6c58e82ec0b52322725a0a38a9b9a51c81c 100644 (file)
@@ -196,6 +196,7 @@ TEST(PgSqlOpenTest, OpenDatabase) {
 
     // Tidy up after the test
     destroyPgSQLSchema();
+    LeaseMgrFactory::destroy();
 }
 
 /// @brief Check that database can be opened with Multi-Threading
@@ -290,6 +291,12 @@ TEST_F(PgSqlLeaseMgrTest, updateLease4) {
     testUpdateLease4();
 }
 
+/// @brief Lease4 update tests
+TEST_F(PgSqlLeaseMgrTest, updateLease4MultiThreading) {
+    MultiThreadingMgr::instance().setMode(true);
+    testUpdateLease4();
+}
+
 /// @brief Lease4 concurrent update tests
 ///
 /// Checks that we are not able to concurrently update a lease in the database.
@@ -297,10 +304,12 @@ TEST_F(PgSqlLeaseMgrTest, concurrentUpdateLease4) {
     testConcurrentUpdateLease4();
 }
 
-/// @brief Lease4 update tests
-TEST_F(PgSqlLeaseMgrTest, updateLease4MultiThreading) {
+/// @brief Lease4 concurrent update tests
+///
+/// Checks that we are not able to concurrently update a lease in the database.
+TEST_F(PgSqlLeaseMgrTest, concurrentUpdateLease4MultiThreading) {
     MultiThreadingMgr::instance().setMode(true);
-    testUpdateLease4();
+    testConcurrentUpdateLease4();
 }
 
 /// @brief Check GetLease4 methods - access by Hardware Address
@@ -732,6 +741,12 @@ TEST_F(PgSqlLeaseMgrTest, updateLease6) {
     testUpdateLease6();
 }
 
+/// @brief Lease6 update tests
+TEST_F(PgSqlLeaseMgrTest, updateLease6MultiThreading) {
+    MultiThreadingMgr::instance().setMode(true);
+    testUpdateLease6();
+}
+
 /// @brief Lease6 concurrent update tests
 ///
 /// Checks that we are not able to concurrently update a lease in the database.
@@ -739,10 +754,12 @@ TEST_F(PgSqlLeaseMgrTest, concurrentUpdateLease6) {
     testConcurrentUpdateLease6();
 }
 
-/// @brief Lease6 update tests
-TEST_F(PgSqlLeaseMgrTest, updateLease6MultiThreading) {
+/// @brief Lease6 concurrent update tests
+///
+/// Checks that we are not able to concurrently update a lease in the database.
+TEST_F(PgSqlLeaseMgrTest, concurrentUpdateLease6MultiThreading) {
     MultiThreadingMgr::instance().setMode(true);
-    testUpdateLease6();
+    testConcurrentUpdateLease6();
 }
 
 /// @brief DHCPv4 Lease recreation tests