Skip to content
Open

Sync #21

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
5 changes: 5 additions & 0 deletions .github/workflows/gdbus_proxy_L1_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ jobs:
&&
cmake --build build/ThunderInterfaces --target install -j8

- name: Install IPowerManager header
run: |
IFACE_DIR=$(find ${{github.workspace}}/install/usr/include -maxdepth 2 -name "interfaces" -type d | head -1)
cp ${{github.workspace}}/networkmanager/tests/mocks/thunder/IPowerManager.h "$IFACE_DIR/"

- name: Build networkmanager with Gnome GDBUS Proxy
run: >
cmake
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/legacy_L1_L2_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,11 @@ jobs:
&&
cmake --build build/ThunderInterfaces --target install -j8

- name: Install IPowerManager header
run: |
IFACE_DIR=$(find ${{github.workspace}}/install/usr/include -maxdepth 2 -name "interfaces" -type d | head -1)
cp ${{github.workspace}}/networkmanager/tests/mocks/thunder/IPowerManager.h "$IFACE_DIR/"

- name: Generate IARM headers
run: |
touch install/usr/lib/libIARMBus.so
Expand Down
12 changes: 9 additions & 3 deletions .github/workflows/libnm_proxy_L1_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ env:
jobs:
L1-tests:
name: Build and run unit tests
runs-on: ubuntu-22.04
# Note: Ubuntu 24.04 is required for libnm 1.46 which is needed for NetworkManagerPowerClient support
runs-on: ubuntu-24.04

steps:
# Set up Thunder cache
Expand Down Expand Up @@ -107,11 +108,16 @@ jobs:
&&
cmake --build build/ThunderInterfaces --target install -j8

- name: Install IPowerManager header
run: |
IFACE_DIR=$(find ${{github.workspace}}/install/usr/include -maxdepth 2 -name "interfaces" -type d | head -1)
cp ${{github.workspace}}/networkmanager/tests/mocks/thunder/IPowerManager.h "$IFACE_DIR/"

- name: Generate dependency files
run: |
sudo bash -c 'echo "ETHERNET_INTERFACE=eth0
WIFI_INTERFACE=wlan0
DEVICE_NAME=rdk_test_device " > /etc/device.properties'
DEFAULT_HOSTNAME=rdk_test_device " > /etc/device.properties'

- name: Generate IARM headers
run: |
Expand Down Expand Up @@ -160,7 +166,7 @@ jobs:

- name: Generate coverage
run: |
lcov -c -o coverage.info -d build/networkmanager_libnm/
lcov --rc geninfo_unexecuted_blocks=1 -c -o coverage.info -d build/networkmanager_libnm/ --ignore-errors mismatch
lcov -e coverage.info '*/networkmanager/plugin/gnome/*' -o filtered_coverage.info

- name: Generate the html report
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/native_full_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Build Component in Native Environment

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

permissions:
contents: read

jobs:
build-networkmanager:
name: Build networkmanager component in github rdkcentral
# Ubuntu 24.04 provides libnm 1.46, closer to the version used in RDK(1.43.7).
runs-on: ubuntu-24.04

steps:

- name: Checkout code
uses: actions/checkout@v3

- name: native build
run: |
sh -x build_dependencies.sh
sh -x cov_build.sh
5 changes: 5 additions & 0 deletions .github/workflows/rdk_proxy_L1_L2_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ jobs:
&&
cmake --build build/ThunderInterfaces --target install -j8

- name: Install IPowerManager header
run: |
IFACE_DIR=$(find ${{github.workspace}}/install/usr/include -maxdepth 2 -name "interfaces" -type d | head -1)
cp ${{github.workspace}}/networkmanager/tests/mocks/thunder/IPowerManager.h "$IFACE_DIR/"

- name: Generate IARM headers
run: |
touch install/usr/lib/libIARMBus.so
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/validate_pr_desc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
PR_TITLE: ${{ github.event.pull_request.title }}
run: |
# Define valid ticket IDs
VALID_TICKET_IDS=("RDKEMW")
VALID_TICKET_IDS=("RDKEMW" "RDK")

