From 34016952765b5817e9ff4e082c96f750d3f2fdd7 Mon Sep 17 00:00:00 2001 From: Nithishkumar-T <109725053+Nithishkumar-T@users.noreply.github.com> Date: Tue, 15 Jul 2025 15:09:47 +0530 Subject: [PATCH 1/8] Update run_ut.sh Updating run_ut.sh to be more generic --- source/test/run_ut.sh | 105 +++++++++++++++++++++++++----------------- 1 file changed, 63 insertions(+), 42 deletions(-) diff --git a/source/test/run_ut.sh b/source/test/run_ut.sh index 4ea4088..06858ff 100755 --- a/source/test/run_ut.sh +++ b/source/test/run_ut.sh @@ -27,41 +27,39 @@ log() { echo " " } -# Initialize branch variable with an if-else statement -branch=${BRANCH:-stable2} -log "INFO" "Using branch: $branch" - -# Check if RdkbGMock directory already exists +# Clone or enter RdkbGMock if [ -d "RdkbGMock" ]; then log "INFO" "RdkbGMock directory already exists. Skipping clone." cd RdkbGMock else - log "INFO" "RdkbGMock directory does not exist. Cloning repository..." - if git clone ssh://gerrit.teamccp.com:29418/rdk/rdkb/components/opensource/ccsp/RdkbGMock/generic RdkbGMock -b "$branch"; then - log "INFO" "Entering into RdkbGMock directory..." + log "INFO" "Cloning RdkbGMock repository from GitHub..." + # Use token for authentication if provided + if git clone -b "develop" "https://github.com/rdkcentral/gmock-broadband.git" RdkbGMock; then cd RdkbGMock else - log "ERROR" "Failed to clone RdkbGMock repository." + log "ERROR" "Failed to clone repository with branch: develop" exit 1 fi fi -# Check if change number/revision is provided +# Check if a pull request ID is provided in argument 1 if [ -n "$1" ]; then - change_revision=$1 - change_number=$(echo $change_revision | cut -d'/' -f1) - revision=$(echo $change_revision | cut -d'/' -f2) - last_two_digits=${change_number: -2} - - log "INFO" "Fetching and cherry-picking changes..." - if git fetch ssh://gerrit.teamccp.com:29418/rdk/rdkb/components/opensource/ccsp/RdkbGMock/generic refs/changes/"$last_two_digits"/"$change_number"/"$revision" && git cherry-pick FETCH_HEAD; then - log "INFO" "Changes fetched and cherry-picked successfully." + pr_id="$1" + log "INFO" "Fetching PR ID: $pr_id and checking out FETCH_HEAD" + if git fetch "https://github.com/rdkcentral/gmock-broadband.git" pull/"$pr_id"/head && git checkout FETCH_HEAD; then + log "INFO" "Successfully checked out PR #$pr_id" else - log "ERROR" "Failed to fetch and cherry-pick changes." + log "ERROR" "Failed to fetch or checkout PR #$pr_id" exit 1 fi else - log "INFO" "No change number/revision provided, skipping git fetch and cherry-pick." + log "INFO" "No PR ID provided. Fetching latest from branch: develop" + if git fetch "https://github.com/rdkcentral/gmock-broadband.git" develop && git checkout develop; then + log "INFO" "Checked out latest branch: develop" + else + log "ERROR" "Failed to fetch or checkout branch: develop" + exit 1 + fi fi log "INFO" "Start Running RdkbGMock Dependency Component Script..." @@ -87,7 +85,7 @@ else fi # Run configure with specific options -log "INFO" "Running configure with options --enable-gtestapp and --enable-unitTestDockerSupport..." +log "INFO" "Running configure with options --enable-unitTestDockerSupport..." if ./configure --enable-unitTestDockerSupport; then log "INFO" "Configuration successful." else @@ -100,33 +98,56 @@ if [ ! -f "${PWD}/RdkbGMock/docker_scripts/export_var.sh" ]; then log "ERROR" "RdkbGMock/docker_scripts/export_var.sh does not exist in the directory $PWD." exit 1 else - # Source the export_var.sh script from the current working directory source "RdkbGMock/docker_scripts/export_var.sh" - - # Log the paths set by the sourced script log "INFO" "C_INCLUDE_PATH is set to: $C_INCLUDE_PATH" log "INFO" "CPLUS_INCLUDE_PATH is set to: $CPLUS_INCLUDE_PATH" fi -# Run make for specific target -log "INFO" "Running make for CcspDmcliTest_gtest.bin..." -if make -C source/test/CcspDmcliTest; then - log "INFO" "Make operation completed successfully." -else - log "ERROR" "Make operation failed." - exit 1 -fi -log "INFO" "Completed running UT script." - log "INFO" "Preparing to run the Gtest Binary" -if [ -f "./source/test/CcspDmcliTest/CcspDmcliTest_gtest.bin" ]; then - log "INFO" "Running CcspDmcliTest_gtest.bin" - ./source/test/CcspDmcliTest/CcspDmcliTest_gtest.bin - log "INFO" "Completed Test Execution" -else - log "ERROR" "CcspDmcliTest_gtest.bin does not exist, cannot run tests" - exit 1 -fi +# Generic function to build and run all gtest binaries under source/test and its subfolders +run_all_gtests() { + local test_dirs + local make_dir + local bin_files + local bin_file + + # Only include directories that contain a Makefile and do not contain makefile or GNUmakefile + test_dirs=( $(find source/test -type f -name 'Makefile' -exec dirname {} \; | sort -u) ) + + for make_dir in "${test_dirs[@]}"; do + log "INFO" "Running make in $make_dir..." + if make -C "$make_dir"; then + log "INFO" "Make operation completed successfully in $make_dir." + else + log "ERROR" "Make operation failed in $make_dir." + exit 1 + fi + done + + log "INFO" "Completed running all make operations." + + # Find all .bin files under source/test and its subfolders + bin_files=( $(find source/test -type f -name "*.bin") ) + + if [[ ${#bin_files[@]} -eq 0 ]]; then + log "ERROR" "No .bin files found under source/test, cannot run tests" + exit 1 + fi + + for bin_file in "${bin_files[@]}"; do + if [[ -x "$bin_file" ]]; then + log "INFO" "Running $(basename "$bin_file")" + "$bin_file" + log "INFO" "Completed Test Execution for $(basename "$bin_file")" + else + log "ERROR" "$(basename "$bin_file") is not executable, skipping" + fi + done +} + +# Call the generic function to build and run all gtest binaries +run_all_gtests +log "INFO" "Completed running all Gtest Binaries" log "INFO" "Starting Gcov for code coverage analysis" # Capture initial coverage data From de0a1de5e5cf791f331ea53469a9fe0fdb832d35 Mon Sep 17 00:00:00 2001 From: Nithishkumar-T <109725053+Nithishkumar-T@users.noreply.github.com> Date: Wed, 16 Jul 2025 14:20:16 +0530 Subject: [PATCH 2/8] Update run_ut.sh --- source/test/run_ut.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/source/test/run_ut.sh b/source/test/run_ut.sh index 06858ff..d2fa10b 100755 --- a/source/test/run_ut.sh +++ b/source/test/run_ut.sh @@ -147,7 +147,13 @@ run_all_gtests() { # Call the generic function to build and run all gtest binaries run_all_gtests -log "INFO" "Completed running all Gtest Binaries" + +# Check if coverage.info exists before filtering +if [ -f coverage.info ] || [ -d out ]; then + log "INFO" "Removing existing coverage.info and/or out directory" + [ -f coverage.info ] && rm -f coverage.info + [ -d out ] && rm -rf out +fi log "INFO" "Starting Gcov for code coverage analysis" # Capture initial coverage data From b6d59b82d728c2658b47384f47c96f94dc94c9d3 Mon Sep 17 00:00:00 2001 From: Stephen Barrett Date: Thu, 25 Sep 2025 10:12:42 +0100 Subject: [PATCH 3/8] Update CODEOWNERS --- .github/CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 0f5f593..d86b0d6 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -2,4 +2,4 @@ # the repo. Unless a later match takes precedence, # @global-owner1 and @global-owner2 will be requested for # review when someone opens a pull request. -* @rdkcentral/advsecurity-maintainers +* @rdkcentral/dbus-message-cli-maintainers From fb34465bbc4c6b282432fd0872af3053283e154b Mon Sep 17 00:00:00 2001 From: rdkcmf Date: Fri, 26 Sep 2025 16:04:58 +0100 Subject: [PATCH 4/8] Deploy cla action --- .github/workflows/cla.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cla.yml b/.github/workflows/cla.yml index 0550479..c58b1b0 100644 --- a/.github/workflows/cla.yml +++ b/.github/workflows/cla.yml @@ -1,13 +1,20 @@ name: "CLA" + +permissions: + contents: read + pull-requests: write + actions: write + statuses: write + on: issue_comment: types: [created] pull_request_target: - types: [opened,closed,synchronize] + types: [opened, closed, synchronize] jobs: CLA-Lite: name: "Signature" - uses: rdkcentral/cmf-actions/.github/workflows/cla.yml@main + uses: rdkcentral/cmf-actions/.github/workflows/cla.yml@v1 secrets: - PERSONAL_ACCESS_TOKEN: ${{ secrets.CLA_ASSISTANT }} \ No newline at end of file + PERSONAL_ACCESS_TOKEN: ${{ secrets.CLA_ASSISTANT }} From 3b3950a876167b392666d0a5a5c11a739ab72e4e Mon Sep 17 00:00:00 2001 From: rdkcmf Date: Mon, 29 Sep 2025 11:34:49 +0100 Subject: [PATCH 5/8] Deploy fossid_integration_stateless_diffscan_target_repo action --- ...d_integration_stateless_diffscan_target_repo.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/fossid_integration_stateless_diffscan_target_repo.yml b/.github/workflows/fossid_integration_stateless_diffscan_target_repo.yml index da02b8b..7b8c1cb 100644 --- a/.github/workflows/fossid_integration_stateless_diffscan_target_repo.yml +++ b/.github/workflows/fossid_integration_stateless_diffscan_target_repo.yml @@ -1,11 +1,18 @@ name: Fossid Stateless Diff Scan -on: pull_request +on: + pull_request: + types: [opened, synchronize, reopened] + +permissions: + contents: read + pull-requests: read jobs: call-fossid-workflow: - uses: rdkcentral/build_tools_workflows/.github/workflows/fossid_integration_stateless_diffscan.yml@develop - secrets: + if: ${{ ! github.event.pull_request.head.repo.fork }} + uses: rdkcentral/build_tools_workflows/.github/workflows/fossid_integration_stateless_diffscan.yml@1.0.0 + secrets: FOSSID_CONTAINER_USERNAME: ${{ secrets.FOSSID_CONTAINER_USERNAME }} FOSSID_CONTAINER_PASSWORD: ${{ secrets.FOSSID_CONTAINER_PASSWORD }} FOSSID_HOST_USERNAME: ${{ secrets.FOSSID_HOST_USERNAME }} From 63c9506ab99054b9d7c2abbe78ee16427cbfd007 Mon Sep 17 00:00:00 2001 From: Stephen Barrett Date: Wed, 8 Oct 2025 11:41:07 +0100 Subject: [PATCH 6/8] Update CODEOWNERS --- .github/CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index d86b0d6..620bf97 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -2,4 +2,4 @@ # the repo. Unless a later match takes precedence, # @global-owner1 and @global-owner2 will be requested for # review when someone opens a pull request. -* @rdkcentral/dbus-message-cli-maintainers +* @rdkcentral/dbus-message-cli-maintainers @rdkcentral/rdkb-maintainers From f62563b9443cdf6fc141233b1c8757d2de3e8f19 Mon Sep 17 00:00:00 2001 From: Rajkamal CV Date: Tue, 9 Dec 2025 14:35:25 +0530 Subject: [PATCH 7/8] RDKB-61922: RDK Coverity cleanup for dmcli Reason for change: Address Coverity issues in MsgBusTestServer executable Test Procedure: Run MsgBusTestServer and MsgBusTestClient and check for errors Risks: Low Priority: P1 --- source/MsgBusTestServer/cosa_MsgBusTest_dml.c | 3 ++- source/MsgBusTestServer/ssp_main.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/source/MsgBusTestServer/cosa_MsgBusTest_dml.c b/source/MsgBusTestServer/cosa_MsgBusTest_dml.c index 9917c92..a34079f 100644 --- a/source/MsgBusTestServer/cosa_MsgBusTest_dml.c +++ b/source/MsgBusTestServer/cosa_MsgBusTest_dml.c @@ -82,7 +82,8 @@ BOOL MsgBusTest_SetParamStringValue(ANSC_HANDLE hInsContext, char* ParamName, ch ERR_CHK(rc); if ((!ind) && (rc == EOK)) { - AnscCopyString(ParamString, strValue); + memset(ParamString, 0, sizeof(ParamString)); + strncpy(ParamString, strValue, (sizeof(ParamString) - 1)); return TRUE; } diff --git a/source/MsgBusTestServer/ssp_main.c b/source/MsgBusTestServer/ssp_main.c index c9742a6..a4c9a2e 100644 --- a/source/MsgBusTestServer/ssp_main.c +++ b/source/MsgBusTestServer/ssp_main.c @@ -201,7 +201,7 @@ int main(int argc, char* argv[]) { if ((strcmp(argv[idx], "-subsys") == 0)) { - AnscCopyString(g_Subsystem, argv[idx+1]); + strncpy(g_Subsystem, argv[idx+1], (sizeof(g_Subsystem) - 1)); } else if (strcmp(argv[idx], "-c") == 0) { From 28581a4e665a6425348f1bc104e577aff8865c83 Mon Sep 17 00:00:00 2001 From: SanthoshGujulvajagadeesh Date: Wed, 7 Jan 2026 12:55:49 +0530 Subject: [PATCH 8/8] Add changelog for release 2.0.0 --- CHANGELOG.md | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 653da50..2437450 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,10 +4,22 @@ All notable changes to this project will be documented in this file. Dates are d Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). +#### [2.0.0](https://github.com/rdkcentral/data-model-cli/compare/1.0.0...2.0.0) + +- RDKB-61922: RDK Coverity cleanup for dmcli [`#11`](https://github.com/rdkcentral/data-model-cli/pull/11) +- Update CODEOWNERS [`#9`](https://github.com/rdkcentral/data-model-cli/pull/9) +- Deploy fossid_integration_stateless_diffscan_target_repo action [`#8`](https://github.com/rdkcentral/data-model-cli/pull/8) +- Deploy cla action [`#7`](https://github.com/rdkcentral/data-model-cli/pull/7) +- Update CODEOWNERS [`#6`](https://github.com/rdkcentral/data-model-cli/pull/6) +- Update run_ut.sh [`#3`](https://github.com/rdkcentral/data-model-cli/pull/3) +- Merge tag '1.0.0' into develop [`335d9ee`](https://github.com/rdkcentral/data-model-cli/commit/335d9ee75bc6ed165ee02b45b62968a4baa41117) + #### 1.0.0 -- Create CODEOWNERS [`#2`](https://github.com/rdkcentral/dbus-message-cli/pull/2) -- Create CONTRIBUTING.md [`#1`](https://github.com/rdkcentral/dbus-message-cli/pull/1) -- Import of source (stable2) [`b0267e3`](https://github.com/rdkcentral/dbus-message-cli/commit/b0267e36df445ec4dcfcd570f79f30aa906934b7) -- Deploy L1-tests action [`de8da21`](https://github.com/rdkcentral/dbus-message-cli/commit/de8da216c3b4c0005f274c5f2b7aee1a80f6eb6d) -- Deploy cla action [`f472d2d`](https://github.com/rdkcentral/dbus-message-cli/commit/f472d2da42e6fff6445f3dd20800abc983a5244d) +> 15 July 2025 + +- Create CODEOWNERS [`#2`](https://github.com/rdkcentral/data-model-cli/pull/2) +- Create CONTRIBUTING.md [`#1`](https://github.com/rdkcentral/data-model-cli/pull/1) +- Import of source (stable2) [`b0267e3`](https://github.com/rdkcentral/data-model-cli/commit/b0267e36df445ec4dcfcd570f79f30aa906934b7) +- Deploy L1-tests action [`de8da21`](https://github.com/rdkcentral/data-model-cli/commit/de8da216c3b4c0005f274c5f2b7aee1a80f6eb6d) +- Update CHANGELOG.md [`409214d`](https://github.com/rdkcentral/data-model-cli/commit/409214dabde7e93cf38f138dac6eb6e566467d08)