]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3106] Reworked network state functions
authorMarcin Siodelski <marcin@isc.org>
Tue, 28 Nov 2023 20:31:09 +0000 (21:31 +0100)
committerMarcin Siodelski <marcin@isc.org>
Wed, 29 Nov 2023 19:58:56 +0000 (20:58 +0100)
Removed reset() function and replaced it with resetForDbConnection().
Also, removed the enableAll() function and used other functions instead.

src/bin/dhcp4/ctrl_dhcp4_srv.cc
src/bin/dhcp4/tests/ctrl_dhcp4_srv_unittest.cc
src/bin/dhcp6/ctrl_dhcp6_srv.cc
src/bin/dhcp6/tests/ctrl_dhcp6_srv_unittest.cc
src/hooks/dhcp/high_availability/ha_service.cc
src/lib/dhcpsrv/network_state.cc
src/lib/dhcpsrv/network_state.h
src/lib/dhcpsrv/tests/network_state_unittest.cc

index 972a3436a34fbf77f952dc8a12d6494f7f0b6707..4cf10464bd202ae5c395f4ac107f67544f3ea42d 100644 (file)
@@ -581,8 +581,8 @@ ControlledDhcpv4Srv::commandDhcpDisableHandler(const std::string&,
             // The user specified that the DHCP service should resume not
             // later than in max-period seconds. If the 'dhcp-enable' command
             // is not sent, the DHCP service will resume automatically.
-            network_state_->delayedEnableAll(static_cast<unsigned>(max_period),
-                                             type);
+            network_state_->delayedEnableService(static_cast<unsigned>(max_period),
+                                                 type);
         }
         network_state_->disableService(type);
 
@@ -956,7 +956,7 @@ ControlledDhcpv4Srv::processConfig(isc::data::ConstElementPtr config) {
         cfg_db->setAppendedParameters(params);
         cfg_db->createManagers();
         // Reset counters related to connections as all managers have been recreated.
-        srv->getNetworkState()->reset(NetworkState::DB_CONNECTION);
+        srv->getNetworkState()->resetForDbConnection();
 
     } catch (const std::exception& ex) {
         err << "Unable to open database: " << ex.what();
index 2046ec92fdf664fb243ca63b8e2bbc7d9382954b..e8d5e6fdf1c31336c9d7433b8a14e5731dc42b2b 100644 (file)
@@ -1857,7 +1857,7 @@ TEST_F(CtrlChannelDhcpv4SrvTest, dhcpDisableTemporarily) {
     EXPECT_FALSE(server_->network_state_->isServiceEnabled());
     // And the timer should be scheduled which counts the time to automatic
     // enabling of the service.
-    EXPECT_TRUE(server_->network_state_->isDelayedEnableAll());
+    EXPECT_TRUE(server_->network_state_->isDelayedEnableService());
 }
 
 // This test verifies that enable DHCP service command performs sanity check on
index 3e99d48fa5a513873a406863a3d595c9a2897ccb..ec19ba046ba1ee4167cfb3a7cc71ffaa5ff1f8c8 100644 (file)
@@ -583,8 +583,8 @@ ControlledDhcpv6Srv::commandDhcpDisableHandler(const std::string&,
             // The user specified that the DHCP service should resume not
             // later than in max-period seconds. If the 'dhcp-enable' command
             // is not sent, the DHCP service will resume automatically.
-            network_state_->delayedEnableAll(static_cast<unsigned>(max_period),
-                                             type);
+            network_state_->delayedEnableService(static_cast<unsigned>(max_period),
+                                                 type);
         }
         network_state_->disableService(type);
 
@@ -961,7 +961,7 @@ ControlledDhcpv6Srv::processConfig(isc::data::ConstElementPtr config) {
         cfg_db->setAppendedParameters(params);
         cfg_db->createManagers();
         // Reset counters related to connections as all managers have been recreated.
-        srv->getNetworkState()->reset(NetworkState::DB_CONNECTION);
+        srv->getNetworkState()->resetForDbConnection();
     } catch (const std::exception& ex) {
         err << "Unable to open database: " << ex.what();
         return (isc::config::createAnswer(CONTROL_RESULT_ERROR, err.str()));
index d467a249ffe8c3f4be2228bde51d34315ed233a6..d3e9339766fb68194bb3e2202877950a3e0fbe50 100644 (file)
@@ -1888,7 +1888,7 @@ TEST_F(CtrlChannelDhcpv6SrvTest, dhcpDisableTemporarily) {
     EXPECT_FALSE(server_->network_state_->isServiceEnabled());
     // And the timer should be scheduled which counts the time to automatic
     // enabling of the service.
-    EXPECT_TRUE(server_->network_state_->isDelayedEnableAll());
+    EXPECT_TRUE(server_->network_state_->isDelayedEnableService());
 }
 
 // This test verifies that enable DHCP service command performs sanity check on
index 8782b2497188cf5f82009fc25028cc120fd52772..25b23dbf7e6afd2e78a5903befcc8877e02cea54 100644 (file)
@@ -87,7 +87,7 @@ HAService::HAService(const unsigned int id, const IOServicePtr& io_service,
         communication_state_.reset(new CommunicationState6(io_service_, config));
     }
 
-    network_state_->reset(NetworkState::HA_LOCAL_COMMAND+id_);
+    network_state_->enableService(NetworkState::HA_LOCAL_COMMAND+id_);
 
     startModel(HA_WAITING_ST);
 
@@ -146,7 +146,7 @@ HAService::~HAService() {
     // Stop client and/or listener.
     stopClientAndListener();
 
-    network_state_->reset(NetworkState::HA_LOCAL_COMMAND+id_);
+    network_state_->enableService(NetworkState::HA_LOCAL_COMMAND+id_);
 }
 
 void
index 7dd77311bd87ca61a3faf275497df427dfec93a8..adc16cad5670460f3c07438e3f9f3547e102c4ca 100644 (file)
@@ -78,43 +78,33 @@ public:
         }
     }
 
-    /// @brief Reset internal counters for a specific origin.
+    /// @brief Reset internal counters for a database connection origin.
     ///
     /// @note The dhcp service will remain disabled until all flags are cleared.
-    ///
-    /// @param origin The origin of the state transition.
-    void reset(unsigned int origin) {
-        if (origin == NetworkState::DB_CONNECTION) {
-            disabled_by_db_connection_ = 0;
-        } else {
-            disabled_by_origin_.erase(origin);
-        }
-        // Enable the service only if all flags have been cleared.
-        if (disabled_by_origin_.empty() && disabled_by_db_connection_ == 0) {
+    void resetForDbConnection() {
+        disabled_by_db_connection_ = 0;
+        if (disabled_by_origin_.empty()) {
             globally_disabled_ = false;
         }
     }
 
-    /// @brief Enables DHCP service globally and per scopes.
+    /// @brief Enables DHCP service for an origin.
     ///
     /// If delayed enabling DHCP service has been scheduled, it cancels it.
     ///
     /// @param origin The origin of the state transition.
-    void enableAll(unsigned int origin) {
+    void delayedEnable(unsigned int origin) {
         setDisableService(false, origin);
-
-        /// @todo Enable service for all subnets and networks here.
-
         destroyTimer(origin);
     }
 
-    /// @brief Creates a timer counting the time when @c enableAll should be
+    /// @brief Creates a timer counting the time when @c delayedEnable should be
     /// automatically called.
     ///
     /// If the timer has been already scheduled, it is destroyed and replaced
     /// with a new timer.
     ///
-    /// @param seconds Number of seconds to elapse before the @c enableAll is
+    /// @param seconds Number of seconds to elapse before the @c delayedEnable is
     /// called.
     /// @param origin The origin of the state transition.
     void createTimer(const unsigned int seconds, unsigned int origin) {
@@ -124,7 +114,7 @@ public:
         }
         auto timer_name = getTimerName(origin);
         timer_mgr_->registerTimer(timer_name,
-                                  std::bind(&NetworkStateImpl::enableAll,
+                                  std::bind(&NetworkStateImpl::delayedEnable,
                                             shared_from_this(), origin),
                                   seconds * 1000,
                                   asiolink::IntervalTimer::ONE_SHOT);
@@ -198,34 +188,24 @@ void
 NetworkState::enableService(unsigned int origin) {
     if (MultiThreadingMgr::instance().getMode()) {
         std::lock_guard<std::mutex> lk(*mutex_);
-        impl_->setDisableService(false, origin);
-    } else {
-        impl_->setDisableService(false, origin);
-    }
-}
-
-void
-NetworkState::reset(unsigned int origin) {
-    if (MultiThreadingMgr::instance().getMode()) {
-        std::lock_guard<std::mutex> lk(*mutex_);
-        impl_->reset(origin);
+        impl_->delayedEnable(origin);
     } else {
-        impl_->reset(origin);
+        impl_->delayedEnable(origin);
     }
 }
 
 void
-NetworkState::enableAll(unsigned int origin) {
+NetworkState::resetForDbConnection() {
     if (MultiThreadingMgr::instance().getMode()) {
         std::lock_guard<std::mutex> lk(*mutex_);
-        impl_->enableAll(origin);
+        impl_->resetForDbConnection();
     } else {
-        impl_->enableAll(origin);
+        impl_->resetForDbConnection();
     }
 }
 
 void
-NetworkState::delayedEnableAll(const unsigned int seconds, unsigned int origin) {
+NetworkState::delayedEnableService(const unsigned int seconds, unsigned int origin) {
     if (MultiThreadingMgr::instance().getMode()) {
         std::lock_guard<std::mutex> lk(*mutex_);
         impl_->createTimer(seconds, origin);
@@ -245,7 +225,7 @@ NetworkState::isServiceEnabled() const {
 }
 
 bool
-NetworkState::isDelayedEnableAll() const {
+NetworkState::isDelayedEnableService() const {
     for (auto origin : impl_->disabled_by_origin_) {
         if (TimerMgr::instance()->isTimerRegistered(impl_->getTimerName(origin))) {
             return (true);
index 4a130692f904b2ea6822ab0dff4ba10857ccf927..861d1a78cb33440e776fc5c863ac3a3e04436946 100644 (file)
@@ -133,27 +133,19 @@ public:
     /// @param origin The origin of the state transition.
     void enableService(unsigned int origin);
 
-    /// @brief Reset internal counters.
+    /// @brief Reset internal counters for database connection.
     ///
-    /// Reset internal counters for a specific 'origin' after the server has
-    /// been reconfigured or all the connections have been restored.
-    ///
-    /// @param type The origin for which the state flags need to be reset.
-    void reset(unsigned int type);
-
-    /// @brief Enables DHCP service globally and for scopes which have been
-    /// disabled as a result of control command.
-    ///
-    /// @param origin The origin of the state transition.
-    void enableAll(unsigned int origin);
+    /// It results in enabling the network service if network service for
+    /// all other origins is enabled.
+    void resetForDbConnection();
 
     /// @brief Schedules enabling DHCP service in the future.
     ///
     /// @param seconds Number of seconds after which the service should be enabled
     /// unless @c enableAll is enabled before that time.
     /// @param origin The origin of the state transition.
-    void delayedEnableAll(const unsigned int seconds,
-                          unsigned int origin);
+    void delayedEnableService(const unsigned int seconds,
+                              unsigned int origin);
 
     /// @brief Checks if the DHCP service is globally enabled.
     ///
@@ -163,11 +155,11 @@ public:
     /// @brief Checks if delayed enabling of DHCP services is scheduled.
     ///
     /// It indicates that the timer is present which counts the time until
-    /// @c enableAll function will be called automatically.
+    /// @c delayedEnable function will be called automatically.
     ///
     /// @return true if delayed enabling of the DHCP service is scheduled,
     /// false otherwise.
-    bool isDelayedEnableAll() const;
+    bool isDelayedEnableService() const;
 
     /// @name Selective disabling/enabling DHCP service per scopes
     //@{
index 8c3b8708a958b4a6de93d71bb175e0bc992bc953..84f26c6ee3591b7ae95bff7dc40d6f72fd61504a 100644 (file)
@@ -126,25 +126,21 @@ public:
     /// 8. Reset using 'DB connection' origin (expect enabled state).
     void resetUsingDBConnectionOriginTest();
 
-    /// @brief This test verifies that enableAll() enables the service. This test will be
-    /// extended in the future to verify that it also enables disabled scopes.
-    void enableAllTest();
-
     /// @brief This test verifies that it is possible to setup delayed execution of enableAll
     /// function.
-    void delayedEnableAllTest();
+    void delayedEnableServiceTest();
 
     /// @brief This test verifies that explicitly enabling the service cancels the timer
     /// scheduled for automatically enabling it.
-    void earlyEnableAllTest();
+    void earlyEnableServiceTest();
 
-    /// @brief This test verifies that it is possible to call delayedEnableAll multiple times
+    /// @brief This test verifies that it is possible to call delayedEnableService multiple times
     /// and that it results in only one timer being scheduled.
-    void multipleDelayedEnableAllTest();
+    void multipleDelayedEnableServiceTest();
 
-    /// @brief This test verifies that it is possible to call delayedEnableAll multiple times
+    /// @brief This test verifies that it is possible to call delayedEnableService multiple times
     /// from different origins and that it results in each timer being scheduled.
-    void multipleDifferentOriginsDelayedEnableAllTest();
+    void multipleDifferentOriginsDelayedEnableServiceTest();
 
     /// @brief Runs IO service with a timeout.
     ///
@@ -408,7 +404,7 @@ NetworkStateTest::resetUsingUserCommandOriginTest() {
     EXPECT_FALSE(state.isServiceEnabled());
     state.disableService(NetworkState::DB_CONNECTION);
     EXPECT_FALSE(state.isServiceEnabled());
-    state.reset(NetworkState::USER_COMMAND);
+    state.enableService(NetworkState::USER_COMMAND);
     EXPECT_FALSE(state.isServiceEnabled());
     state.enableService(NetworkState::HA_LOCAL_COMMAND);
     EXPECT_FALSE(state.isServiceEnabled());
@@ -422,7 +418,7 @@ NetworkStateTest::resetUsingUserCommandOriginTest() {
     EXPECT_FALSE(state.isServiceEnabled());
     state.disableService(NetworkState::USER_COMMAND);
     EXPECT_FALSE(state.isServiceEnabled());
-    state.reset(NetworkState::USER_COMMAND);
+    state.enableService(NetworkState::USER_COMMAND);
     EXPECT_TRUE(state.isServiceEnabled());
 }
 
@@ -431,11 +427,11 @@ NetworkStateTest::resetUsingUserCommandOriginTest() {
 // 1. Disable using 'user command' origin 1 time (expect disabled state).
 // 2. Disable using 'HA command' origin 3 times (expect disabled state).
 // 3. Disable using 'DB connection' origin 1 time (expect disabled state).
-// 4. Reset using 'HA command' origin (expect disabled state).
+// 4. Enable using 'HA command' origin (expect disabled state).
 // 5. Enable using 'user command' origin 1 time (expect disabled state).
 // 6. Enable using 'DB connection' origin 1 time (expect enabled state).
 // 7. Disable using 'HA command' origin 3 times (expect disabled state).
-// 8. Reset using 'HA command' origin (expect enabled state).
+// 8. Enable using 'HA command' origin (expect enabled state).
 void
 NetworkStateTest::resetUsingHACommandOriginTest() {
     NetworkState state(NetworkState::DHCPv4);
@@ -451,7 +447,7 @@ NetworkStateTest::resetUsingHACommandOriginTest() {
     EXPECT_FALSE(state.isServiceEnabled());
     state.disableService(NetworkState::DB_CONNECTION);
     EXPECT_FALSE(state.isServiceEnabled());
-    state.reset(NetworkState::HA_LOCAL_COMMAND);
+    state.enableService(NetworkState::HA_LOCAL_COMMAND);
     EXPECT_FALSE(state.isServiceEnabled());
     state.enableService(NetworkState::USER_COMMAND);
     EXPECT_FALSE(state.isServiceEnabled());
@@ -465,7 +461,7 @@ NetworkStateTest::resetUsingHACommandOriginTest() {
     EXPECT_FALSE(state.isServiceEnabled());
     state.disableService(NetworkState::HA_LOCAL_COMMAND);
     EXPECT_FALSE(state.isServiceEnabled());
-    state.reset(NetworkState::HA_LOCAL_COMMAND);
+    state.enableService(NetworkState::HA_LOCAL_COMMAND);
     EXPECT_TRUE(state.isServiceEnabled());
 }
 
@@ -494,7 +490,7 @@ NetworkStateTest::resetUsingDBConnectionOriginTest() {
     EXPECT_FALSE(state.isServiceEnabled());
     state.disableService(NetworkState::DB_CONNECTION);
     EXPECT_FALSE(state.isServiceEnabled());
-    state.reset(NetworkState::DB_CONNECTION);
+    state.resetForDbConnection();
     EXPECT_FALSE(state.isServiceEnabled());
     state.enableService(NetworkState::USER_COMMAND);
     EXPECT_FALSE(state.isServiceEnabled());
@@ -508,37 +504,18 @@ NetworkStateTest::resetUsingDBConnectionOriginTest() {
     EXPECT_FALSE(state.isServiceEnabled());
     state.disableService(NetworkState::DB_CONNECTION);
     EXPECT_FALSE(state.isServiceEnabled());
-    state.reset(NetworkState::DB_CONNECTION);
-    EXPECT_TRUE(state.isServiceEnabled());
-}
-
-// This test verifies that enableAll() enables the service. This test will be
-// extended in the future to verify that it also enables disabled scopes.
-void
-NetworkStateTest::enableAllTest() {
-    NetworkState state(NetworkState::DHCPv4);
-    state.disableService(NetworkState::USER_COMMAND);
-    EXPECT_FALSE(state.isServiceEnabled());
-    state.enableAll(NetworkState::USER_COMMAND);
-    EXPECT_TRUE(state.isServiceEnabled());
-    state.disableService(NetworkState::HA_LOCAL_COMMAND);
-    EXPECT_FALSE(state.isServiceEnabled());
-    state.enableAll(NetworkState::HA_LOCAL_COMMAND);
-    EXPECT_TRUE(state.isServiceEnabled());
-    state.disableService(NetworkState::DB_CONNECTION);
-    EXPECT_FALSE(state.isServiceEnabled());
-    state.enableAll(NetworkState::DB_CONNECTION);
+    state.resetForDbConnection();
     EXPECT_TRUE(state.isServiceEnabled());
 }
 
 // This test verifies that it is possible to setup delayed execution of enableAll
 // function.
 void
-NetworkStateTest::delayedEnableAllTest() {
+NetworkStateTest::delayedEnableServiceTest() {
     NetworkState state(NetworkState::DHCPv4);
     // Disable the service and then schedule enabling it in 1 second.
     state.disableService(NetworkState::USER_COMMAND);
-    state.delayedEnableAll(1, NetworkState::USER_COMMAND);
+    state.delayedEnableService(1, NetworkState::USER_COMMAND);
     // Initially the service should be still disabled.
     EXPECT_FALSE(state.isServiceEnabled());
     // After running IO service for 2 seconds, the service should be enabled.
@@ -546,7 +523,7 @@ NetworkStateTest::delayedEnableAllTest() {
     EXPECT_TRUE(state.isServiceEnabled());
     // Disable the service and then schedule enabling it in 1 second.
     state.disableService(NetworkState::HA_LOCAL_COMMAND);
-    state.delayedEnableAll(1, NetworkState::HA_LOCAL_COMMAND);
+    state.delayedEnableService(1, NetworkState::HA_LOCAL_COMMAND);
     // Initially the service should be still disabled.
     EXPECT_FALSE(state.isServiceEnabled());
     // After running IO service for 2 seconds, the service should be enabled.
@@ -554,38 +531,38 @@ NetworkStateTest::delayedEnableAllTest() {
     EXPECT_TRUE(state.isServiceEnabled());
     // Disable the service and then schedule enabling it in 1 second.
     state.disableService(NetworkState::DB_CONNECTION);
-    EXPECT_THROW(state.delayedEnableAll(1, NetworkState::DB_CONNECTION), BadValue);
+    EXPECT_THROW(state.delayedEnableService(1, NetworkState::DB_CONNECTION), BadValue);
 }
 
 // This test verifies that explicitly enabling the service cancels the timer
 // scheduled for automatically enabling it.
 void
-NetworkStateTest::earlyEnableAllTest() {
+NetworkStateTest::earlyEnableServiceTest() {
     NetworkState state(NetworkState::DHCPv4);
     // Disable the service.
     state.disableService(NetworkState::USER_COMMAND);
     EXPECT_FALSE(state.isServiceEnabled());
     // Schedule enabling the service in 2 seconds.
-    state.delayedEnableAll(2, NetworkState::USER_COMMAND);
+    state.delayedEnableService(10, NetworkState::USER_COMMAND);
     // Explicitly enable the service.
-    state.enableAll(NetworkState::USER_COMMAND);
+    state.enableService(NetworkState::USER_COMMAND);
     // The timer should be now canceled and the service should be enabled.
-    EXPECT_FALSE(state.isDelayedEnableAll());
+    EXPECT_FALSE(state.isDelayedEnableService());
     EXPECT_TRUE(state.isServiceEnabled());
 }
 
-// This test verifies that it is possible to call delayedEnableAll multiple times
+// This test verifies that it is possible to call delayedEnableService multiple times
 // and that it results in only one timer being scheduled.
 void
-NetworkStateTest::multipleDelayedEnableAllTest() {
+NetworkStateTest::multipleDelayedEnableServiceTest() {
     NetworkState state(NetworkState::DHCPv4);
     // Disable the service and then schedule enabling it in 5 second.
     state.disableService(NetworkState::USER_COMMAND);
     // Schedule the first timer for 5 seconds.
-    state.delayedEnableAll(5, NetworkState::USER_COMMAND);
+    state.delayedEnableService(5, NetworkState::USER_COMMAND);
     // When calling it the second time the old timer should be destroyed and
     // the timeout should be set to 2 seconds.
-    state.delayedEnableAll(2, NetworkState::USER_COMMAND);
+    state.delayedEnableService(2, NetworkState::USER_COMMAND);
     // Initially the service should be still disabled.
     EXPECT_FALSE(state.isServiceEnabled());
     // After running IO service for 3 seconds, the service should be enabled.
@@ -593,23 +570,23 @@ NetworkStateTest::multipleDelayedEnableAllTest() {
     EXPECT_TRUE(state.isServiceEnabled());
     // The timer should not be present, even though the first timer was created
     // with 5 seconds interval.
-    EXPECT_FALSE(state.isDelayedEnableAll());
+    EXPECT_FALSE(state.isDelayedEnableService());
 }
 
-// This test verifies that it is possible to call delayedEnableAll multiple times
+// This test verifies that it is possible to call delayedEnableService multiple times
 // from different origins and that it results in each timer being scheduled.
 void
-NetworkStateTest::multipleDifferentOriginsDelayedEnableAllTest() {
+NetworkStateTest::multipleDifferentOriginsDelayedEnableServiceTest() {
     NetworkState state(NetworkState::DHCPv4);
     // Disable the service and then schedule enabling it in 5 second.
     state.disableService(NetworkState::HA_LOCAL_COMMAND);
     // Disable the service and then schedule enabling it in 2 second.
     state.disableService(NetworkState::USER_COMMAND);
     // Schedule the first timer for 5 seconds.
-    state.delayedEnableAll(5, NetworkState::HA_LOCAL_COMMAND);
+    state.delayedEnableService(5, NetworkState::HA_LOCAL_COMMAND);
     // When calling it the second time the old timer should not be destroyed and
     // the new timeout should be set to 2 seconds.
-    state.delayedEnableAll(2, NetworkState::USER_COMMAND);
+    state.delayedEnableService(2, NetworkState::USER_COMMAND);
     // Initially the service should be still disabled.
     EXPECT_FALSE(state.isServiceEnabled());
     // After running IO service for 3 seconds, the service should not be enabled.
@@ -617,13 +594,13 @@ NetworkStateTest::multipleDifferentOriginsDelayedEnableAllTest() {
     EXPECT_FALSE(state.isServiceEnabled());
     // The timer should be present, because the first timer was created with 5
     // seconds interval.
-    EXPECT_TRUE(state.isDelayedEnableAll());
+    EXPECT_TRUE(state.isDelayedEnableService());
     // After running IO service for 3 seconds, the service should be enabled.
     runIOService(3000);
     EXPECT_TRUE(state.isServiceEnabled());
     // The timer should not be present, because the first timer was created with
     // 5 seconds interval.
-    EXPECT_FALSE(state.isDelayedEnableAll());
+    EXPECT_FALSE(state.isDelayedEnableService());
 }
 
 // Test invocations.
@@ -736,49 +713,40 @@ TEST_F(NetworkStateTest, resetUsingHACommandOriginTestMultiThreading) {
     resetUsingHACommandOriginTest();
 }
 
-TEST_F(NetworkStateTest, enableAllTest) {
-    enableAllTest();
-}
-
-TEST_F(NetworkStateTest, enableAllTestMultiThreading) {
-    MultiThreadingMgr::instance().setMode(true);
-    enableAllTest();
-}
-
-TEST_F(NetworkStateTest, delayedEnableAllTest) {
-    delayedEnableAllTest();
+TEST_F(NetworkStateTest, delayedEnableServiceTest) {
+    delayedEnableServiceTest();
 }
 
 TEST_F(NetworkStateTest, delayedEnableAllTestMultiThreading) {
     MultiThreadingMgr::instance().setMode(true);
-    delayedEnableAllTest();
+    delayedEnableServiceTest();
 }
 
-TEST_F(NetworkStateTest, earlyEnableAllTest) {
-    earlyEnableAllTest();
+TEST_F(NetworkStateTest, earlyEnableServiceTest) {
+    earlyEnableServiceTest();
 }
 
-TEST_F(NetworkStateTest, earlyEnableAllTestMultiThreading) {
+TEST_F(NetworkStateTest, earlyEnableServiceTestMultiThreading) {
     MultiThreadingMgr::instance().setMode(true);
-    earlyEnableAllTest();
+    earlyEnableServiceTest();
 }
 
-TEST_F(NetworkStateTest, multipleDelayedEnableAllTest) {
-    multipleDelayedEnableAllTest();
+TEST_F(NetworkStateTest, multipleDelayedEnableServiceTest) {
+    multipleDelayedEnableServiceTest();
 }
 
-TEST_F(NetworkStateTest, multipleDelayedEnableAllTestMultiThreading) {
+TEST_F(NetworkStateTest, multipleDelayedEnableServiceTestMultiThreading) {
     MultiThreadingMgr::instance().setMode(true);
-    multipleDelayedEnableAllTest();
+    multipleDelayedEnableServiceTest();
 }
 
-TEST_F(NetworkStateTest, multipleDifferentOriginsDelayedEnableAllTest) {
-    multipleDifferentOriginsDelayedEnableAllTest();
+TEST_F(NetworkStateTest, multipleDifferentOriginsDelayedEnableServiceTest) {
+    multipleDifferentOriginsDelayedEnableServiceTest();
 }
 
-TEST_F(NetworkStateTest, multipleDifferentOriginsDelayedEnableAllTestMultiThreading) {
+TEST_F(NetworkStateTest, multipleDifferentOriginsDelayedEnableServiceTestMultiThreading) {
     MultiThreadingMgr::instance().setMode(true);
-    multipleDifferentOriginsDelayedEnableAllTest();
+    multipleDifferentOriginsDelayedEnableServiceTest();
 }
 
 } // end of anonymous namespace