Skip to content
Merged

Sync #15

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/gdbus_proxy_L1_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jobs:
if: steps.cache.outputs.cache-hit != 'true'
run: |
cd ${{github.workspace}}/Thunder
git apply ${{github.workspace}}/networkmanager/tests/patches/thunder/Remove-SmartLinkType.patch
git apply ${{github.workspace}}/networkmanager/tests/patches/thunder/SubscribeStub.patch

- name: Build ThunderTools
if: steps.cache.outputs.cache-hit != 'true'
Expand Down
171 changes: 171 additions & 0 deletions .github/workflows/legacy_L1_L2_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
name: legacy_l1_l2_tests

on:
push:
branches: [ main, develop, 'support/**', 'hotfix/**', 'topic/**']
pull_request:
branches: [ main, develop, 'support/**', 'hotfix/**', 'topic/**']

env:
THUNDER_REF: "R4.4.3"

jobs:
L1-tests:
permissions:
contents: read
pull-requests: write
name: Build and run unit tests
runs-on: ubuntu-22.04

steps:
# Set up Thunder cache
- name: Set up Thunder cache
id: cache
uses: actions/cache@v3
with:
path: |
!build/Thunder
build/ThunderInterfaces
build/ThunderTools
install
!install/etc/WPEFramework/plugins
!install/usr/bin/rdkproxy_l1_test
!install/usr/include/gmock
!install/usr/include/gtest
!install/usr/lib/libgmockd.a
!install/usr/lib/libgmock_maind.a
!install/usr/lib/libgtestd.a
!install/usr/lib/libgtest_maind.a
!install/usr/lib/cmake/GTest
!install/usr/lib/pkgconfig/gmock.pc
!install/usr/lib/pkgconfig/gmock_main.pc
!install/usr/lib/pkgconfig/gtest.pc
!install/usr/lib/pkgconfig/gtest_main.pc
!install/usr/lib/wpeframework/plugins
key: thunder-${{ env.THUNDER_REF }}-rdk
- name: Install packages
run: |
sudo apt update
sudo apt-get install -y pkg-config libglib2.0-dev libnm-dev libcurl4-openssl-dev lcov ninja-build libgupnp-1.2-1 libgupnp-1.2-dev libgssdp-1.2-0 libsoup2.4-1

- name: Configure Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- run: pip install jsonref

- name: Configure CMake
uses: jwlawson/actions-setup-cmake@v1.13
with:
cmake-version: '3.16.x'
- name: Checkout thunder repositories
if: steps.cache.outputs.cache-hit != 'true'
run: |
git clone https://github.com/rdkcentral/ThunderTools ThunderTools --branch ${{ env.THUNDER_REF }}
git clone https://github.com/rdkcentral/Thunder Thunder --branch ${{ env.THUNDER_REF }}
git clone https://github.com/rdkcentral/ThunderInterfaces ThunderInterfaces --branch ${{ env.THUNDER_REF }}

- name: Checkout networkmanager
uses: actions/checkout@v3
with:
path: networkmanager

- name: Apply Thunder Patches
if: steps.cache.outputs.cache-hit != 'true'
run: |
cd ${{github.workspace}}/Thunder
git apply ${{github.workspace}}/networkmanager/tests/patches/thunder/SubscribeStub.patch

- name: Build ThunderTools
if: steps.cache.outputs.cache-hit != 'true'
run: >
cmake
-S "${{github.workspace}}/ThunderTools" -B build/ThunderTools
-DCMAKE_INSTALL_PREFIX="${{github.workspace}}/install/usr"
-DCMAKE_MODULE_PATH="${{github.workspace}}/install/tools/cmake"
-DGENERIC_CMAKE_MODULE_PATH="${{github.workspace}}/install/tools/cmake"
&&
cmake --build build/ThunderTools --target install -j8

- name: Build Thunder
if: steps.cache.outputs.cache-hit != 'true'
run: >
cmake
-S "${{github.workspace}}/Thunder" -B build/Thunder
-DCMAKE_INSTALL_PREFIX="${{github.workspace}}/install/usr"
-DCMAKE_MODULE_PATH="${{github.workspace}}/install/tools/cmake"
-DBUILD_TYPE=Debug
-DBINDING=127.0.0.1
-DPORT=9998
&&
cmake --build build/Thunder --target install -j8