# Function to validate ticket format and ID
validate_ticket() {
Expand Down
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,32 @@ 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.

## [3.4.0] - 2026-07-17
### Fixed
- Fixed the logging failure within the inprogress plugins
- Added mutex before accessing the scan filters
- Added t2 event for IPv6 Public IP
- Added thread to publish the events without blocking the caller notification thread

## [3.3.0] - 2026-06-12
### Fixed
- Fixed the memory leak that caused by the persistent m_nmClient and m_nmContext.

## [3.2.0] - 2026-06-09
### Added
- Implemented IP Caching logic to avoid multiple hard fetches from Gnome & invalidating the cache on change.

## [3.1.0] - 2026-06-08
### Changed
- Handled Power State changes within NetworkManager as below,
- Transition to DeepSleep will disconnect when NSM is OFF
- Transition from DeepSleep will Renew IP when NSM is ON

## [3.0.0] - 2026-05-28
### Changed
- The device hostname header that used to retrive has changed as "DEFAULT_HOSTNAME"
- Updated the WiFiStartScan to scan for specific SSID and also updated to take array of freq band as input instead of single freq

## [2.3.0] - 2026-05-21
### Fixed
- Fixed the issue which leads Enabling and Disabling of interfaces are taking longer
Expand Down
19 changes: 17 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ if (NOT WPEFramework_FOUND AND NOT Thunder_FOUND)
endif()

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
set(VERSION_MAJOR 2)
set(VERSION_MINOR 3)
set(VERSION_MAJOR 3)
set(VERSION_MINOR 4)
set(VERSION_PATCH 0)

add_compile_definitions(NETWORKMANAGER_MAJOR_VERSION=${VERSION_MAJOR})
Expand All @@ -55,6 +55,21 @@ option(ENABLE_LEGACY_PLUGINS "Enable Legacy Plugins" ON)
option(USE_RDK_LOGGER "Enable RDK Logger for logging" OFF )
option(ENABLE_UNIT_TESTING "Enable unit tests" OFF)
option(USE_TELEMETRY "Enable Telemetry T2 support" OFF)
option(ENABLE_ETHERNET_CONNECTION_HANDLING
"Enable pre-sleep Ethernet deactivation" OFF)

if(ENABLE_ETHERNET_CONNECTION_HANDLING)
add_definitions(-DENABLE_ETHERNET_CONNECTION_HANDLING)
message(STATUS "Ethernet connection handling: enabled")
endif()

# Backend identity macros are consumed by shared headers; define them globally
# so all targets (plugin, tests, tools) compile against the same API surface.
if(ENABLE_GNOME_NETWORKMANAGER AND ENABLE_GNOME_GDBUS)
add_compile_definitions(NM_BACKEND_GDBUS=1)
elseif(NOT ENABLE_GNOME_NETWORKMANAGER)
add_compile_definitions(NM_BACKEND_RDK=1)
endif()

if (USE_TELEMETRY)
find_package(T2 REQUIRED)
Expand Down
193 changes: 193 additions & 0 deletions build_dependencies.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,193 @@
#!/usr/bin/env bash
#
# build_dependencies.sh - Install system packages and build the Thunder
# ecosystem (ThunderTools, Thunder, ThunderInterfaces) plus the mock
# dependency files required to build networkmanager for Coverity.
#
# This is the first half of the old cov_build.sh: everything that prepares
# the environment. The component itself is built by cov_build.sh, which is
# run afterwards from the same workspace.
#
# Usage:
# ./build_dependencies.sh
#
# Override any of the environment variables below on the command line, e.g.:
# THUNDER_REF=R4.4.3 ./build_dependencies.sh
#

# Re-exec under bash if started with a non-bash shell (e.g. `sh build_dependencies.sh`,
# where sh is dash). This script relies on bash features such as `pipefail`
# and ${BASH_SOURCE[0]}, which dash does not support.
if [ -z "${BASH_VERSION:-}" ]; then
exec bash "$0" "$@"
fi

set -euo pipefail

# ---------------------------------------------------------------------------
# Configuration (mirrors the workflow `env:` block)
# ---------------------------------------------------------------------------
BUILD_TYPE="${BUILD_TYPE:-Debug}"
THUNDER_REF="${THUNDER_REF:-R4.4.3}"
THUNDERTOOLS_REF="${THUNDERTOOLS_REF:-${THUNDER_REF}}"
INTERFACES_REF="${INTERFACES_REF:-${THUNDER_REF}}"

# Root workspace directory. In CI this is ${{ github.workspace }}.
# The Thunder repositories and install tree live inside the networkmanager
# checkout so the layout is self-contained and shared with cov_build.sh.
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
WORKSPACE="${WORKSPACE:-${SCRIPT_DIR}}"
NETWORKMANAGER_DIR="${NETWORKMANAGER_DIR:-${SCRIPT_DIR}}"
INSTALL_DIR="${WORKSPACE}/install/usr"
MODULE_PATH="${WORKSPACE}/install/tools/cmake"

NPROC="$(getconf _NPROCESSORS_ONLN 2>/dev/null || echo 4)"

log() { printf '\n\033[1;34m==> %s\033[0m\n' "$*"; }

# Use sudo only when it exists (CI build containers usually run as root and
# do not ship sudo). Otherwise run the command directly.
if command -v sudo >/dev/null 2>&1; then
SUDO="sudo"
else
SUDO=""
fi

# ---------------------------------------------------------------------------
# Install system packages
# ---------------------------------------------------------------------------
log "Installing system packages"
${SUDO} apt-get update
${SUDO} apt-get install -y \
build-essential \
cmake \
pkg-config \
libglib2.0-dev \
libnm-dev \
libcurl4-openssl-dev \
lcov \
ninja-build

# ---------------------------------------------------------------------------
# Install Python dependencies
# ---------------------------------------------------------------------------
log "Installing Python dependencies"
if command -v pip >/dev/null 2>&1; then
pip install --break-system-packages jsonref || pip install jsonref || true
elif command -v pip3 >/dev/null 2>&1; then
pip3 install --break-system-packages jsonref || pip3 install jsonref || true
else
echo "pip not found; skipping jsonref install"
fi

# ---------------------------------------------------------------------------
# Clone Thunder repositories
# ---------------------------------------------------------------------------
clone_repo() {
# clone_repo <url> <path> <ref>
local url="$1" path="$2" ref="$3"
if [ ! -d "${path}/.git" ]; then
log "Cloning ${url} (${ref}) into ${path}"
git clone --branch "${ref}" "${url}" "${path}"
else
log "Repository ${path} already present; fetching ${ref}"
git -C "${path}" fetch origin "${ref}"
git -C "${path}" checkout "${ref}"
fi
}

clone_repo "https://github.com/rdkcentral/ThunderTools" \
"${WORKSPACE}/ThunderTools" "${THUNDERTOOLS_REF}"
clone_repo "https://github.com/rdkcentral/Thunder" \
"${WORKSPACE}/Thunder" "${THUNDER_REF}"
clone_repo "https://github.com/rdkcentral/ThunderInterfaces" \
"${WORKSPACE}/ThunderInterfaces" "${INTERFACES_REF}"

# ---------------------------------------------------------------------------
# Apply Thunder SubscribeStub patch
# ---------------------------------------------------------------------------
log "Applying Thunder SubscribeStub patch"
(
cd "${WORKSPACE}/Thunder"
git apply "${NETWORKMANAGER_DIR}/tests/patches/thunder/SubscribeStub.patch" 2>/dev/null \
|| echo "Patch already applied or not needed"
)

# ---------------------------------------------------------------------------
# Build ThunderTools
# ---------------------------------------------------------------------------
log "Building ThunderTools"
cmake \
-S "${WORKSPACE}/ThunderTools" \
-B "${WORKSPACE}/build/ThunderTools" \
-DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \
-DCMAKE_MODULE_PATH="${MODULE_PATH}" \
-DGENERIC_CMAKE_MODULE_PATH="${MODULE_PATH}"
cmake --build "${WORKSPACE}/build/ThunderTools" --target install -j"${NPROC}"

# ---------------------------------------------------------------------------
# Build Thunder
# ---------------------------------------------------------------------------
log "Building Thunder"
cmake \
-S "${WORKSPACE}/Thunder" \
-B "${WORKSPACE}/build/Thunder" \
-DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \
-DCMAKE_MODULE_PATH="${MODULE_PATH}" \
-DBUILD_TYPE="${BUILD_TYPE}" \
-DBINDING=127.0.0.1 \
-DPORT=9998
cmake --build "${WORKSPACE}/build/Thunder" --target install -j"${NPROC}"

# ---------------------------------------------------------------------------
# Build ThunderInterfaces
# ---------------------------------------------------------------------------
log "Building ThunderInterfaces"
cmake \
-S "${WORKSPACE}/ThunderInterfaces" \
-B "${WORKSPACE}/build/ThunderInterfaces" \
-DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \
-DCMAKE_MODULE_PATH="${MODULE_PATH}"
cmake --build "${WORKSPACE}/build/ThunderInterfaces" --target install -j"${NPROC}"

# ---------------------------------------------------------------------------
# Install IPowerManager header into the Thunder interfaces include path
# ---------------------------------------------------------------------------
log "Installing IPowerManager header"
IFACE_DIR="$(find "${INSTALL_DIR}/include" -maxdepth 2 -name "interfaces" -type d | head -1)"
if [ -z "${IFACE_DIR}" ] || [ ! -d "${IFACE_DIR}" ]; then
echo "Error: Thunder interfaces include dir not found under ${INSTALL_DIR}/include" >&2
exit 1
fi
cp "${NETWORKMANAGER_DIR}/tests/mocks/thunder/IPowerManager.h" "${IFACE_DIR}/"

# ---------------------------------------------------------------------------
# Generate dependency files
# ---------------------------------------------------------------------------
log "Generating /etc/device.properties"
${SUDO} tee /etc/device.properties >/dev/null <<'EOF'
ETHERNET_INTERFACE=eth0
WIFI_INTERFACE=wlan0
DEFAULT_HOSTNAME=rdk_test_device
EOF

# ---------------------------------------------------------------------------
# Generate IARM headers/stubs
# ---------------------------------------------------------------------------
log "Generating IARM headers"
mkdir -p "${INSTALL_DIR}/lib"
printf 'void __nm_cov_stub(void){}\n' | ${CC:-cc} -fPIC -shared -x c - -o "${INSTALL_DIR}/lib/libIARMBus.so"
printf 'void __nm_cov_stub(void){}\n' | ${CC:-cc} -fPIC -shared -x c - -o "${INSTALL_DIR}/lib/libmfrlib.so"
mkdir -p "${INSTALL_DIR}/include/rdk/iarmbus"
mkdir -p "${INSTALL_DIR}/include/rdk/iarmmgrs-hal"
touch "${INSTALL_DIR}/include/rdk/iarmbus/libIARM.h"
touch "${INSTALL_DIR}/include/rdk/iarmmgrs-hal/mfrMgr.h"
(
cd "${NETWORKMANAGER_DIR}/tests"
mkdir -p headers/rdk/iarmbus
mkdir -p headers/rdk/iarmmgrs-hal
touch headers/rdk/iarmmgrs-hal/mfrMgr.h
touch headers/rdk/iarmbus/libIARM.h headers/rdk/iarmbus/libIBus.h
)

log "Dependencies ready. Run cov_build.sh to build networkmanager."
Loading
Loading