From 9ec496a1de52beef044283bbba18d04e9d80d8f0 Mon Sep 17 00:00:00 2001 From: Saranya Date: Wed, 4 Jun 2025 13:07:58 +0000 Subject: [PATCH 01/10] RDK-48831 : Create L2-Test.yml file for systemTimeMgr --- .github/workflows/L2-tests.yml | 66 ++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 .github/workflows/L2-tests.yml diff --git a/.github/workflows/L2-tests.yml b/.github/workflows/L2-tests.yml new file mode 100644 index 00000000..67021167 --- /dev/null +++ b/.github/workflows/L2-tests.yml @@ -0,0 +1,66 @@ +name: L2 Integration Tests for systemtimemgr + +on: + pull_request: + branches: [ develop, feature/RDK-48831-sysTimeMgr-L2 ] + +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" From 166a16c14d9d240a6f3beefdc953ee67080b3b5b Mon Sep 17 00:00:00 2001 From: Saranya Date: Wed, 4 Jun 2025 13:14:26 +0000 Subject: [PATCH 02/10] check for yaml trigger --- .github/workflows/L2-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/L2-tests.yml b/.github/workflows/L2-tests.yml index 67021167..7018183f 100644 --- a/.github/workflows/L2-tests.yml +++ b/.github/workflows/L2-tests.yml @@ -43,7 +43,7 @@ jobs: - 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" + 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" - name: Copy L2 Test report to Host Runner run: | From 697a644b9fabefe0459c7ffaf68b477b703db0aa Mon Sep 17 00:00:00 2001 From: Saranya Date: Thu, 5 Jun 2025 07:48:45 +0000 Subject: [PATCH 03/10] triggering binary using covbuild.sh --- cov_build.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cov_build.sh b/cov_build.sh index 6b9cd5da..98f21a7e 100644 --- a/cov_build.sh +++ b/cov_build.sh @@ -39,3 +39,5 @@ export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH export LDFLAGS="-L/usr/local/lib -lpthread -lsystimerfactory -lrdkloggers -lsecure_wrapper" ./configure --prefix=${INSTALL_DIR} && make && make install +ls -l /usr/local/bin +/usr/local/bin/sysTimeMgr From b37b2e24aea7f2a80c5a6703d5954a659407bce0 Mon Sep 17 00:00:00 2001 From: Saranya Date: Thu, 12 Jun 2025 06:17:37 +0000 Subject: [PATCH 04/10] Adding L2 Testcases --- .../systemtimemgr_single_instance.feature | 27 +++++++ .../tests/helper_functions.py | 71 +++++++++++++++++++ .../tests/test_systemtimemgr_check_logs.py | 37 ++++++++++ .../tests/test_systemtimemgr_get_time.py | 33 +++++++++ .../test_systemtimemgr_initialisation.py | 23 ++++++ .../tests/test_systemtimemgr_set_time.py | 31 ++++++++ .../test_systemtimemgr_single_instance.py | 54 ++++++++++++++ test/run_l2.sh | 38 ++++++++++ 8 files changed, 314 insertions(+) create mode 100644 test/functional-tests/features/systemtimemgr_single_instance.feature create mode 100644 test/functional-tests/tests/helper_functions.py create mode 100644 test/functional-tests/tests/test_systemtimemgr_check_logs.py create mode 100644 test/functional-tests/tests/test_systemtimemgr_get_time.py create mode 100644 test/functional-tests/tests/test_systemtimemgr_initialisation.py create mode 100644 test/functional-tests/tests/test_systemtimemgr_set_time.py create mode 100644 test/functional-tests/tests/test_systemtimemgr_single_instance.py create mode 100644 test/run_l2.sh diff --git a/test/functional-tests/features/systemtimemgr_single_instance.feature b/test/functional-tests/features/systemtimemgr_single_instance.feature new file mode 100644 index 00000000..26041e81 --- /dev/null +++ b/test/functional-tests/features/systemtimemgr_single_instance.feature @@ -0,0 +1,27 @@ +#################################################################################### +# If not stated otherwise in this file or this component's Licenses.txt file the +# following copyright and licenses apply: +# +# Copyright 2024 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. +#################################################################################### + +Feature: SystemTimeManager runs only one instance + + Scenario: SystemTimeManager exits if another instance is invoked + Given the SystemTimeManager is not already running + When the SystemTimeManager binary is invoked + Then the SystemTimeManager should be started + And when the SystemTimeManager is attempted to be started again + Then the SystemTimeManager should not start another instance diff --git a/test/functional-tests/tests/helper_functions.py b/test/functional-tests/tests/helper_functions.py new file mode 100644 index 00000000..028dfe7a --- /dev/null +++ b/test/functional-tests/tests/helper_functions.py @@ -0,0 +1,71 @@ +########################################################################## +# 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. +########################################################################## + +import subprocess +import requests +import os +import time +import re +import signal +import shutil +from time import sleep + +LOG_FILE = "/opt/logs/sysTimeMgr.log" + +def remove_logfile(): + try: + if os.path.exists(LOG_FILE): + os.remove(LOG_FILE) + print(f"Log file {LOG_FILE} removed.") + else: + print(f"Log file {LOG_FILE} does not exist.") + except Exception as e: + print(f"Could not remove log file {LOG_FILE}: {e}") + +def kill_sysTimeMgr(signal: int=9): + print(f"Received Signal to kill systimemgr {signal} with pid {get_pid('sysTimeMgr')}") + resp = subprocess.run(f"kill -{signal} {get_pid('sysTimeMgr')}", shell=True, capture_output=True) + print(resp.stdout.decode('utf-8')) + print(resp.stderr.decode('utf-8')) + return "" + +def grep_rrdlogs(search: str): + search_result = "" + search_pattern = re.compile(re.escape(search), re.IGNORECASE) + try: + with open(LOG_FILE, 'r', encoding='utf-8', errors='ignore') as file: + for line_number, line in enumerate(file, start=1): + if search_pattern.search(line): + search_result = search_result + " \n" + line + except Exception as e: + print(f"Could not read file {LOG_FILE}: {e}") + return search_result + +def get_pid(name: str): + return subprocess.run(f"pidof {name}", shell=True, capture_output=True).stdout.decode('utf-8').strip() + +def run_shell_silent(command): + subprocess.run(command, shell=True, capture_output=False, text=False) + return + +def run_shell_command(command): + result = subprocess.run(command, shell=True, capture_output=True, text=True) + return result.stdout.strip() + + diff --git a/test/functional-tests/tests/test_systemtimemgr_check_logs.py b/test/functional-tests/tests/test_systemtimemgr_check_logs.py new file mode 100644 index 00000000..c525adf4 --- /dev/null +++ b/test/functional-tests/tests/test_systemtimemgr_check_logs.py @@ -0,0 +1,37 @@ +########################################################################## +# 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. +########################################################################## +from helper_functions import * + +def test_check_and_start_systemtimemgr(): + kill_sysTimeMgr() + remove_logfile() + print("Starting systemtimemgr process") + command_to_start = "nohup /usr/local/bin/sysTimeMgr > /dev/null 2>&1 &" + run_shell_silent(command_to_start) + command_to_get_pid = "pidof sysTimeMgr" + pid = run_shell_command(command_to_get_pid) + assert pid != "", "sysTimeMgr process did not start" + + +sleep(5) + +QUERY_MSG = "Quality =" +assert QUERY_MSG in grep_rrdlogs(QUERY_MSG) + + diff --git a/test/functional-tests/tests/test_systemtimemgr_get_time.py b/test/functional-tests/tests/test_systemtimemgr_get_time.py new file mode 100644 index 00000000..90aa7784 --- /dev/null +++ b/test/functional-tests/tests/test_systemtimemgr_get_time.py @@ -0,0 +1,33 @@ + +########################################################################## +# 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. +########################################################################## + +import os +from datetime import datetime + +CLOCK_FILE = "/opt/secure/clock.txt" + + +def get_last_known_time(): +    if os.path.exists(CLOCK_FILE): +        with open(CLOCK_FILE, 'r') as file: +            last_time = file.read().strip() +            return last_time +    else: +        return None diff --git a/test/functional-tests/tests/test_systemtimemgr_initialisation.py b/test/functional-tests/tests/test_systemtimemgr_initialisation.py new file mode 100644 index 00000000..c3b370a8 --- /dev/null +++ b/test/functional-tests/tests/test_systemtimemgr_initialisation.py @@ -0,0 +1,23 @@ +########################################################################## +# 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. +########################################################################## + +def is_systimemgr_running(): + command_to_check = "ps aux | grep sysTimeMgr | grep -v grep" + result = run_shell_command(command_to_check) + return result != "" diff --git a/test/functional-tests/tests/test_systemtimemgr_set_time.py b/test/functional-tests/tests/test_systemtimemgr_set_time.py new file mode 100644 index 00000000..470486a0 --- /dev/null +++ b/test/functional-tests/tests/test_systemtimemgr_set_time.py @@ -0,0 +1,31 @@ + +########################################################################## +# 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. +########################################################################## + +import os +from datetime import datetime + +CLOCK_FILE = "/opt/secure/clock.txt" + +def write_time(): + current_time = datetime.now().strftime("%Y-%m-%d %H:%M:%S") + with open(CLOCK_FILE, 'w') as file: + file.write(current_time) + +print(f"Current time Written: {current_time}") diff --git a/test/functional-tests/tests/test_systemtimemgr_single_instance.py b/test/functional-tests/tests/test_systemtimemgr_single_instance.py new file mode 100644 index 00000000..d4538e65 --- /dev/null +++ b/test/functional-tests/tests/test_systemtimemgr_single_instance.py @@ -0,0 +1,54 @@ +########################################################################## +# 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. +########################################################################## + +from time import sleep +from helper_functions import * + +def test_check_systemtimemgr_is_starting(): + kill_rrd() + remove_logfile() + print("Starting systemtimemgr process") + command_to_start = "nohup /usr/local/bin/sysTimeMgr > /dev/null 2>&1 &" + run_shell_silent(command_to_start) + command_to_get_pid = "pidof sysTimeMgr" + pid = run_shell_command(command_to_get_pid) + assert pid != "", "sysTimeMgr process did not start" + +def test_second_systemtimemgr_instance_is_not_started(): + command_to_get_pid = "pidof sysTimeMgr" + pid1 = run_shell_command(command_to_get_pid) + + if is_systemtimemgr_running(): + print("systemtimemgr process is already running") + else: + command_to_start = "nohup /usr/local/bin/sysTimeMgr > /dev/null 2>&1 &" + run_shell_silent(command_to_start) + sleep(2) + + pid2 = run_shell_command(command_to_get_pid) + assert pid1 == pid2, "A second instance of sysTimeMgr was started." + +def test_tear_down(): + command_to_stop = "kill -9 `pidof sysTimeMgr`" + run_shell_command(command_to_stop) + command_to_get_pid = "pidof sysTimeMgr" + remove_logfile() + remove_outdir_contents(OUTPUT_DIR) + pid = run_shell_command(command_to_get_pid) + assert pid == "" diff --git a/test/run_l2.sh b/test/run_l2.sh new file mode 100644 index 00000000..605ba6cb --- /dev/null +++ b/test/run_l2.sh @@ -0,0 +1,38 @@ +#!/bin/sh +#################################################################################### +# If not stated otherwise in this file or this component's Licenses.txt file the +# following copyright and licenses apply: +# +# Copyright 2024 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 + +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_systemtimemgr_single_instance.py +pytest --json-report --json-report-summary --json-report-file $RESULT_DIR/systimemgr_initialisation.json test/functional-tests/tests/test_systemtimemgr_initialisation.py +pytest --json-report --json-report-summary --json-report-file $RESULT_DIR/systimemgr_set_time.json test/functional-tests/tests/test_systemtimemgr_set_time.py +pytest --json-report --json-report-summary --json-report-file $RESULT_DIR/systimemgr_get_time.json test/functional-tests/tests/test_systemtimemgr_get_time.py +pytest --json-report --json-report-summary --json-report-file $RESULT_DIR/systimemgr_check_logs.json test/functional-tests/tests/test_systemtimemgr_check_logs.py + From a864e0f0db5150713e412d4f221ba37cb67a3f38 Mon Sep 17 00:00:00 2001 From: Saranya Date: Thu, 12 Jun 2025 06:23:18 +0000 Subject: [PATCH 05/10] L2 Testcase for systimemgr --- test/functional-tests/tests/helper_functions.py | 2 +- test/functional-tests/tests/test_systemtimemgr_check_logs.py | 2 +- .../tests/test_systemtimemgr_single_instance.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/functional-tests/tests/helper_functions.py b/test/functional-tests/tests/helper_functions.py index 028dfe7a..1c619444 100644 --- a/test/functional-tests/tests/helper_functions.py +++ b/test/functional-tests/tests/helper_functions.py @@ -45,7 +45,7 @@ def kill_sysTimeMgr(signal: int=9): print(resp.stderr.decode('utf-8')) return "" -def grep_rrdlogs(search: str): +def grep_sysTimeMgrlogs(search: str): search_result = "" search_pattern = re.compile(re.escape(search), re.IGNORECASE) try: diff --git a/test/functional-tests/tests/test_systemtimemgr_check_logs.py b/test/functional-tests/tests/test_systemtimemgr_check_logs.py index c525adf4..eefe6245 100644 --- a/test/functional-tests/tests/test_systemtimemgr_check_logs.py +++ b/test/functional-tests/tests/test_systemtimemgr_check_logs.py @@ -32,6 +32,6 @@ def test_check_and_start_systemtimemgr(): sleep(5) QUERY_MSG = "Quality =" -assert QUERY_MSG in grep_rrdlogs(QUERY_MSG) +assert QUERY_MSG in grep_sysTimeMgrlogs(QUERY_MSG) diff --git a/test/functional-tests/tests/test_systemtimemgr_single_instance.py b/test/functional-tests/tests/test_systemtimemgr_single_instance.py index d4538e65..b5e5a386 100644 --- a/test/functional-tests/tests/test_systemtimemgr_single_instance.py +++ b/test/functional-tests/tests/test_systemtimemgr_single_instance.py @@ -21,7 +21,7 @@ from helper_functions import * def test_check_systemtimemgr_is_starting(): - kill_rrd() + kill_sysTimeMgr() remove_logfile() print("Starting systemtimemgr process") command_to_start = "nohup /usr/local/bin/sysTimeMgr > /dev/null 2>&1 &" From d71436cf836e12249e91b77713f995cc1df19366 Mon Sep 17 00:00:00 2001 From: Saranya2421 Date: Thu, 12 Jun 2025 11:57:02 +0530 Subject: [PATCH 06/10] Update cov_build.sh --- cov_build.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/cov_build.sh b/cov_build.sh index 98f21a7e..7606d07f 100644 --- a/cov_build.sh +++ b/cov_build.sh @@ -40,4 +40,3 @@ export LDFLAGS="-L/usr/local/lib -lpthread -lsystimerfactory -lrdkloggers -lsec ./configure --prefix=${INSTALL_DIR} && make && make install ls -l /usr/local/bin -/usr/local/bin/sysTimeMgr From 2586ce4ffc06e6b990135048153765912634c1f4 Mon Sep 17 00:00:00 2001 From: Saranya2421 Date: Thu, 12 Jun 2025 12:01:16 +0530 Subject: [PATCH 07/10] Update L2-tests.yml --- .github/workflows/L2-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/L2-tests.yml b/.github/workflows/L2-tests.yml index 7018183f..67021167 100644 --- a/.github/workflows/L2-tests.yml +++ b/.github/workflows/L2-tests.yml @@ -43,7 +43,7 @@ jobs: - 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" + 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: | From abaa33adf829e1d89be267ab8493735b80734049 Mon Sep 17 00:00:00 2001 From: Saranya Date: Thu, 12 Jun 2025 06:47:40 +0000 Subject: [PATCH 08/10] Adding L2 script --- test/run_l2.sh => run_l2.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename test/run_l2.sh => run_l2.sh (100%) diff --git a/test/run_l2.sh b/run_l2.sh similarity index 100% rename from test/run_l2.sh rename to run_l2.sh From 21562aab31ee0a2932be4ed0a42d1871ceec4fa6 Mon Sep 17 00:00:00 2001 From: Saranya Date: Thu, 12 Jun 2025 06:59:30 +0000 Subject: [PATCH 09/10] Fixing errors in Testcases --- test/functional-tests/tests/helper_functions.py | 5 ++++- test/functional-tests/tests/test_systemtimemgr_set_time.py | 1 - .../tests/test_systemtimemgr_single_instance.py | 1 - 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/test/functional-tests/tests/helper_functions.py b/test/functional-tests/tests/helper_functions.py index 1c619444..c3845b08 100644 --- a/test/functional-tests/tests/helper_functions.py +++ b/test/functional-tests/tests/helper_functions.py @@ -68,4 +68,7 @@ def run_shell_command(command): result = subprocess.run(command, shell=True, capture_output=True, text=True) return result.stdout.strip() - +def is_systemtimemgr_running(): + command_to_check = "ps aux | grep remotedebugger | grep -v grep" + result = run_shell_command(command_to_check) + return result != "" diff --git a/test/functional-tests/tests/test_systemtimemgr_set_time.py b/test/functional-tests/tests/test_systemtimemgr_set_time.py index 470486a0..f97fd7cd 100644 --- a/test/functional-tests/tests/test_systemtimemgr_set_time.py +++ b/test/functional-tests/tests/test_systemtimemgr_set_time.py @@ -28,4 +28,3 @@ def write_time(): with open(CLOCK_FILE, 'w') as file: file.write(current_time) -print(f"Current time Written: {current_time}") diff --git a/test/functional-tests/tests/test_systemtimemgr_single_instance.py b/test/functional-tests/tests/test_systemtimemgr_single_instance.py index b5e5a386..766d7e52 100644 --- a/test/functional-tests/tests/test_systemtimemgr_single_instance.py +++ b/test/functional-tests/tests/test_systemtimemgr_single_instance.py @@ -49,6 +49,5 @@ def test_tear_down(): run_shell_command(command_to_stop) command_to_get_pid = "pidof sysTimeMgr" remove_logfile() - remove_outdir_contents(OUTPUT_DIR) pid = run_shell_command(command_to_get_pid) assert pid == "" From ee9f6b95fe20975a6235816e09662972996cccb2 Mon Sep 17 00:00:00 2001 From: Saranya Date: Thu, 12 Jun 2025 07:07:31 +0000 Subject: [PATCH 10/10] L2 Testcase --- test/functional-tests/tests/helper_functions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/functional-tests/tests/helper_functions.py b/test/functional-tests/tests/helper_functions.py index c3845b08..e5baa289 100644 --- a/test/functional-tests/tests/helper_functions.py +++ b/test/functional-tests/tests/helper_functions.py @@ -69,6 +69,6 @@ def run_shell_command(command): return result.stdout.strip() def is_systemtimemgr_running(): - command_to_check = "ps aux | grep remotedebugger | grep -v grep" + command_to_check = "ps aux | grep sysTimeMgr | grep -v grep" result = run_shell_command(command_to_check) return result != ""