- name: ThunderInterfaces
if: steps.cache.outputs.cache-hit != 'true'
run: >
cmake
-S "${{github.workspace}}/ThunderInterfaces" -B build/ThunderInterfaces
-DCMAKE_INSTALL_PREFIX="${{github.workspace}}/install/usr"
-DCMAKE_MODULE_PATH="${{github.workspace}}/install/tools/cmake"
&&
cmake --build build/ThunderInterfaces --target install -j8

- name: Generate IARM headers
run: |
touch install/usr/lib/libIARMBus.so
mkdir -p install/usr/include/rdk/iarmbus
touch install/usr/include/rdk/iarmbus/libIARM.h
cd "${{github.workspace}}/networkmanager/tests/"
mkdir -p headers/rdk/iarmbus
cd headers
touch rdk/iarmbus/libIARM.h rdk/iarmbus/libIBus.h

- name: Build networkmanager with RDK Proxy
run: >
cmake
-S "${{github.workspace}}/networkmanager"
-B build/networkmanager_rdk
-DCMAKE_TOOLCHAIN_FILE="${{ env.TOOLCHAIN_FILE }}"
-DCMAKE_INSTALL_PREFIX="${{github.workspace}}/install/usr"
-DCMAKE_MODULE_PATH="${{github.workspace}}/install/tools/cmake"
-DCMAKE_CXX_FLAGS="
-I ${{github.workspace}}/networkmanager/tests/headers
-I ${{github.workspace}}/networkmanager/tests/headers/rdk/iarmbus
--include ${{github.workspace}}/networkmanager/tests/mocks/Iarm.h
--include ${{github.workspace}}/networkmanager/tests/mocks/secure_wrappermock.h
-Wall --coverage
"
-DENABLE_UNIT_TESTING=ON
-DENABLE_ROUTER_DISCOVERY_TOOL=ON
&&
cmake --build build/networkmanager_rdk --target install -j8

- name: Run unit tests for Legacy_Network
run: >
PATH=${{github.workspace}}/install/usr/bin:${PATH}
LD_LIBRARY_PATH=${{github.workspace}}/install/usr/lib:${{github.workspace}}/install/usr/lib/wpeframework/plugins:${LD_LIBRARY_PATH}
legacynetwork_tests

- name: Run unit tests for Legacy_WiFi
run: >
PATH=${{github.workspace}}/install/usr/bin:${PATH}
LD_LIBRARY_PATH=${{github.workspace}}/install/usr/lib:${{github.workspace}}/install/usr/lib/wpeframework/plugins:${LD_LIBRARY_PATH}
legacywifi_tests

- name: Generate coverage
run: |
lcov -c -o coverage.info -d build/networkmanager_rdk
lcov -r coverage.info '/usr/include/*' '*/build/networkmanager_rdk/*' \
'*/install/usr/include/*' '*/tests/*' 'googlemock/*' 'googletest/*' \
-o filtered_coverage.info
- name: Generate the html report
run: |
genhtml filtered_coverage.info --output-directory /tmp/coverage_report

- name: Upload the coverage report to Pull request using actions
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: |
/tmp/coverage_report
/tmp/gtest_log
2 changes: 1 addition & 1 deletion .github/workflows/libnm_proxy_L1_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jobs:
if: steps.cache.outputs.cache-hit != 'true'
run: |
cd ${{github.workspace}}/Thunder
git apply ${{github.workspace}}/networkmanager/tests/patches/thunder/Remove-SmartLinkType.patch
git apply ${{github.workspace}}/networkmanager/tests/patches/thunder/SubscribeStub.patch

- name: Build ThunderTools
if: steps.cache.outputs.cache-hit != 'true'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rdk_proxy_L1_L2_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jobs:
if: steps.cache.outputs.cache-hit != 'true'
run: |
cd ${{github.workspace}}/Thunder
git apply ${{github.workspace}}/networkmanager/tests/patches/thunder/Remove-SmartLinkType.patch
git apply ${{github.workspace}}/networkmanager/tests/patches/thunder/SubscribeStub.patch

