-
Notifications
You must be signed in to change notification settings - Fork 1
rebase #41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: topic/telemetry
Are you sure you want to change the base?
rebase #41
Changes from all commits
a377c5c
2293956
24edac1
666ca21
95eba03
ebfdceb
3241b48
89808c2
8c237bf
855fdaf
513469b
e2d50a1
3b6e15d
18e109f
f327d55
9e6063f
b6c421a
12508f3
df604e0
27a25d1
78c65ab
12552ab
98dfd90
c068021
15b65e0
9da727f
0c372c0
f7c52d3
6583514
a11bb97
be9a8de
8ee691e
3facedc
fbc6102
42762a8
519f014
1e3c2e2
82e5dea
554883e
8d4ba83
0c32e07
588dfe2
aa122f1
0c00ff4
1bf386d
5336f7b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| name: L2 Integration Tests for systemtimemgr | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: [ develop , main ] | ||
|
|
||
| env: | ||
| AUTOMATICS_UNAME: ${{ secrets.AUTOMATICS_UNAME }} | ||
| AUTOMATICS_PASSCODE: ${{ secrets.AUTOMATICS_PASSCODE }} | ||
|
|
||
| jobs: | ||
| execute-l2-tests-on-pr: | ||
| name: Execute L2 Test in L2 Container Environment | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout systemtimemgr Code | ||
| 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: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v1 | ||
|
|
||
| - name: Pull Mock XConf, Native Platform, and Docker RDK CI Images | ||
| run: | | ||
| docker pull ghcr.io/rdkcentral/docker-device-mgt-service-test/mockxconf:latest | ||
| docker pull ghcr.io/rdkcentral/docker-device-mgt-service-test/native-platform:latest | ||
| docker pull ghcr.io/rdkcentral/docker-rdk-ci:latest | ||
| - name: Start mock-xconf service | ||
| run: | | ||
| docker run -d --name mockxconf -p 50050:50050 -p 50051:50051 -p 50052:50052 -p 50053:50053 -v ${{ github.workspace }}:/mnt/L2_CONTAINER_SHARED_VOLUME ghcr.io/rdkcentral/docker-device-mgt-service-test/mockxconf:latest | ||
| - name: Start l2-container service | ||
| run: | | ||
| docker run -d --name native-platform --link mockxconf -v ${{ github.workspace }}:/mnt/L2_CONTAINER_SHARED_VOLUME ghcr.io/rdkcentral/docker-device-mgt-service-test/native-platform:latest | ||
| - name: Build systemtimemgr and Run L2 inside Native Platform Container | ||
| run: | | ||
| docker exec -i native-platform /bin/bash -c "cd /mnt/L2_CONTAINER_SHARED_VOLUME/ && sh ./cov_build.sh && export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/x86_64-linux-gnu:/lib/aarch64-linux-gnu:/usr/local/lib && sh ./run_l2.sh" | ||
| - name: Copy L2 Test report to Host Runner | ||
| run: | | ||
| docker cp native-platform:/tmp/l2_test_report /tmp/L2_TEST_RESULTS | ||
| ls -lh /tmp/L2_TEST_RESULTS | ||
| - name: Setup Docker Buildx | ||
| uses: docker/setup-buildx-action@v1 | ||
| with: | ||
| install: true | ||
|
|
||
| - name: Run RDK CI Container | ||
| run: | | ||
| docker run -d --name ci-container -e AUTOMATICS_UNAME=${{ secrets.AUTOMATICS_UNAME }} -e AUTOMATICS_PASSCODE=${{ secrets.AUTOMATICS_PASSCODE }} -v /tmp/L2_TEST_RESULTS:/tmp/L2_TEST_RESULTS ghcr.io/rdkcentral/docker-rdk-ci:latest tail -f /dev/null | ||
| - name: Upload Results to Automatics | ||
| if: github.repository_owner == 'rdkcentral' | ||
| run: | | ||
| docker cp /tmp/L2_TEST_RESULTS ci-container:/tmp/L2_TEST_RESULTS | ||
| docker exec -i ci-container bash -c "echo 'Contents in workspace directory' && ls -l && echo '===============================' && echo 'Contents in /tmp/L2_TEST_RESULTS' && ls -l /tmp/L2_TEST_RESULTS && echo '===============================' && git config --global --add safe.directory /mnt/L2_CONTAINER_SHARED_VOLUME && gtest-json-result-push.py /tmp/L2_TEST_RESULTS https://rdkeorchestrationservice.apps.cloud.comcast.net/rdke_orchestration_api/push_unit_test_results /mnt/L2_CONTAINER_SHARED_VOLUME" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +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] | ||
|
|
||
| jobs: | ||
| CLA-Lite: | ||
| name: "Signature" | ||
| uses: rdkcentral/cmf-actions/.github/workflows/cla.yml@v1 | ||
| secrets: | ||
| PERSONAL_ACCESS_TOKEN: ${{ secrets.CLA_ASSISTANT }} |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -83,6 +83,20 @@ AC_ARG_ENABLE([dtt], | |||||
| ], | ||||||
| [echo "Tee build is enable"]) | ||||||
|
|
||||||
| AC_ARG_ENABLE([t2api], | ||||||
| AS_HELP_STRING([--enable-t2api],[enables telemetry]), | ||||||
| [ | ||||||
| case "${enableval}" in | ||||||
| yes) IS_TELEMETRY2_ENABLED=true | ||||||
| T2_EVENT_FLAG=" -DT2_EVENT_ENABLED ";; | ||||||
| no) IS_TELEMETRY2_ENABLED=false ;; | ||||||
| *) AC_MSG_ERROR([bad value ${enableval} for --enable-t2enable]) ;; | ||||||
|
||||||
| *) AC_MSG_ERROR([bad value ${enableval} for --enable-t2enable]) ;; | |
| *) AC_MSG_ERROR([bad value ${enableval} for --enable-t2api]) ;; |
Copilot
AI
Mar 10, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The AC_MSG_ERROR text references --enable-t2enable, but the option is --enable-t2api. Please fix the message so users get the correct guidance when passing an invalid value.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -46,5 +46,9 @@ int main() | |
| return EXIT_FAILURE; | ||
| } | ||
|
|
||
| #ifdef T2_EVENT_ENABLED | ||
| t2_uninit(); | ||
| #endif | ||
|
|
||
| return EXIT_SUCCESS; | ||
|
Comment on lines
+49
to
53
|
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,107 @@ | ||
| ########################################################################## | ||
| # If not stated otherwise in this file or this component's LICENSE | ||
| # file the following copyright and licenses apply: | ||
| # | ||
| # Copyright 2018 RDK Management | ||
| # | ||
| # 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. | ||
| ########################################################################## | ||
|
|
||
| RESULT_DIR="/tmp/l2_test_report" | ||
| mkdir -p "$RESULT_DIR" | ||
|
|
||
| apt-get update && apt-get install -y libjsonrpccpp-dev | ||
|
|
||
| touch /usr/local/bin/journalctl | ||
| chmod -R 777 /usr/local/bin/journalctl | ||
| ln -s /usr/local/bin/journalctl /usr/bin/journalctl | ||
|
Comment on lines
+25
to
+27
|
||
|
|
||
| rm -rf /etc/systimemgr.conf | ||
| rm -rf /opt/secure/clock.txt | ||
| rm -rf /tmp/systimemgr | ||
|
|
||
| echo "timesrc ntp /ntp" > /etc/systimemgr.conf | ||
| echo "timesrc dtt /dtt" >> /etc/systimemgr.conf | ||
| echo "timesync rdkdefault /clock_time" >> /etc/systimemgr.conf | ||
|
|
||
| echo "$(date +%s)" > /opt/secure/clock.txt | ||
|
|
||
|
Comment on lines
+37
to
+38
|
||
| mkdir /tmp/systimemgr/ | ||
| touch /tmp/systimemgr/ntp | ||
|
|
||
| rm -rf /opt/logs/systimemgr.log* | ||
|
|
||
| # Run L2 Test cases | ||
| pytest --json-report --json-report-summary --json-report-file $RESULT_DIR/systimemgr_single_instance.json test/functional-tests/tests/test_systimemgr_single_instance.py | ||
| pytest --json-report --json-report-summary --json-report-file $RESULT_DIR/systimemgr_initialisation.json test/functional-tests/tests/test_systimemgr_initialisation.py | ||
| pytest --json-report --json-report-summary --json-report-file $RESULT_DIR/systimemgr_get_time.json test/functional-tests/tests/test_systimemgr_get_time.py | ||
| pytest --json-report --json-report-summary --json-report-file $RESULT_DIR/systimemgr_check_file.json test/functional-tests/tests/test_systimemgr_check_file.py | ||
| pytest --json-report --json-report-summary --json-report-file $RESULT_DIR/systimemgr_time_quality.json test/functional-tests/tests/test_systimemgr_time_quality.py | ||
| pytest --json-report --json-report-summary --json-report-file $RESULT_DIR/systimemgr_bootup_flow.json test/functional-tests/tests/test_systimemgr_bootup_flow.py | ||
|
|
||
| #Secure Time Validation TestCases | ||
| rm -rf /etc/systimemgr.conf | ||
| rm -rf /opt/secure/clock.txt | ||
|
|
||
| echo "timesrc drm /drm" >> /etc/systimemgr.conf | ||
| echo "timesync rdkdefault /clock_time" >> /etc/systimemgr.conf | ||
|
|
||
| echo "$(date +%s)" > /opt/secure/clock.txt | ||
| touch /tmp/systimemgr/drm | ||
|
|
||
| pytest --json-report --json-report-summary --json-report-file $RESULT_DIR/systimemgr_single_instance.json test/functional-tests/tests/test_systimemgr_single_instance.py | ||
| pytest --json-report --json-report-summary --json-report-file $RESULT_DIR/systimemgr_securetime_Initialisation.json test/functional-tests/tests/test_secureTime_initialisation.py | ||
| pytest --json-report --json-report-summary --json-report-file $RESULT_DIR/systimemgr_secureTime_checkEvent.json test/functional-tests/tests/test_secureTime_checkEvent.py | ||
| pytest --json-report --json-report-summary --json-report-file $RESULT_DIR/systimemgr_secureTime_Quality.json test/functional-tests/tests/test_secureTime_quality.py | ||
|
|
||
|
|
||
| # ── NWStatusMonitor L2 tests ──────────────────────────────────────────────── | ||
| # When sysTimeMgr is compiled with -D__LOCAL_TEST_ (set by cov_build.sh via | ||
| # --enable-unittest) it uses WPEFrameworkMock.h instead of the real Thunder | ||
| # library. Events are injected by writing JSON to a file that the mock | ||
| # SmartLinkType polls — no Thunder daemon or WebSocket server is needed. | ||
| # | ||
| # Restart sysTimeMgr so it subscribes afresh for the NWStatus test suite. | ||
| pkill -f sysTimeMgr 2>/dev/null || true | ||
| sleep 1 | ||
|
|
||
| # Create the RFC marker file that SysTimeMgr::run() checks before starting | ||
| # the NW-event threads (chronyRfcEnabled guard in systimemgr.cpp). | ||
| mkdir -p /opt/secure/RFC/chrony | ||
| touch /opt/secure/RFC/chrony/chronyd_enabled | ||
|
|
||
| # Clean up any leftover inject / subscribed files from a previous run | ||
| rm -f /tmp/thunder_mock_org_rdk_NetworkManager_onInternetStatusChange.inject | ||
| rm -f /tmp/thunder_mock_org_rdk_NetworkManager_onInternetStatusChange.subscribed | ||
|
|
||
| # Truncate the log so NWStatus tests only scan fresh output from this | ||
| # sysTimeMgr instance — prevents stale lines from earlier test suites | ||
| # causing false-passes in the offset-based log checks. | ||
| rm -f /opt/logs/systimemgr.log.0 | ||
|
|
||
| sysTimeMgr & | ||
| sleep 2 | ||
|
|
||
| NWSTATUS_TEST="test/functional-tests/tests/test_systimemgr_nwstatus.py" | ||
| if [ ! -f "$NWSTATUS_TEST" ]; then | ||
| NWSTATUS_TEST="$(find . -type f -name 'test_systimemgr_nwstatus.py' | head -n 1)" | ||
| fi | ||
|
|
||
| if [ -z "$NWSTATUS_TEST" ] || [ ! -f "$NWSTATUS_TEST" ]; then | ||
| echo "ERROR: Unable to find test_systimemgr_nwstatus.py in the repository." >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| pytest --json-report --json-report-summary \ | ||
| --json-report-file $RESULT_DIR/systimemgr_nwstatus.json \ | ||
| "$NWSTATUS_TEST" | ||
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Copilot Autofix
AI 10 months ago
To fix the issue, we need to add a
permissionsblock to the workflow. This block should specify the minimal permissions required for the workflow to function correctly. Based on the tasks performed in the workflow, thecontents: readpermission is sufficient, as the workflow does not modify repository contents. If additional permissions are required for specific jobs, they can be defined within the respective job blocks.The
permissionsblock will be added at the root level of the workflow to apply to all jobs. This ensures that theGITHUB_TOKENhas limited access throughout the workflow.