diff --git a/Network/CHANGELOG.md b/Network/CHANGELOG.md index 20a2c9dc54..ca30ef539b 100644 --- a/Network/CHANGELOG.md +++ b/Network/CHANGELOG.md @@ -20,6 +20,8 @@ All notable changes to this RDK Service will be documented in this file. ### Added - Added connectivity monitor in onInterfaceIPAddressChanged - Removed connectivity monitor from InterfaceConnectionStatusChanged +### Fixed +- Fixed the L1 test case failure ## [1.3.10] - 2024-04-17 ### Added diff --git a/Network/Network.cpp b/Network/Network.cpp index 47b8a28003..357586648e 100644 --- a/Network/Network.cpp +++ b/Network/Network.cpp @@ -1521,7 +1521,6 @@ typedef struct _IARM_BUS_NetSrvMgr_Iface_EventData_t { } connectivityMonitor.stopInitialConnectivityMonitoring(); } - connectivityMonitor.signalConnectivityMonitor(); } void Network::onDefaultInterfaceChanged(string oldInterface, string newInterface) diff --git a/Tests/L1Tests/tests/test_Network.cpp b/Tests/L1Tests/tests/test_Network.cpp index 1267fbcc7a..cb4cac1654 100755 --- a/Tests/L1Tests/tests/test_Network.cpp +++ b/Tests/L1Tests/tests/test_Network.cpp @@ -1303,42 +1303,27 @@ TEST_F(NetworkInitializedEventTest, onInterfaceStatusChanged) handler.Unsubscribe(0, _T("onInterfaceStatusChanged"), _T("org.rdk.Network"), message); } -#if 0 /* Disabling temporarily */ TEST_F(NetworkInitializedEventTest, onConnectionStatusChanged) { EXPECT_EQ(Core::ERROR_NONE, handler.Invoke(connection, _T("setConnectivityTestEndpoints"), _T("{\"endpoints\": [\"http://localhost:8000\"]}"), response)); EXPECT_EQ(response, string("{\"success\":true}")); - Core::Event onInternetStatusChange(false, true); EXPECT_CALL(service, Submit(::testing::_, ::testing::_)) - .Times(2) + .Times(1) .WillOnce(::testing::Invoke( [&](const uint32_t, const Core::ProxyType& json) { string text; EXPECT_TRUE(json->ToString(text)); EXPECT_EQ(text, string(_T("{\"jsonrpc\":\"2.0\",\"method\":\"org.rdk.Network.onConnectionStatusChanged\",\"params\":{\"interface\":\"ETHERNET\",\"status\":\"CONNECTED\"}}"))); return Core::ERROR_NONE; - })) - .WillOnce(::testing::Invoke( - [&](const uint32_t, const Core::ProxyType& json) { - string text; - EXPECT_TRUE(json->ToString(text)); - EXPECT_EQ(text, string(_T("{\"jsonrpc\":\"2.0\",\"method\":\"org.rdk.Network.onInternetStatusChange\",\"params\":{\"state\":0,\"status\":\"NO_INTERNET\"}}"))); - onInternetStatusChange.SetEvent(); - return Core::ERROR_NONE; - })); + })); IARM_BUS_NetSrvMgr_Iface_EventInterfaceConnectionStatus_t intData; intData.status = 1; strcpy(intData.interface,"eth0"); handler.Subscribe(0, _T("onConnectionStatusChanged"), _T("org.rdk.Network"), message); - handler.Subscribe(0, _T("onInternetStatusChange"), _T("org.rdk.Network"), message); plugin->eventHandler("NET_SRV_MGR", IARM_BUS_NETWORK_MANAGER_EVENT_INTERFACE_CONNECTION_STATUS, static_cast(&intData), sizeof(intData)); handler.Unsubscribe(0, _T("onConnectionStatusChanged"), _T("org.rdk.Network"), message); - EXPECT_EQ(Core::ERROR_NONE, onInternetStatusChange.Lock()); - handler.Unsubscribe(0, _T("onInternetStatusChange"), _T("org.rdk.Network"), message); - EXPECT_NE(Core::ERROR_GENERAL, handler.Invoke(connection, _T("stopConnectivityMonitoring"), _T("{}"), response)); - EXPECT_EQ(response, string("{\"success\":true}")); } TEST_F(NetworkInitializedEventTest, onIPAddressStatusChanged) @@ -1360,8 +1345,9 @@ TEST_F(NetworkInitializedEventTest, onIPAddressStatusChanged) handler.Subscribe(0, _T("onIPAddressStatusChanged"), _T("org.rdk.Network"), message); plugin->eventHandler("NET_SRV_MGR", IARM_BUS_NETWORK_MANAGER_EVENT_INTERFACE_IPADDRESS, static_cast(&intData), sizeof(intData)); handler.Unsubscribe(0, _T("onIPAddressStatusChanged"), _T("org.rdk.Network"), message); + EXPECT_NE(Core::ERROR_GENERAL, handler.Invoke(connection, _T("stopConnectivityMonitoring"), _T("{}"), response)); + EXPECT_EQ(response, string("{\"success\":true}")); } -#endif TEST_F(NetworkInitializedEventTest, onDefaultInterfaceChanged) {