Skip to content

Commit

Permalink
connectivity monitor test code updated
Browse files Browse the repository at this point in the history
  • Loading branch information
cmuhammedrafi committed Dec 27, 2024
1 parent 73b14f6 commit 7c4ff7b
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
5 changes: 2 additions & 3 deletions NetworkManagerConnectivity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -452,8 +452,7 @@ namespace WPEFramework
ConnectivityMonitor::~ConnectivityMonitor()
{
NMLOG_WARNING("~ConnectivityMonitor");
m_cmRunning = false;
m_cmCv.notify_one();
stopConnectivityMonitor();
}

std::vector<std::string> ConnectivityMonitor::getConnectivityMonitorEndpoints()
Expand Down Expand Up @@ -537,7 +536,7 @@ namespace WPEFramework
{
m_cmRunning = false;
m_cmCv.notify_one();
NMLOG_INFO("connectivity monitor stopping");
NMLOG_INFO("connectivity monitor stopping ...");
return true;
}

Expand Down
2 changes: 2 additions & 0 deletions NetworkManagerGnomeProxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ namespace WPEFramework
nmEvent = GnomeNetworkManagerEvents::getInstance();
nmEvent->startNetworkMangerEventMonitor();
wifi = wifiManager::getInstance();
/* start connectivity monitor */
connectivityMonitor.startConnectivityMonitor();
return;
}

Expand Down
4 changes: 4 additions & 0 deletions NetworkManagerImplementation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ namespace WPEFramework
NetworkManagerImplementation::~NetworkManagerImplementation()
{
LOG_ENTRY_FUNCTION();

/* stoping connectivity monitor */
connectivityMonitor.stopConnectivityMonitor();

if(m_registrationThread.joinable())
{
m_registrationThread.join();
Expand Down
1 change: 1 addition & 0 deletions NetworkManagerRDKProxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,7 @@ namespace WPEFramework
getInitialConnectionState();
}

connectivityMonitor.startConnectivityMonitor();
}

uint32_t NetworkManagerImplementation::GetAvailableInterfaces (Exchange::INetworkManager::IInterfaceDetailsIterator*& interfacesItr/* @out */)
Expand Down
7 changes: 1 addition & 6 deletions Tests/unit_test/test_NetworkManagerConnectivity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,7 @@ class ConnectivityMonitorTest : public ::testing::Test {
TEST_F(ConnectivityMonitorTest, StartConnectivityMonitor_Success) {
bool result = cm.startConnectivityMonitor();
EXPECT_TRUE(result);
bool result = cm.startConnectivityMonitor();
EXPECT_TRUE(result);
}

TEST_F(ConnectivityMonitorTest, StartConnectivityMonitor_Success) {
bool result = cm.stopConnectivityMonitor();
result = cm.startConnectivityMonitor();
EXPECT_TRUE(result);
}

Expand Down

0 comments on commit 7c4ff7b

Please sign in to comment.