-
Notifications
You must be signed in to change notification settings - Fork 2
RDKEMW-17573 : Triggering a issue type with more than 35 chars in RRD is leading RDM crash #197
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
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
test/functional-tests/features/rrd_dynamic_profile_node_length_exceeded.feature
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| ########################################################################## | ||
| # 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 Rejects RDM Download Request When IssueType Node Exceeds Maximum Length | ||
|
|
||
| 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 with an IssueType string longer than 34 characters and verify logs | ||
| Given the remote debugger is running | ||
| When I trigger the event "Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.RDKRemoteDebugger.IssueType" with a value longer than 34 characters | ||
| 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 oversized 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 RDM download request is rejected due to IssueType node length exceeding 34 characters | ||
| Given the remote debugger issuetype is missing in static profile | ||
| When the remotedebugger reads the json file from the dynamic path | ||
| Then remotedebugger json read and parse should fail | ||
| And remotedebugger should attempt to request RDM to download the package | ||
| But the RDM download request should be skipped because the dynamic profile node length exceeds 34 characters | ||
| And the logs should contain "Issue node length must be less than 34" | ||
| And the logs should contain "Invalid profile length, skipping download request" |
104 changes: 104 additions & 0 deletions
104
test/functional-tests/tests/test_rrd_dynamic_profile_rdm_node_length_exceeded.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,104 @@ | ||
| ########################################################################## | ||
| # 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 json | ||
| import subprocess | ||
| from helper_functions import * | ||
|
|
||
| def test_check_remote_debugger_config_file(): | ||
| config_file_path = JSON_FILE | ||
| assert check_file_exists(config_file_path), f"Configuration file '{config_file_path}' does not exist." | ||
|
|
||
| def test_check_rrd_directory_exists(): | ||
| dir_path = OUTPUT_DIR | ||
| assert check_directory_exists(dir_path), f"Directory '{dir_path}' does not exist." | ||
|
|
||
| def test_check_and_start_remotedebugger(): | ||
| kill_rrd() | ||
| remove_logfile() | ||
| print("Starting remotedebugger process") | ||
| command_to_start = "nohup /usr/local/bin/remotedebugger > /dev/null 2>&1 &" | ||
| run_shell_silent(command_to_start) | ||
| command_to_get_pid = "pidof remotedebugger" | ||
| pid = run_shell_command(command_to_get_pid) | ||
| assert pid != "", "remotedebugger process did not start" | ||
|
|
||
| def reset_issuetype_rfc(): | ||
| command = 'rbuscli set Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.RDKRemoteDebugger.IssueType string ""' | ||
| result = subprocess.run(command, shell=True, capture_output=True, text=True) | ||
| assert result.returncode == 0 | ||
|
|
||
| def test_remote_debugger_trigger_event(): | ||
| STRING_TEST = "hfkerfjrjfjfjfjfjfjfjfjfjfjfjfjfjfjf" | ||
| reset_issuetype_rfc() | ||
| sleep(10) | ||
| command = [ | ||
| 'rbuscli', 'set', | ||
| 'Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.RDKRemoteDebugger.IssueType', | ||
| 'string', STRING_TEST | ||
| ] | ||
| result = subprocess.run(command, capture_output=True, text=True) | ||
| assert result.returncode == 0 | ||
|
|
||
| sleep(15) | ||
|
|
||
| QUERY_MSG = "Received event for RRD_SET_ISSUE_EVENT" | ||
| assert QUERY_MSG in grep_rrdlogs(QUERY_MSG) | ||
|
|
||
| MSG_SEND = "SUCCESS: Message sending Done" | ||
| sleep(2) | ||
| assert MSG_SEND in grep_rrdlogs(MSG_SEND) | ||
|
|
||
| MSG_RECEIVE = "SUCCESS: Message Reception Done" | ||
| sleep(2) | ||
| assert MSG_RECEIVE in grep_rrdlogs(MSG_RECEIVE) | ||
|
|
||
| def test_check_issue_in_static_profile(): | ||
| READ_JSON = "Start Reading JSON File... /etc/rrd/remote_debugger.json" | ||
| assert READ_JSON in grep_rrdlogs(READ_JSON) | ||
|
|
||
| PARSE_JSON = "Static Profile Parse And Read Success" | ||
| assert PARSE_JSON in grep_rrdlogs(PARSE_JSON) | ||
|
|
||
| MISSING_MSG = "Issue Data Not found in Static JSON File" | ||
| assert MISSING_MSG in grep_rrdlogs(MISSING_MSG) | ||
|
|
||
| def test_check_issue_in_dynamic_profile(): | ||
| DYNAMIC_READ = "Checking Dynamic Profile..." | ||
| assert DYNAMIC_READ in grep_rrdlogs(DYNAMIC_READ) | ||
|
|
||
| DYNAMIC_JSONFILE = "Reading json config file /media/apps/RDK-RRD-hfkerfjrjfjfjfjfjfjfjfjfjfjfjfjfjfjf/etc/rrd/remote_debugger.json" | ||
| assert DYNAMIC_JSONFILE in grep_rrdlogs(DYNAMIC_JSONFILE) | ||
|
|
||
| PARSE_FAILED = "Dynamic Profile Parse/Read failed" | ||
| assert PARSE_FAILED in grep_rrdlogs(PARSE_FAILED) | ||
|
|
||
| RDM_MSG = "Request RDM Manager Download for a new Issue Type" | ||
| assert RDM_MSG in grep_rrdlogs(RDM_MSG) | ||
|
|
||
| INVALID_LENGTH = "Issue node length must be less than 34" | ||
| assert INVALID_LENGTH in grep_rrdlogs(INVALID_LENGTH) | ||
|
|
||
| SKIP_DOWNLOAD = "Invalid profile length, skipping download request" | ||
| assert SKIP_DOWNLOAD in grep_rrdlogs(SKIP_DOWNLOAD) | ||
|
|
||
|
|
||
| remove_logfile() | ||
| remove_outdir_contents(OUTPUT_DIR) | ||
| kill_rrd() |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.