- name: Build ThunderTools
if: steps.cache.outputs.cache-hit != 'true'
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ All notable changes to this RDK Service will be documented in this file.

* Changes in CHANGELOG should be updated when commits are added to the main or release branches. There should be one CHANGELOG entry per JIRA Ticket. This is not enforced on sprint branches since there could be multiple changes for the same JIRA ticket during development.

## [0.23.0] - 2025-07-30
### Added
- Added L1/L2 workflow for LegacyNetwork, LegacyWiFi and NetworkManager Plugins
- Fixed RemoveKnownSSID method to handle the invalid inputs
- Fixed the logging in GetIPSettings

## [0.22.0] - 2025-07-14
### Fixed
- Fixed trigger point for the connectivity monitoring
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ find_package(WPEFramework)

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
set(VERSION_MAJOR 0)
set(VERSION_MINOR 22)
set(VERSION_MINOR 23)
set(VERSION_PATCH 0)

add_compile_definitions(NETWORKMANAGER_MAJOR_VERSION=${VERSION_MAJOR})
Expand Down
2 changes: 1 addition & 1 deletion definition/NetworkManager.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"status": "development",
"description": "A Unified `NetworkManager` plugin that allows you to manage Ethernet and Wifi interfaces on the device.",
"sourcelocation": "https://github.com/rdkcentral/networkmanager/blob/main/definition/NetworkManager.json",
"version": "0.22.0"
"version": "0.23.0"
},
"definitions": {
"success": {
Expand Down
4 changes: 2 additions & 2 deletions docs/NetworkManagerPlugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<a name="head.NetworkManager_Plugin"></a>
# NetworkManager Plugin

**Version: 0.22.0**
**Version: 0.23.0**

**Status: :white_circle::white_circle::white_circle:**

Expand All @@ -23,7 +23,7 @@ org.rdk.NetworkManager interface for Thunder framework.
<a name="head.Scope"></a>
## Scope

This document describes purpose and functionality of the org.rdk.NetworkManager interface (version 0.22.0). It includes detailed specification about its methods provided and notifications sent.
This document describes purpose and functionality of the org.rdk.NetworkManager interface (version 0.23.0). It includes detailed specification about its methods provided and notifications sent.

<a name="head.Case_Sensitivity"></a>
## Case Sensitivity
Expand Down
2 changes: 1 addition & 1 deletion legacy/LegacyWiFiManagerAPIs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ namespace WPEFramework
uint32_t WiFiManager::getSupportedSecurityModes(const JsonObject& parameters, JsonObject& response)
{
LOG_INPARAM();
uint32_t rc = Core::ERROR_GENERAL;
uint32_t rc = Core::ERROR_NONE;
JsonObject security_modes;
security_modes["NET_WIFI_SECURITY_NONE"] = (int)NET_WIFI_SECURITY_NONE;
security_modes["NET_WIFI_SECURITY_WEP_64"] = (int)NET_WIFI_SECURITY_WEP_64;
Expand Down
58 changes: 57 additions & 1 deletion tests/l2Test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
message ("building l2 test")

set(NM_RDK_PROXY_L2_TEST "rdkproxy_l2_test")
set(NM_LEGACY_WIFI_UT "legacywifi_tests")
set(NM_LEGACY_NETWORK_UT "legacynetwork_tests")

find_package(CURL)
find_package(PkgConfig REQUIRED)
Expand Down Expand Up @@ -50,24 +52,62 @@ add_executable(${NM_RDK_PROXY_L2_TEST}
${PROXY_STUB_SOURCES}
)

add_executable(${NM_LEGACY_WIFI_UT}
${CMAKE_SOURCE_DIR}/tests/l2Test/l2_test_LegacyPlugin_WiFiManagerAPIs.cpp
${CMAKE_SOURCE_DIR}/tests/mocks/thunder/Module.cpp
${CMAKE_SOURCE_DIR}/plugin/NetworkManagerLogger.cpp
${CMAKE_SOURCE_DIR}/legacy/LegacyWiFiManagerAPIs.cpp
)

add_executable(${NM_LEGACY_NETWORK_UT}
${CMAKE_SOURCE_DIR}/tests/l2Test/l2_test_LegacyPlugin_NetworkAPIs.cpp
${CMAKE_SOURCE_DIR}/tests/mocks/thunder/Module.cpp
${CMAKE_SOURCE_DIR}/plugin/NetworkManagerLogger.cpp
${CMAKE_SOURCE_DIR}/legacy/LegacyNetworkAPIs.cpp
)

set_target_properties(${NM_RDK_PROXY_L2_TEST} PROPERTIES
CXX_STANDARD 11
CXX_STANDARD_REQUIRED YES
)

set_target_properties(${NM_LEGACY_WIFI_UT} PROPERTIES
CXX_STANDARD 11
CXX_STANDARD_REQUIRED YES
)
set_target_properties(${NM_LEGACY_NETWORK_UT} PROPERTIES
CXX_STANDARD 11
CXX_STANDARD_REQUIRED YES
)

target_compile_options(${NM_RDK_PROXY_L2_TEST} PRIVATE -Wall -include ${CMAKE_SOURCE_DIR}/interface/INetworkManager.h)
target_compile_options(${NM_LEGACY_WIFI_UT} PRIVATE -Wall -include ${CMAKE_SOURCE_DIR}/interface/INetworkManager.h)
target_compile_options(${NM_LEGACY_NETWORK_UT} PRIVATE -Wall -include ${CMAKE_SOURCE_DIR}/interface/INetworkManager.h)

include_directories(${PROJECT_SOURCE_DIR}/interface)
include_directories(${PROJECT_SOURCE_DIR}/plugin/rdk)
include_directories(${PROJECT_SOURCE_DIR}/plugin)
include_directories(${PROJECT_SOURCE_DIR}/legacy)
include_directories(${PROJECT_SOURCE_DIR}/tests/mocks)
include_directories(${PROJECT_SOURCE_DIR}/tests/mocks/thunder)
include_directories(${PROJECT_SOURCE_DIR}/../install/usr/include/rdk/iarmbus/)
include_directories(${PROJECT_SOURCE_DIR}/tools/upnp/)

target_include_directories(${NM_RDK_PROXY_L2_TEST} PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
${gtest_SOURCE_DIR}/include
${gtest_SOURCE_DIR}/include
${gtest_SOURCE_DIR}/../googlemock/include
)

target_include_directories(${NM_LEGACY_WIFI_UT} PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
${gtest_SOURCE_DIR}/include
${gtest_SOURCE_DIR}/../googlemock/include
)

target_include_directories(${NM_LEGACY_NETWORK_UT} PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
${gtest_SOURCE_DIR}/include
${gtest_SOURCE_DIR}/../googlemock/include
)

Expand All @@ -81,5 +121,21 @@ target_link_libraries(${NM_RDK_PROXY_L2_TEST} PRIVATE
${NAMESPACE}Plugins::${NAMESPACE}Plugins
${CURL_LIBRARIES}
)
target_link_libraries(${NM_LEGACY_WIFI_UT} PRIVATE
gmock_main
${NAMESPACE}Core::${NAMESPACE}Core
${NAMESPACE}Plugins::${NAMESPACE}Plugins
${NAMESPACE}Core::${NAMESPACE}Core
${CURL_LIBRARIES}
)
target_link_libraries(${NM_LEGACY_NETWORK_UT} PRIVATE
gmock_main
${NAMESPACE}Core::${NAMESPACE}Core
${NAMESPACE}Plugins::${NAMESPACE}Plugins
${NAMESPACE}Core::${NAMESPACE}Core
${CURL_LIBRARIES}
)

install(TARGETS ${NM_RDK_PROXY_L2_TEST} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
install(TARGETS ${NM_LEGACY_WIFI_UT} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
install(TARGETS ${NM_LEGACY_NETWORK_UT} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
Loading
Loading