Skip to content

[RDKE] L2 Tests And Integration With CI for Remote Debugger Dynamic Updates #98

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

Merged
merged 50 commits into from
Apr 7, 2025
Merged
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
aca8ccf
Create test_rrd_dynamic_profile_report.py
Abhinavpv28 Mar 14, 2025
19af175
Create rrd_dynamic_profile_report.feature
Abhinavpv28 Mar 14, 2025
04fe87b
Update run_l2.sh
Abhinavpv28 Mar 14, 2025
0167ba1
Update run_l2.sh
Abhinavpv28 Mar 14, 2025
868a111
Update run_l2.sh
Abhinavpv28 Mar 14, 2025
7b2de0c
Update helper_functions.py
Abhinavpv28 Mar 14, 2025
7ea9844
Update test_rrd_dynamic_profile_report.py
Abhinavpv28 Mar 22, 2025
63a7543
Update helper_functions.py
Abhinavpv28 Mar 22, 2025
a56351c
Create test_rrd_dynamic_profile_missing_report.py
Abhinavpv28 Mar 22, 2025
bdd1359
Update run_l2.sh
Abhinavpv28 Mar 22, 2025
f4a8b18
Create create_json.sh
Abhinavpv28 Mar 22, 2025
318d743
Update create_json.sh
Abhinavpv28 Mar 26, 2025
70dea17
Update helper_functions.py
Abhinavpv28 Mar 26, 2025
eb467af
Create test_rrd_dynamic_profile_harmful_report.py
Abhinavpv28 Mar 27, 2025
f6b946b
Update helper_functions.py
Abhinavpv28 Mar 27, 2025
9b29df9
Create test_rrd_append_dynamic_profile_static_notfound.py
Abhinavpv28 Mar 27, 2025
087effd
Merge pull request #107 from rdkcentral/develop
Abhinavpv28 Mar 29, 2025
78d4035
Update helper_functions.py
Abhinavpv28 Mar 29, 2025
e59f42b
Update run_l2.sh
Abhinavpv28 Mar 29, 2025
89abf51
Update run_l2.sh
Abhinavpv28 Mar 29, 2025
3bcd951
Update run_l2.sh
Abhinavpv28 Mar 29, 2025
1b111ab
Update test_rrd_dynamic_profile_missing_report.py
Abhinavpv28 Mar 29, 2025
814029e
Update test_rrd_dynamic_profile_missing_report.py
Abhinavpv28 Apr 1, 2025
c3bcc93
Update run_l2.sh
Abhinavpv28 Apr 1, 2025
dd3730d
Update run_l2.sh
Abhinavpv28 Apr 1, 2025
1245e9c
Update test_rrd_dynamic_profile_report.py
Abhinavpv28 Apr 1, 2025
d37d6ea
Update test_rrd_append_dynamic_profile_static_notfound.py
Abhinavpv28 Apr 1, 2025
246e6bd
Update test_rrd_dynamic_profile_missing_report.py
Abhinavpv28 Apr 1, 2025
95926af
Create test_rrd_dynamic_profile_harmful_report.feature
Abhinavpv28 Apr 2, 2025
1c4532b
Create rrd_dynamic_profile_missing_report .feature
Abhinavpv28 Apr 2, 2025
757cda6
Create rrd_append_dynamic_profile_static_not_found.feature
Abhinavpv28 Apr 2, 2025
1a3e00d
Create test_rrd_append_dynamic_profile_report.py
Abhinavpv28 Apr 4, 2025
42e5bb3
Update run_l2.sh
Abhinavpv28 Apr 4, 2025
16f4e45
Update run_l2.sh
Abhinavpv28 Apr 4, 2025
679a40c
Update helper_functions.py
Abhinavpv28 Apr 4, 2025
cb33408
Rename rrd_dynamic_profile_missing_report .feature to rrd_dynamic_pro…
Abhinavpv28 Apr 4, 2025
1b4901c
Delete test/functional-tests/tests/test_rrd_append_dynamic_profile_re…
Abhinavpv28 Apr 4, 2025
33eaa67
Update run_l2.sh
Abhinavpv28 Apr 4, 2025
123b8b9
Update rrd_append_dynamic_profile_static_not_found.feature
Abhinavpv28 Apr 4, 2025
76d5c29
Update rrd_append_dynamic_profile_static_not_found.feature
Abhinavpv28 Apr 4, 2025
5500e7a
Update rrd_append_dynamic_profile_static_not_found.feature
Abhinavpv28 Apr 7, 2025
0505d9b
Update rrd_dynamic_profile_missing_report.feature
Abhinavpv28 Apr 7, 2025
101598e
Update rrd_dynamic_profile_report.feature
Abhinavpv28 Apr 7, 2025
55a99c0
Update test_rrd_dynamic_profile_harmful_report.feature
Abhinavpv28 Apr 7, 2025
b0cc22e
Update create_json.sh
Abhinavpv28 Apr 7, 2025
ca2968b
Update test_rrd_append_dynamic_profile_static_notfound.py
Abhinavpv28 Apr 7, 2025
0cdf3b9
Update test_rrd_dynamic_profile_report.py
Abhinavpv28 Apr 7, 2025
0fc400f
Update test_rrd_dynamic_profile_missing_report.py
Abhinavpv28 Apr 7, 2025
ae04cbb
Update test_rrd_dynamic_profile_harmful_report.py
Abhinavpv28 Apr 7, 2025
7317943
Merge branch 'develop' into feature/L2_dynamic
nhanasi Apr 7, 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
7 changes: 7 additions & 0 deletions run_l2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ mkdir -p "$RESULT_DIR"
mkdir -p "$OUTPUT_DIR"
mkdir -p "$STATIC_PROFILE_DIR"
mkdir -p "$LIB_DIR"
mkdir -p /media/apps/RDK-RRD-Test/etc/rrd

