Commit 3cd2f11f authored by Razvan Becheriu's avatar Razvan Becheriu

[#1040] updated unittests

parent e57f523f
...@@ -443,6 +443,7 @@ TEST(CqlOpenTest, OpenDatabase) { ...@@ -443,6 +443,7 @@ TEST(CqlOpenTest, OpenDatabase) {
// Tidy up after the test // Tidy up after the test
destroyCqlSchema(); destroyCqlSchema();
LeaseMgrFactory::destroy();
} }
/// @brief Check the getType() method /// @brief Check the getType() method
......
...@@ -335,6 +335,12 @@ TEST_F(MySqlLeaseMgrTest, updateLease4) { ...@@ -335,6 +335,12 @@ TEST_F(MySqlLeaseMgrTest, updateLease4) {
testUpdateLease4(); testUpdateLease4();
} }
/// @brief Lease4 update tests
TEST_F(MySqlLeaseMgrTest, updateLease4MultiThreading) {
MultiThreadingMgr::instance().setMode(true);
testUpdateLease4();
}
/// @brief Lease4 concurrent update tests /// @brief Lease4 concurrent update tests
/// ///
/// Checks that we are not able to concurrently update a lease in the database. /// Checks that we are not able to concurrently update a lease in the database.
...@@ -342,10 +348,12 @@ TEST_F(MySqlLeaseMgrTest, concurrentUpdateLease4) { ...@@ -342,10 +348,12 @@ TEST_F(MySqlLeaseMgrTest, concurrentUpdateLease4) {
testConcurrentUpdateLease4(); testConcurrentUpdateLease4();
} }
/// @brief Lease4 update tests /// @brief Lease4 concurrent update tests
TEST_F(MySqlLeaseMgrTest, updateLease4MultiThreading) { ///
/// Checks that we are not able to concurrently update a lease in the database.
TEST_F(MySqlLeaseMgrTest, concurrentUpdateLease4MultiThreading) {
MultiThreadingMgr::instance().setMode(true); MultiThreadingMgr::instance().setMode(true);
testUpdateLease4(); testConcurrentUpdateLease4();
} }
/// @brief Check GetLease4 methods - access by Hardware Address /// @brief Check GetLease4 methods - access by Hardware Address
...@@ -777,6 +785,12 @@ TEST_F(MySqlLeaseMgrTest, updateLease6) { ...@@ -777,6 +785,12 @@ TEST_F(MySqlLeaseMgrTest, updateLease6) {
testUpdateLease6(); testUpdateLease6();
} }
/// @brief Lease6 update tests
TEST_F(MySqlLeaseMgrTest, updateLease6MultiThreading) {
MultiThreadingMgr::instance().setMode(true);
testUpdateLease6();
}
/// @brief Lease6 concurrent update tests /// @brief Lease6 concurrent update tests
/// ///
/// Checks that we are not able to concurrently update a lease in the database. /// Checks that we are not able to concurrently update a lease in the database.
...@@ -784,10 +798,12 @@ TEST_F(MySqlLeaseMgrTest, concurrentUpdateLease6) { ...@@ -784,10 +798,12 @@ TEST_F(MySqlLeaseMgrTest, concurrentUpdateLease6) {
testConcurrentUpdateLease6(); testConcurrentUpdateLease6();
} }
/// @brief Lease6 update tests /// @brief Lease6 concurrent update tests
TEST_F(MySqlLeaseMgrTest, updateLease6MultiThreading) { ///
/// Checks that we are not able to concurrently update a lease in the database.
TEST_F(MySqlLeaseMgrTest, concurrentUpdateLease6MultiThreading) {
MultiThreadingMgr::instance().setMode(true); MultiThreadingMgr::instance().setMode(true);
testUpdateLease6(); testConcurrentUpdateLease6();
} }
/// @brief DHCPv4 Lease recreation tests /// @brief DHCPv4 Lease recreation tests
......
...@@ -196,6 +196,7 @@ TEST(PgSqlOpenTest, OpenDatabase) { ...@@ -196,6 +196,7 @@ TEST(PgSqlOpenTest, OpenDatabase) {
// Tidy up after the test // Tidy up after the test
destroyPgSQLSchema(); destroyPgSQLSchema();
LeaseMgrFactory::destroy();
} }
/// @brief Check that database can be opened with Multi-Threading /// @brief Check that database can be opened with Multi-Threading
...@@ -290,6 +291,12 @@ TEST_F(PgSqlLeaseMgrTest, updateLease4) { ...@@ -290,6 +291,12 @@ TEST_F(PgSqlLeaseMgrTest, updateLease4) {
testUpdateLease4(); testUpdateLease4();
} }
/// @brief Lease4 update tests
TEST_F(PgSqlLeaseMgrTest, updateLease4MultiThreading) {
MultiThreadingMgr::instance().setMode(true);
testUpdateLease4();
}
/// @brief Lease4 concurrent update tests /// @brief Lease4 concurrent update tests
/// ///
/// Checks that we are not able to concurrently update a lease in the database. /// Checks that we are not able to concurrently update a lease in the database.
...@@ -297,10 +304,12 @@ TEST_F(PgSqlLeaseMgrTest, concurrentUpdateLease4) { ...@@ -297,10 +304,12 @@ TEST_F(PgSqlLeaseMgrTest, concurrentUpdateLease4) {
testConcurrentUpdateLease4(); testConcurrentUpdateLease4();
} }
/// @brief Lease4 update tests /// @brief Lease4 concurrent update tests
TEST_F(PgSqlLeaseMgrTest, updateLease4MultiThreading) { ///
/// Checks that we are not able to concurrently update a lease in the database.
TEST_F(PgSqlLeaseMgrTest, concurrentUpdateLease4MultiThreading) {
MultiThreadingMgr::instance().setMode(true); MultiThreadingMgr::instance().setMode(true);
testUpdateLease4(); testConcurrentUpdateLease4();
} }
/// @brief Check GetLease4 methods - access by Hardware Address /// @brief Check GetLease4 methods - access by Hardware Address
...@@ -732,6 +741,12 @@ TEST_F(PgSqlLeaseMgrTest, updateLease6) { ...@@ -732,6 +741,12 @@ TEST_F(PgSqlLeaseMgrTest, updateLease6) {
testUpdateLease6(); testUpdateLease6();
} }
/// @brief Lease6 update tests
TEST_F(PgSqlLeaseMgrTest, updateLease6MultiThreading) {
MultiThreadingMgr::instance().setMode(true);
testUpdateLease6();
}
/// @brief Lease6 concurrent update tests /// @brief Lease6 concurrent update tests
/// ///
/// Checks that we are not able to concurrently update a lease in the database. /// Checks that we are not able to concurrently update a lease in the database.
...@@ -739,10 +754,12 @@ TEST_F(PgSqlLeaseMgrTest, concurrentUpdateLease6) { ...@@ -739,10 +754,12 @@ TEST_F(PgSqlLeaseMgrTest, concurrentUpdateLease6) {
testConcurrentUpdateLease6(); testConcurrentUpdateLease6();
} }
/// @brief Lease6 update tests /// @brief Lease6 concurrent update tests
TEST_F(PgSqlLeaseMgrTest, updateLease6MultiThreading) { ///
/// Checks that we are not able to concurrently update a lease in the database.
TEST_F(PgSqlLeaseMgrTest, concurrentUpdateLease6MultiThreading) {
MultiThreadingMgr::instance().setMode(true); MultiThreadingMgr::instance().setMode(true);
testUpdateLease6(); testConcurrentUpdateLease6();
} }
/// @brief DHCPv4 Lease recreation tests /// @brief DHCPv4 Lease recreation tests
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment