Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
fed0d6c
logupload
Dec 5, 2025
892db87
Add files via upload
Abhinavpv28 Dec 6, 2025
22ada22
Update Makefile.am
Abhinavpv28 Dec 6, 2025
664cb05
Add support for CPC code in configure.ac
Abhinavpv28 Dec 6, 2025
94c1146
Create readme.doc
Abhinavpv28 Dec 6, 2025
e077ed1
Add files via upload
Abhinavpv28 Dec 6, 2025
ff77009
Delete uploadutil directory
Abhinavpv28 Dec 6, 2025
baec6d6
Delete uploadutils/readme.doc
Abhinavpv28 Dec 6, 2025
28a87e7
Update Makefile.am
Abhinavpv28 Dec 6, 2025
7b93c34
Update system_utils.c
Abhinavpv28 Dec 6, 2025
e008a8f
Remove get_system_uptime function declaration
Abhinavpv28 Dec 6, 2025
49bf54c
Update upload_status.c
Abhinavpv28 Dec 6, 2025
c72bc92
Update upload_status.h
Abhinavpv28 Dec 6, 2025
37a7e24
Add files via upload
Abhinavpv28 Dec 6, 2025
a7d8e7a
Add files via upload
Abhinavpv28 Dec 6, 2025
97927a5
Update mtls_upload.c
Abhinavpv28 Dec 6, 2025
97af4b7
Add files via upload
Abhinavpv28 Dec 7, 2025
c796ea2
Refactor GitHub Actions for L1 Unit Tests
Abhinavpv28 Dec 7, 2025
a2f6259
Add codebigUtils.c with utility functions
Abhinavpv28 Dec 8, 2025
97cddeb
Add codebigUtils.h header file with utility functions
Abhinavpv28 Dec 8, 2025
c7914ab
Update Makefile.am
Abhinavpv28 Dec 8, 2025
d320f1d
Update codebigUtils.c
Abhinavpv28 Dec 8, 2025
0dbf467
Update Makefile.am
Abhinavpv28 Dec 8, 2025
2c754a9
Add files via upload
Abhinavpv28 Dec 8, 2025
5a1b800
Update unit_test.sh
Abhinavpv28 Dec 8, 2025
c44ad0c
Update unit_test.sh
Abhinavpv28 Dec 8, 2025
3c40e7e
Update unit_test.sh
Abhinavpv28 Dec 8, 2025
88ce0f9
Update uploadUtil.c
Abhinavpv28 Dec 8, 2025
24a8f90
Change copyright from Comcast to RDK Management
Abhinavpv28 Dec 8, 2025
2dbe8aa
Update copyright notice format in Makefile.am
Abhinavpv28 Dec 8, 2025
4d6f84f
Update codebigUtils.h
Abhinavpv28 Dec 8, 2025
22c8ff1
Restore copyright and documentation comments
Abhinavpv28 Dec 8, 2025
38711d7
Update codebig_upload.h
Abhinavpv28 Dec 8, 2025
f3f4ad2
Update mtls_upload.c
Abhinavpv28 Dec 8, 2025
7b3b6d8
Restore copyright and documentation comments
Abhinavpv28 Dec 8, 2025
1819c6f
Restore copyright and documentation comments
Abhinavpv28 Dec 8, 2025
c578907
Update Makefile.am
Abhinavpv28 Dec 8, 2025
586da49
Update comment block format in codebig_upload_gtest.cpp
Abhinavpv28 Dec 8, 2025
eb571b8
Update mtls_upload_gtest.cpp
Abhinavpv28 Dec 8, 2025
3aecb98
Update copyright notice in uploadUtil_gtest.cpp
Abhinavpv28 Dec 8, 2025
d428ca6
Update copyright header in upload_status_gtest.cpp
Abhinavpv28 Dec 8, 2025
b4f753b
Fix copyright notice formatting in codebigUtils.c
Abhinavpv28 Dec 8, 2025
8a050c1
Update codebigUtils.h
Abhinavpv28 Dec 8, 2025
98e22d8
Update codebig_upload_gtest.cpp
Abhinavpv28 Dec 8, 2025
b818a4d
Update codebig_upload_gtest.cpp
Abhinavpv28 Dec 8, 2025
8800604
Update codebig_upload_gtest.cpp
Abhinavpv28 Dec 8, 2025
6a4c14b
Clean up comments in codebig_upload_gtest.cpp
Abhinavpv28 Dec 8, 2025
e647f73
Update codebig_upload_gtest.cpp
Abhinavpv28 Dec 8, 2025
113b3a1
Clean up codebig_upload_gtest.cpp
Abhinavpv28 Dec 8, 2025
028edf9
Update CFLAGS for libuploadutil with LIBRDKCERTSEL_FLAG
Abhinavpv28 Dec 10, 2025
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
52 changes: 41 additions & 11 deletions .github/workflows/L1-Test.yaml
Original file line number Diff line number Diff line change
@@ -1,28 +1,58 @@
name: Unit tests Common Utilities
name: L1 Unit Tests

on:
pull_request:
branches: [ develop, main ]
push:
branches: [ feature/copilot_twostage ]

env:
AUTOMATICS_UNAME: ${{ secrets.AUTOMATICS_UNAME }}
AUTOMATICS_PASSCODE: ${{ secrets.AUTOMATICS_PASSCODE }}

jobs:
execute-unit-tests-on-pr:
name: Execute unit tests in gtest test suite
execute-L1-tests-on-pr:
name: Execute L1 test suite in test container environment
runs-on: ubuntu-latest
container:
image: ghcr.io/rdkcentral/docker-rdk-ci:latest

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

- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Pull test container image
run: docker pull ghcr.io/rdkcentral/docker-device-mgt-service-test/native-platform:latest

- name: Start test container
run: |
docker run -d --name native-platform -v ${{ github.workspace }}:/mnt/L1_CONTAINER_SHARED_VOLUME ghcr.io/rdkcentral/docker-device-mgt-service-test/native-platform:latest

- name: Run unit tests
run: sh unit_test.sh
- name: Run L1 Unit Tests inside container
run: docker exec -i native-platform /bin/bash -c "cd /mnt/L1_CONTAINER_SHARED_VOLUME/ && sh unit_test.sh"

- name: Upload test results to automatic test result management system
- name: Copy L1 test results to runner
run: |
docker cp native-platform:/tmp/Gtest_Report /tmp/Gtest_Report
ls -l /tmp/Gtest_Report

upload-test-results:
Comment on lines +13 to +42

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI 2 months ago

To fix the problem, explicitly add a permissions block to the workflow, restricting the permissions of the GITHUB_TOKEN to the minimum required to complete the workflow tasks. In this context, setting contents: read at the workflow root is appropriate and restricts repository access to read-only for all jobs (unless overridden per-job). This change should be made near the top of the YAML, right after the workflow name, but before on so that it applies globally. No code outside this YAML file needs to be modified, no imports are required, and no existing functionality changes.


Suggested changeset 1
.github/workflows/L1-Test.yaml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/L1-Test.yaml b/.github/workflows/L1-Test.yaml
--- a/.github/workflows/L1-Test.yaml
+++ b/.github/workflows/L1-Test.yaml
@@ -1,4 +1,6 @@
 name: L1 Unit Tests
+permissions:
+  contents: read
 
 on:
   push:
EOF
@@ -1,4 +1,6 @@
name: L1 Unit Tests
permissions:
contents: read

on:
push:
Copilot is powered by AI and may make mistakes. Always verify output.
name: Upload L1 test results to automatic test result management system
needs: execute-L1-tests-on-pr
runs-on: ubuntu-latest
container:
image: ghcr.io/rdkcentral/docker-rdk-ci:latest
volumes:
- /tmp/Gtest_Report:/tmp/Gtest_Report

steps:
- name: Upload results
if: github.repository_owner == 'rdkcentral'
run: |
echo "Contents in /tmp/Gtest_Report:"
ls -l /tmp/Gtest_Report
git config --global --add safe.directory `pwd`
gtest-json-result-push.py /tmp/Gtest_Report https://rdkeorchestrationservice.apps.cloud.comcast.net/rdke_orchestration_api/push_unit_test_results `pwd`

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}
3 changes: 1 addition & 2 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,4 @@
# SPDX-License-Identifier: Apache-2.0
#

SUBDIRS = parsejson dwnlutils utils

SUBDIRS = parsejson dwnlutils utils uploadutils
14 changes: 12 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,17 @@ PKG_CHECK_MODULES([cjson], [libcjson >= 1.7.12])
PKG_CHECK_MODULES([curl], [libcurl >= 7.60.0])
IS_LIBRDKCERTSEL_ENABLED=" "

AC_ARG_ENABLE([cpc-code],
[AS_HELP_STRING([--enable-cpc-code], [Enable CPC code support])],
[USE_CPC_CODE="$enableval"],
[USE_CPC_CODE=no])

AM_CONDITIONAL([USE_CPC_CODE], [test "$USE_CPC_CODE" = "yes"])