touch /media/apps/RDK-RRD-Test/etc/rrd/remote_debugger.json

apt-get remove systemd
apt-get update && apt-get install -y tcpdump
Expand Down Expand Up @@ -56,6 +59,10 @@ rm -rf /tmp/rrd/*
rm -rf /opt/logs/remotedebugger.log*

# Run L2 Test cases
pytest --json-report --json-report-summary --json-report-file $RESULT_DIR/rrd_dynamic_profile_missing_report.json test/functional-tests/tests/test_rrd_dynamic_profile_missing_report.py
pytest --json-report --json-report-summary --json-report-file $RESULT_DIR/rrd_dynamic_profile_harmful_report.json test/functional-tests/tests/test_rrd_dynamic_profile_harmful_report.py
pytest --json-report --json-report-summary --json-report-file $RESULT_DIR/rrd_dynamic_profile_report.json test/functional-tests/tests/test_rrd_dynamic_profile_report.py
pytest --json-report --json-report-summary --json-report-file $RESULT_DIR/rrd_append_dynamic_profile_static_notfound.json test/functional-tests/tests/test_rrd_append_dynamic_profile_static_notfound.py
pytest --json-report --json-report-summary --json-report-file $RESULT_DIR/rrd_single_instance.json test/functional-tests/tests/test_rrd_single_instance.py
pytest --json-report --json-report-summary --json-report-file $RESULT_DIR/rrd_start_control.json test/functional-tests/tests/test_rrd_start_control.py
pytest --json-report --json-report-summary --json-report-file $RESULT_DIR/rrd_start_subscribe_and_wait.json test/functional-tests/tests/test_rrd_start_subscribe_and_wait.py
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
##########################################################################

Check failure on line 1 in test/functional-tests/features/rrd_append_dynamic_profile_static_not_found.feature

View workflow job for this annotation

GitHub Actions / call-fossid-workflow / Fossid Annotate PR

FossID License Issue Detected

Source code with 'Apache-2.0' license found in local file 'test/functional-tests/features/rrd_append_dynamic_profile_static_not_found.feature' (Match: lgirdk/ccsp-wifi-agent/cf04a1c4000061c1f52d9a6dbd9f44ac1f612edb, 17 lines, url: https://github.com/lgirdk/ccsp-wifi-agent/archive/cf04a1c4000061c1f52d9a6dbd9f44ac1f612edb.tar.gz, file: scripts/mesh_status.sh)
# 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.
##########################################################################

Feature: Remote Debugger Append Request Missing Issuetype

Scenario: Verify remote debugger process is running
Given the remote debugger process is not running
When I start the remote debugger process
Then the remote debugger process should be running

Scenario: Send WebPA event for Issuetype Test.TestRun1_apnd and verify logs
Given the remote debugger is running
When I trigger the event "Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.RDKRemoteDebugger.IssueType"
Then the logs should contain "SUCCESS: Message sending Done"
Then the logs should be seen with "SUCCESS: Message Reception Done"
And the issuetype request should match between Send and Receive

Scenario: Verify the Issuetype is found in dynamic profile
Given the remote debugger received the message from RBUS command
When the remotedebugger read the json file form the dynamic path
Then remotedebugger json read and parse should be success in dynamic path

Scenario: Verify the Issuetype is not found in static profile
Given the remote debugger received the message from RBUS command
When the remotedebugger static json profile is present
Then remotedebugger should read the Json file
And remotedebugger logs should contain the Json File Parse Success
And remotedebugger should log as the Issue requested is not found in the profile
And issuetype is not found in static json and abort command execution
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
##########################################################################

Check failure on line 1 in test/functional-tests/features/rrd_dynamic_profile_missing_report.feature

View workflow job for this annotation

GitHub Actions / call-fossid-workflow / Fossid Annotate PR

FossID License Issue Detected

Source code with 'Apache-2.0' license found in local file 'test/functional-tests/features/rrd_dynamic_profile_missing_report.feature' (Match: lgirdk/ccsp-wifi-agent/cf04a1c4000061c1f52d9a6dbd9f44ac1f612edb, 17 lines, url: https://github.com/lgirdk/ccsp-wifi-agent/archive/cf04a1c4000061c1f52d9a6dbd9f44ac1f612edb.tar.gz, file: scripts/mesh_status.sh)
# 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.
##########################################################################

Feature: Remote Debugger Missing Issuetype

Scenario: Verify remote debugger process is running
Given the remote debugger process is not running
When I start the remote debugger process
Then the remote debugger process should be running

Scenario: Send WebPA event for Issuetype Test and verify logs
Given the remote debugger is running
When I trigger the event "Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.RDKRemoteDebugger.IssueType"
Then the logs should contain "SUCCESS: Message sending Done"
Then the logs should be seen with "SUCCESS: Message Reception Done"
And the issuetype request should match between Send and Receive

Scenario: Verify the Issuetype is not found in static profile
Given the remote debugger received the message from RBUS command
When the remotedebugger static json profile is present
Then remotedebugger should read the Json file
And remotedebugger logs should contain the Json File Parse Success
And remotedebugger should log as the Issue requested is not found in the profile

Scenario: Verify the Issuetype is not found in dynamic path
Given the remote debugger issuetype is missing in static profile
When the remotedebugger read the json file form the dynamic path
Then remotedebugger json read and parse should be failed
And remotedebugger should request RDM to download the package
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
##########################################################################

Check failure on line 1 in test/functional-tests/features/rrd_dynamic_profile_report.feature

View workflow job for this annotation

GitHub Actions / call-fossid-workflow / Fossid Annotate PR

FossID License Issue Detected

Source code with 'Apache-2.0' license found in local file 'test/functional-tests/features/rrd_dynamic_profile_report.feature' (Match: lgirdk/ccsp-wifi-agent/cf04a1c4000061c1f52d9a6dbd9f44ac1f612edb, 17 lines, url: https://github.com/lgirdk/ccsp-wifi-agent/archive/cf04a1c4000061c1f52d9a6dbd9f44ac1f612edb.tar.gz, file: scripts/mesh_status.sh)
# 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.
##########################################################################

Feature: Remote Debugger Dynamic Issuetype Report

Scenario: Verify remote debugger process is running
Given the remote debugger process is not running
When I start the remote debugger process
Then the remote debugger process should be running

Scenario: Send WebPA event for Issuetype Test and verify logs
Given the remote debugger is running
When I trigger the event "Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.RDKRemoteDebugger.IssueType"
Then the logs should contain "SUCCESS: Message sending Done"
Then the logs should be seen with "SUCCESS: Message Reception Done"
And the issuetype request should match between Send and Receive

Scenario: Verify the Issuetype is not found in static profile
Given the remote debugger received the message from RBUS command
When the remotedebugger static json profile is present
Then remotedebugger should read the Json file
And remotedebugger logs should contain the Json File Parse Success
And remotedebugger should log as the Issue requested is not found in the profile

Scenario: Verify the Issuetype in dynamic path
Given the remote debugger issuetype is missing in static profile
When the remotedebugger read the json file form the dynamic path
Then remotedebugger json read and parse should be success
And remotedebugger should read the Issuetype from dynamic profile
And the issue data node and sub-node should be found in the JSON file
And the directory should be created to store the executed output
And Sanity check to validate the commands should be executed
And Command output shopuld be added to the output file
And the issuetype systemd service should start successfully
And the journalctl service should start successfully
And the process should sleep with timeout
And the issuetype systemd service should stop successfully
And the remotedebugger should call script to upload the debug report

Scenario: Upload remote debugger debug report
Given the remote debugger upload script is present
When I check the upload status in the logs
Then the upload should be successful if upload is success
Or the upload should fail if upload fails
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
##########################################################################

Check failure on line 1 in test/functional-tests/features/test_rrd_dynamic_profile_harmful_report.feature

View workflow job for this annotation

GitHub Actions / call-fossid-workflow / Fossid Annotate PR

FossID License Issue Detected

Source code with 'Apache-2.0' license found in local file 'test/functional-tests/features/test_rrd_dynamic_profile_harmful_report.feature' (Match: lgirdk/ccsp-wifi-agent/cf04a1c4000061c1f52d9a6dbd9f44ac1f612edb, 17 lines, url: https://github.com/lgirdk/ccsp-wifi-agent/archive/cf04a1c4000061c1f52d9a6dbd9f44ac1f612edb.tar.gz, file: scripts/mesh_status.sh)
# 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.
##########################################################################

Feature: Remote Debugger Harmful Commands Dynamic Issuetype Report

Scenario: Verify remote debugger process is running
Given the remote debugger process is not running
When I start the remote debugger process
Then the remote debugger process should be running

Scenario: Send WebPA event for Issuetype Test and verify logs
Given the remote debugger is running
When I trigger the event "Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.RDKRemoteDebugger.IssueType"
Then the logs should contain "SUCCESS: Message sending Done"
Then the logs should be seen with "SUCCESS: Message Reception Done"
And the issuetype request should match between Send and Receive

Scenario: Verify the Issuetype is not found in static profile
Given the remote debugger received the message from RBUS command
When the remotedebugger static json profile is present
Then remotedebugger should read the Json file
And remotedebugger logs should contain the Json File Parse Success
And remotedebugger should log as the Issue requested is not found in the profile

Scenario: Verify the Issuetype in dynamic path
Given the remote debugger issuetype is missing in static profile
When the remotedebugger read the json file form the dynamic path
Then remotedebugger json read and parse should be success
And remotedebugger should read the Issuetype from dynamic profile

Scenario: Check for harmfull commands and abort
Given remote debugger parse the Dynamic json profile successfully
When the issue node and subnode are present in the profile
Then the remote debugger should read the Sanity Check list from profile
And the remotedebugger should perform sanity check on issue commands
Given the remote debugger profile has the harmfull commands
When the issue command and the sanity commands are matched
Then the remote debugger should exit the processing of commands
And Abort the commmand execution and skip report upload
39 changes: 39 additions & 0 deletions test/functional-tests/tests/create_json.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
##########################################################################

Check failure on line 1 in test/functional-tests/tests/create_json.sh

View workflow job for this annotation

GitHub Actions / call-fossid-workflow / Fossid Annotate PR

FossID License Issue Detected

Source code with 'Apache-2.0' license found in local file 'test/functional-tests/tests/create_json.sh' (Match: lgirdk/ccsp-wifi-agent/cf04a1c4000061c1f52d9a6dbd9f44ac1f612edb, 17 lines, url: https://github.com/lgirdk/ccsp-wifi-agent/archive/cf04a1c4000061c1f52d9a6dbd9f44ac1f612edb.tar.gz, file: scripts/mesh_status.sh)

Check failure on line 1 in test/functional-tests/tests/create_json.sh

View workflow job for this annotation

GitHub Actions / call-fossid-workflow / Fossid Annotate PR

FossID License Issue Detected

Source code with 'Apache-2.0' license found in local file 'test/functional-tests/tests/create_json.sh' (Match: rdkcmf/rdkb-CcspPandM/2.1-20161024, 19 lines, url: http://github.com/rdkcmf/rdkb-CcspPandM/archive/rdkb-2.1-20161024.zip, file: scripts/email_notification_monitor.sh)
# 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.
##########################################################################

#!/bin/bash

# Step 1: Create a JSON file
json_file="/media/apps/RDK-RRD-Test/etc/rrd/remote_debugger.json"
echo '{
"Test": {
"TestRun3": {
"Commands": "cat /version.txt;uptime;rm -rf;cat /tmp/.deviceDetails.cache",
"Timeout": 10
},
"TestRun2": {
"Commands": "cat /version.txt;uptime;/proc/version;cat /proc/buddyinfo;cat /proc/meminfo;cat /tmp/.deviceDetails.cache",
"Timeout": 10
},
"TestRun1": {
"Commands": "cat /version.txt;uptime;cat /proc/buddyinfo;cat /proc/meminfo;cat /tmp/.deviceDetails.cache",
"Timeout": 10
}
}
}' > $json_file
8 changes: 7 additions & 1 deletion test/functional-tests/tests/helper_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,13 @@
HARMFULL_STRING = "Command.Harm"
MISSING_STRING = "Test.TestRun"
BACKGROUND_STRING = "Device.Dump"

DYNAMIC_DIR="/media/apps/RDK-RRD-Test/etc/rrd"
DYNAMIC_JSON_FILE = "/media/apps/RDK-RRD-Test/etc/rrd/remote_debugger.json"
DYNAMIC_STRING = "Test"
DYNAMIC_HARMFUL_STRING = "Test.TestRun3"
APPEND_STRING ="Test.TestRun2_apnd"
APPEND_STRING1 ="Test.TestRun4_apnd"
APPEND_JSON_FILE ="/media/apps/RDK-RRD-Test/etc/rrd/remote_debugger.json"
def remove_logfile():
try:
if os.path.exists(RRD_LOG_FILE):
Expand Down
Loading
Loading