if test "$USE_CPC_CODE" = "yes"; then
AC_DEFINE([USE_CPC_CODE], [1], [Define to enable CPC CODE support])
fi

AC_ARG_ENABLE([rdkcertselector],
AS_HELP_STRING([--enable-rdkcertselector],[enables rdkcertselector replacement (default is no)]),
[
Expand Down Expand Up @@ -87,11 +98,10 @@ AC_CONFIG_FILES([Makefile
dwnlutils/Makefile
utils/Makefile
parsejson/Makefile
uploadutils/Makefile
])

BUILD_BINS="false"
AM_CONDITIONAL([build_parsejson_bins], [test "x$BUILD_BINS" = xtrue])

AC_OUTPUT


1 change: 1 addition & 0 deletions unit-test/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#

AUTOMAKE_OPTIONS = subdir-objects
SUBDIRS = uploadutil

# Define the program name and the source files
bin_PROGRAMS = system_utils_gtest rdk_fwdl_utils_gtest common_device_api_gtest urlHelper_gtest json_parse_gtest downloadUtil_gtest
Expand Down
2 changes: 1 addition & 1 deletion unit-test/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@ AC_C_CONST
AC_FUNC_MALLOC
AC_FUNC_REALLOC
# Generate the Makefile
AC_CONFIG_FILES([Makefile])
AC_CONFIG_FILES([Makefile uploadutil/Makefile])
# Generate the configure script
AC_OUTPUT
60 changes: 60 additions & 0 deletions unit-test/uploadutil/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Copyright 2023 Comcast Cable Communications Management, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#

AUTOMAKE_OPTIONS = subdir-objects

# Define the program name and the source files
bin_PROGRAMS = uploadUtil_gtest upload_status_gtest codebig_upload_gtest mtls_upload_gtest

# Define the include directories
COMMON_CPPFLAGS = -std=c++11 -I/usr/include/cjson -I../../utils -I../../mocks -I../../uploadutils -I../../dwnlutils -I../../parsejson -DGTEST_ENABLE -DLIBRDKCERTSELECTOR

# Define the libraries to link against
COMMON_LDADD = -lcjson -lgcov -lcurl -lgtest -lgtest_main -lgmock_main -lgmock -lfwutils -ldwnlutil

# Define the compiler flags
COMMON_CXXFLAGS = -frtti -fprofile-arcs -ftest-coverage -fpermissive

# Define the source files
uploadUtil_gtest_SOURCES = uploadUtil_gtest.cpp ../../uploadutils/uploadUtil.c ../../utils/rdkv_cdl_log_wrapper.c ../../parsejson/json_parse.c

upload_status_gtest_SOURCES = upload_status_gtest.cpp ../../uploadutils/upload_status.c ../../utils/rdkv_cdl_log_wrapper.c

codebig_upload_gtest_SOURCES = codebig_upload_gtest.cpp ../../uploadutils/codebig_upload.c ../../utils/rdkv_cdl_log_wrapper.c

mtls_upload_gtest_SOURCES = mtls_upload_gtest.cpp ../../uploadutils/mtls_upload.c ../../utils/rdkv_cdl_log_wrapper.c

# Apply common properties to each program
uploadUtil_gtest_CPPFLAGS = $(COMMON_CPPFLAGS)
uploadUtil_gtest_LDADD = $(COMMON_LDADD)
uploadUtil_gtest_CXXFLAGS = $(COMMON_CXXFLAGS)
uploadUtil_gtest_CFLAGS = $(COMMON_CXXFLAGS)

upload_status_gtest_CPPFLAGS = $(COMMON_CPPFLAGS)
upload_status_gtest_LDADD = $(COMMON_LDADD)
upload_status_gtest_CXXFLAGS = $(COMMON_CXXFLAGS)
upload_status_gtest_CFLAGS = $(COMMON_CXXFLAGS)

codebig_upload_gtest_CPPFLAGS = $(COMMON_CPPFLAGS)
codebig_upload_gtest_LDADD = $(COMMON_LDADD)
codebig_upload_gtest_CXXFLAGS = $(COMMON_CXXFLAGS)
codebig_upload_gtest_CFLAGS = $(COMMON_CXXFLAGS)

mtls_upload_gtest_CPPFLAGS = $(COMMON_CPPFLAGS)
mtls_upload_gtest_LDADD = $(COMMON_LDADD)
mtls_upload_gtest_CXXFLAGS = $(COMMON_CXXFLAGS)
mtls_upload_gtest_CFLAGS = $(COMMON_CXXFLAGS)
Loading
Loading