rebase#120
Conversation
|
Saranya seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
…ic Updates (#117) * Update rrdInterface.c * Update rrdInterface.c * Update rrdInterface.c * Update cov_build.sh * Update configure.ac * Update rrdInterface.c * Update rrdInterface.h * Update cov_build.sh * Update rrdInterface.c * Update rrdInterface.h * Update rrdInterface.c --------- Co-authored-by: nhanasi <navihansi@gmail.com>
…method (#123) * Update rrdIarmEvents.c * Update rrdIarmEvents.c * Update rrdIarmEvents.c * Update rrdIarmEvents.c * Update rrdIarmEvents.c * Update rrdCommon.h * Update rrdIarmEvents.c * Update rrdInterface.h * Update rrdCommon.h * Update rrdRunCmdThread.c * Update rrdRunCmdThread.c * Update rrdRunCmdThread.c * Update rrdDynamic.c * Update rrdJsonParser.c * Update rrdCommon.h * Update rrdIarmEvents.c * Update rrdInterface.h * Update rrdInterface.h * Update rrdIarmEvents.c * Update rrdIarmEvents.c * Update rrdIarmEvents.c * Update rrdRunCmdThread.c * Update rrdRunCmdThread.c * Update rrdRunCmdThread.c * Update rrdIarmEvents.c * Update rrdIarmEvents.c * Update rrdIarmEvents.c * Update rrdJsonParser.c * Update rrdEventProcess.c * Update rrdJsonParser.c * Update rrdJsonParser.c * Update rrdJsonParser.c * Update rrdEventProcess.c * Update rrdCommon.h * Update rrdIarmEvents.c * Update rrdIarmEvents.c * Update rrdIarmEvents.c
…method (#125) * Update rrdIarmEvents.c * Update rrdInterface.c * Update rrdInterface.c * Update cov_build.sh * Update rrdIarmEvents.c --------- Co-authored-by: nhanasi <navihansi@gmail.com>
…d message type (SCXI11BEI) (#121) * Update rrdJsonParser.c * Update rrdJsonParser.c * Update rrdEventProcess.c * Update rrdInterface.c * Update rrdInterface.c * Update rrdInterface.c * Update rrdJsonParser.c * Update rrdInterface.c * Update rrdJsonParser.c * Update rrdEventProcess.c * Update rrdJsonParser.c * Update rrdEventProcess.c * Update rrdEventProcess.c * Update rrdInterface.c * Update rrdInterface.c --------- Co-authored-by: nhanasi <navihansi@gmail.com>
Remote Debugger 1.3.2 release
| # Path to the existing JSON file | ||
| file_path = "/etc/rrd/remote_debugger.json" | ||
|
|
||
| # Read the existing JSON data | ||
| with open(file_path, "r") as json_file: | ||
| data = json.load(json_file) | ||
|
|
||
| # New entry to add | ||
| new_entry = { | ||
| "Test": { | ||
| "TestRun4": { | ||
| "Commands": "cat /version.txt;cat /tmp/.deviceDetails.cache", | ||
| "Timeout": 10 | ||
| } | ||
| } | ||
| } | ||
|
|
||
| # Update the JSON data with the new entry | ||
| data.update(new_entry) | ||
|
|
||
| # Write the updated data back to the JSON file | ||
| with open(file_path, "w") as json_file: | ||
| json.dump(data, json_file, indent=4) |
There was a problem hiding this comment.
This test module performs file I/O and mutates /etc/rrd/remote_debugger.json at import time. Pytest will execute this on collection, which can make test runs order-dependent and can affect other tests (and local environments) even if these tests are skipped/xfail. Move this JSON read/update/write into a dedicated test/fixture (e.g., setup function) and ensure the original file contents are restored in teardown/finalizer.
| SCRIPT_SUCCESS = "Debug Information Report upload Failed" | ||
| SCRIPT_FAILURE = "Debug Information Report upload Success" | ||
| if SCRIPT_SUCCESS in grep_rrdlogs(SCRIPT_SUCCESS): | ||
| print("Script execution success") | ||
| elif SCRIPT_FAILURE in grep_rrdlogs(SCRIPT_FAILURE): | ||
| print("Script execution failed") |
There was a problem hiding this comment.
SCRIPT_SUCCESS / SCRIPT_FAILURE constants are swapped: SCRIPT_SUCCESS is set to the "...upload Failed" message and SCRIPT_FAILURE to the "...upload Success" message, and the printed status strings are inverted as well. This will report success on failure and vice versa. Swap the constants (or adjust the condition/print statements) so the labels match the expected log lines.
| try: | ||
| result = subprocess.run(['bash', script_path], check=True, text=True, capture_output=True) | ||
| print("Script output:") | ||
| print(result.stdout) | ||
| except subprocess.CalledProcessError as e: | ||
| print("Error while executing the script:") | ||
| print(e.stderr) |
There was a problem hiding this comment.
The CalledProcessError from running create_json.sh is caught and only printed, so the test will continue and potentially pass even when the script fails. Re-raise the exception or fail the test (e.g., assert False) in the except block so environment setup failures are not silently ignored.
| RDK_LOG(RDK_LOG_INFO, LOG_REMDEBUG, "%s: Removing source directory: %s\n", __FUNCTION__, dir_path); | ||
|
|
||
| char cmd[1024]; | ||
| snprintf(cmd, sizeof(cmd), "rm -rf %s", dir_path); | ||
|
|
||
| int ret = system(cmd); |
There was a problem hiding this comment.
rrd_upload_cleanup_source_dir builds an "rm -rf" shell command with an unquoted dir_path and executes it via system(). Since dir_path is derived from issue/category values that ultimately come from external input, this is vulnerable to command injection and also breaks paths containing spaces/shell metacharacters. Prefer a safe recursive delete using nftw()/unlinkat() (or, at minimum, execv("rm", {"rm","-rf","--",dir_path,...}) without invoking a shell).
| #if !defined(GTEST_ENABLE) | ||
| v_secure_system("systemctl stop %s", remoteDebuggerServiceStr); | ||
| v_secure_system("systemctl reset-failed %s", remoteDebuggerServiceStr); | ||
| free(cmdData->rfcvalue); // free rfcvalue received from RRDEventThreadFunc | ||
| free(cmdData->command); // free updated command info received from RRDEventThreadFunc | ||
| free(cmdData); | ||
| #endif |
There was a problem hiding this comment.
In the GTEST_ENABLE build, this block skips freeing cmdData->rfcvalue/cmdData->command/cmdData entirely, which introduces a leak in unit tests and makes behavior differ between test and production builds. Consider guarding only the systemctl calls with GTEST_ENABLE, but keep the memory cleanup outside the conditional.
| if (name_len <= 100) { | ||
| strncpy(hdr.name, name, sizeof(hdr.name) - 1); | ||
| hdr.name[sizeof(hdr.name) - 1] = '\0'; | ||
| } else if (name_len <= 255) { | ||
| /* split into prefix and name */ | ||
| size_t prefix_len = name_len - 100 - 1; /* leave room for null */ | ||
| if (prefix_len > sizeof(hdr.prefix)) { | ||
| RDK_LOG(RDK_LOG_ERROR, LOG_REMDEBUG, "[%s] File name too long: %s (length %zu)\n", | ||
| __FUNCTION__, name, name_len); | ||
| return -1; | ||
| } | ||
| strncpy(hdr.prefix, name, prefix_len); | ||
| hdr.prefix[prefix_len < sizeof(hdr.prefix) ? prefix_len : sizeof(hdr.prefix) - 1] = '\0'; | ||
| strncpy(hdr.name, name + prefix_len + 1, sizeof(hdr.name) - 1); | ||
| hdr.name[sizeof(hdr.name) - 1] = '\0'; |
There was a problem hiding this comment.
The ustar name/prefix split logic for paths 101–255 chars is incorrect: it splits at an arbitrary offset (name_len - 101) rather than at the last '/' boundary. This can produce invalid tar headers and lose path information. Split the path at the last '/' such that prefix <= 155 and name <= 100 per ustar rules, or reject names that can’t be represented correctly.
| if (name_len <= 100) { | |
| strncpy(hdr.name, name, sizeof(hdr.name) - 1); | |
| hdr.name[sizeof(hdr.name) - 1] = '\0'; | |
| } else if (name_len <= 255) { | |
| /* split into prefix and name */ | |
| size_t prefix_len = name_len - 100 - 1; /* leave room for null */ | |
| if (prefix_len > sizeof(hdr.prefix)) { | |
| RDK_LOG(RDK_LOG_ERROR, LOG_REMDEBUG, "[%s] File name too long: %s (length %zu)\n", | |
| __FUNCTION__, name, name_len); | |
| return -1; | |
| } | |
| strncpy(hdr.prefix, name, prefix_len); | |
| hdr.prefix[prefix_len < sizeof(hdr.prefix) ? prefix_len : sizeof(hdr.prefix) - 1] = '\0'; | |
| strncpy(hdr.name, name + prefix_len + 1, sizeof(hdr.name) - 1); | |
| hdr.name[sizeof(hdr.name) - 1] = '\0'; | |
| if (name_len <= sizeof(hdr.name)) { | |
| /* simple case: whole path fits in name field */ | |
| strncpy(hdr.name, name, sizeof(hdr.name) - 1); | |
| hdr.name[sizeof(hdr.name) - 1] = '\0'; | |
| } else if (name_len <= 255) { | |
| /* split into prefix and name according to POSIX ustar rules: | |
| * - prefix contains the directory path (no trailing '/') | |
| * - name contains the final path component | |
| * - both fields must fit in their respective header buffers | |
| */ | |
| size_t prefix_len = 0; | |
| size_t name_part_len = 0; | |
| int split_found = 0; | |
| /* search for last '/' that yields valid prefix and name lengths */ | |
| for (size_t i = name_len; i > 0; --i) { | |
| if (name[i - 1] == '/') { | |
| prefix_len = i - 1; /* up to but not including this '/' */ | |
| name_part_len = name_len - i; /* after '/' to end */ | |
| if (prefix_len > 0 && | |
| prefix_len <= sizeof(hdr.prefix) && | |
| name_part_len > 0 && | |
| name_part_len <= sizeof(hdr.name)) { | |
| split_found = 1; | |
| break; | |
| } | |
| } | |
| } | |
| if (!split_found) { | |
| RDK_LOG(RDK_LOG_ERROR, LOG_REMDEBUG, | |
| "[%s] File name too long or invalid for ustar: %s (length %zu)\n", | |
| __FUNCTION__, name, name_len); | |
| return -1; | |
| } | |
| /* copy prefix (directory path) */ | |
| memcpy(hdr.prefix, name, prefix_len); | |
| hdr.prefix[prefix_len] = '\0'; | |
| /* copy final path component */ | |
| memcpy(hdr.name, name + prefix_len + 1, name_part_len); | |
| hdr.name[name_part_len] = '\0'; |
| int rrd_upload_execute(const char *log_server, const char *protocol, const char *http_link, const char *working_dir, const char *archive_filename, const char *source_dir); | ||
| int rrd_upload_check_lock(bool *is_locked); | ||
| int rrd_upload_wait_for_lock(int max_attempts, int wait_seconds); | ||
| int rrd_upload_invoke_logupload_api(const char *log_server, const char *protocol, const char *http_link, const char *archive_filename); | ||
| int rrd_upload_orchestrate(const char *upload_dir, const char *issue_type); | ||
| int rrd_upload_cleanup_files(const char *archive_path, const char *source_dir); | ||
| int rrd_upload_cleanup_source_dir(const char *dir_path); | ||
| void rrd_upload_cleanup(void); | ||
|
|
There was a problem hiding this comment.
rrd_upload.h declares rrd_upload_invoke_logupload_api() and rrd_upload_cleanup(), but there are no implementations in the source tree. Since this header is installed as part of the public include set, this creates an API contract that will fail at link time for consumers. Either implement these functions or remove them from the public header until they exist.
| // Initialize rdklogger | ||
| int rrd_log_init(const char *debug_ini_file); | ||
|
|
||
| // Logging macro placeholder (replace with actual RDK_LOG macro) | ||
| #define LOG_UPLOADRRDLOGS "LOG.RDK.UPLOADRRDLOGS" | ||
|
|
There was a problem hiding this comment.
rrd_log.h declares rrd_log_init(), but there is no implementation in the repository. If this is intended as a public API, it should be implemented; otherwise, remove the declaration to avoid unresolved symbol/link-time failures for any consumer that includes this installed header.
| 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 |
There was a problem hiding this comment.
Typo in step text: "shopuld" should be "should".
| 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 |
There was a problem hiding this comment.
Typo in step text: "shopuld" should be "should".
* RDKEMW-16897: Add Agentic Support for the RRD * Updated the instructions --------- Co-authored-by: Hanasi <nhanas001c@cable.comcast.com>
…ile Data (#183) * Update rrdInterface.h Update rrdInterface.h Update rrdInterface.c Update rrdInterface.h Update rrdInterface.c Update rrdInterface.c Update rrdInterface.c Update rrdInterface.c Update rrdInterface.c Update rrdInterface.c Update rrdInterface.c Update rrdInterface.c Update rrdInterface.c Update rrdInterface.c Add helper functions for profile data processing Added helper functions for profile data processing. Update rrdInterface.c Update rrdInterface.h Update Client_Mock.h Add mock implementations for RBusApiWrapper methods Remove mock profile handler functions for GTEST Removed mock implementations for profile handler functions when GTEST_ENABLE is defined. Update Client_Mock.cpp Update Client_Mock.h Update rrdInterface.h Update Makefile.am Update src/rrdInterface.c Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Update rrdUnitTestRunner.cpp Update rrdUnitTestRunner.cpp Update rrdUnitTestRunner.cpp Update rrdUnitTestRunner.cpp Update rrdUnitTestRunner.cpp Update rrdUnitTestRunner.cpp Update rrdUnitTestRunner.cpp Update rrdUnitTestRunner.cpp Create profileTestValid.json Update rrdUnitTestRunner.cpp Update rrdUnitTestRunner.cpp Update rrdInterface.c Update rrdInterface.c Update rrdInterface.c Update rrdUnitTestRunner.cpp Update rrdUnitTestRunner.cpp Update rrdUnitTestRunner.cpp Create profileTestInvalid.json Update rrdInterface.c Update rrdInterface.c Update rrdInterface.c Update rrdInterface.c Update rrdInterface.c Update rrdInterface.c Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Update rrdInterface.c Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> fix: add NULL guard to has_direct_commands to prevent crash on NULL input Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/c84bc9e8-e1d2-4412-81d4-54eb9c67be5f Co-authored-by: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com> Create test.py Convert run_l2.sh to Python with RDK tests Refactor run_l2.sh to Python and implement RDK Remote Debugger tests. L2 Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Update rrdInterface.c fix: correct set_rbus_response to use real rbus API signatures rbusValue_Init() returns rbusValue_t (not rbusError_t) and rbusValue_SetString() returns void in the real rbus library, so capturing their return values as rbusError_t caused a build error. - Remove incorrect return-value capture from rbusValue_Init and rbusValue_SetString; check rbusValue != NULL after init instead - Add NULL guard for prop parameter - Update RRDProfileHandlerTest SetUp() mock so rbusValue_Init actually sets *value to a non-null pointer, keeping SetRbusResponse_ValidInput test passing Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/e887c84a-2e12-4903-9d59-2bd6f90e2527 Co-authored-by: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com> Update rrdInterface.c Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> fix: resolve Coverity dead code and add NULL guard to get_all_categories_json - read_profile_json_file: split combined NULL check into two separate checks (file_size first, then filename) so *file_size is safely zeroed before the filename check; eliminates the ternary 'filename ? filename : "(null)"' and the Coverity dead-code report - get_all_categories_json: add early NULL guard for json parameter that returns an empty JSON object string to prevent crash when callers (including unit tests) pass NULL Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/c686520e-0adf-4e7e-9915-9b9e4e8a74fd Co-authored-by: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com> Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Update rrdUnitTestRunner.cpp Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Update rrdInterface.c Update rrdInterface.c Update rrdUnitTestRunner.cpp Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Update rrdUnitTestRunner.cpp Update src/rrdInterface.c Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Update rrdInterface.c Clean up comments in save_profile_category function Removed comments explaining file opening flags. RDKEMW-16897: Add Agentic Support for the RRD (#182) * RDKEMW-16897: Add Agentic Support for the RRD * Updated the instructions --------- Co-authored-by: Hanasi <nhanas001c@cable.comcast.com> Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Rename test.py to test_rrd_profile_data.py rrd Update src/rrdInterface.c Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Update src/rrdInterface.c Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Update rrdUnitTestRunner.cpp * Update rrdInterface.c * Update rrdUnitTestRunner.cpp
| # Path to the existing JSON file | ||
| file_path = "/etc/rrd/remote_debugger.json" | ||
|
|
||
| # Read the existing JSON data | ||
| with open(file_path, "r") as json_file: | ||
| data = json.load(json_file) | ||
|
|
| RDK_LOG(RDK_LOG_INFO, LOG_REMDEBUG, "%s: Removing source directory: %s\n", __FUNCTION__, dir_path); | ||
|
|
||
| char cmd[1024]; | ||
| snprintf(cmd, sizeof(cmd), "rm -rf %s", dir_path); | ||
|
|
||
| int ret = system(cmd); |
| rbusError_t rc = RBUS_ERROR_BUS_ERROR; | ||
| rbusValue_t value; | ||
| rbusValue_Init(&value); | ||
| rbusValue_SetString(value,"root"); | ||
| rc = rbus_set(rrdRbusHandle, RRD_WEBCFG_FORCE_SYNC, value, NULL); | ||
| if (rc != RBUS_ERROR_SUCCESS) | ||
| #ifndef USE_L2_SUPPORT | ||
| if (rc != RBUS_ERROR_SUCCESS) | ||
| { | ||
| RDK_LOG(RDK_LOG_ERROR, LOG_REMDEBUG, "[%s:%d]: rbus_set failed for [%s] with error [%d]\n\n", __FUNCTION__, __LINE__,RRD_WEBCFG_FORCE_SYNC ,rc); | ||
| return; | ||
| } |
| echo "AA:BB:CC:DD:EE:FF" >> /tmp/.estb_mac | ||
|
|
| git clone https://github.com/rdkcentral/dcm-agent.git -b develop | ||
|
|
||
| cd dcm-agent | ||
| sh cov_build.sh | ||
| autoreconf -i | ||
| ./configure | ||
| make && make install | ||
| cp uploadstblogs/include/*.h /usr/local/include | ||
| cd - |
RRD release for static profile DML
Update rrdEventProcess.c Update rrdExecuteScript.c Refactor rrdEventProcess.h to rrdExecuteScript.h Update rrdExecuteScript.h Update rrdExecuteScript.h Update rrdEventProcess.h Update rrdExecuteScript.h Update rrdJsonParser.c Update rrdJsonParser.h Update rrdInterface.c Update rrdCommon.h Update rrdEventProcess.c Update rrdEventProcess.c Update rrdEventProcess.c Update rrdEventProcess.c Fix indentation for appendMode assignment Update rrdCommon.h Fix appendMode assignment in rrdEventProcess.c Update rrdEventProcess.c Update rrdJsonParser.c Update rrdEventProcess.c Update rrdExecuteScript.h Update rrdExecuteScript.c Update rrdExecuteScript.c Update rrdExecuteScript.c Remove redundant logging from rrdJsonParser Update rrdJsonParser.c Update rrdEventProcess.c Update rrdJsonParser.c Update rrdEventProcess.c Update rrdJsonParser.c Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Update rrdEventProcess.c Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Update rrdJsonParser.c Fix heap overflow in issueTypeSplitter and memory leaks in suffix handling Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/fbc52780-966b-4912-825f-3030aa43c3e9 Co-authored-by: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com> Update rrdUnitTestRunner.cpp Delete .gitignore Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Update rrdEventProcess.c Update rrdEventProcess.c Update rrdEventProcess.c Update rrdEventProcess.c Update rrdUnitTestRunner.cpp Update rrdEventProcess.c Update rrdUnitTestRunner.cpp Update rrdUnitTestRunner.cpp Add gtest test cases for split_issue_type Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/9996d741-248e-4e58-8689-b4ba873cfaf2 Co-authored-by: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com> Remove build artifacts, add .gitignore Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/9996d741-248e-4e58-8689-b4ba873cfaf2 Co-authored-by: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com> Add explicit truncated content assertion in SuffixTruncatedWhenTooSmall test Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/9996d741-248e-4e58-8689-b4ba873cfaf2 Co-authored-by: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com> Apply suggestions from code review Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Update rrdEventProcess.c Update rrdEventProcess.c Update rrdEventProcess.c Update rrdEventProcess.c Update rrdEventProcess.c Update rrdEventProcess.c Update rrdEventProcess.c Update rrdEventProcess.c Update rrdEventProcess.c Update rrdEventProcess.c Update rrdEventProcess.c Update rrdEventProcess.c Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Update rrdJsonParser.c Update rrdJsonParser.c Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Update rrdUnitTestRunner.cpp Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Delete .gitignore Delete src/unittest/UTJson/device.properties Update rrdEventProcess.c Add gtest tests for split_issue_type, suffix field, and processIssueTypeEvent Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/76cad72a-f67f-4c05-8fb5-bfadf0c173b3 Co-authored-by: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com> Delete .gitignore Validate suffix prefix: only _Search- and _LogSearch- are allowed Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/125526c2-7b70-48f5-8bec-fd725eea8a04 Co-authored-by: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com> Base never contains underscore: split at first _ and discard invalid suffix Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/904bf10d-546b-4038-a60c-9bc76094a225 Co-authored-by: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com> Update rrdEventProcess.c Update rrdUnitTestRunner.cpp Update rrdEventProcess.c Update rrdEventProcess.c Fix segfault in GTEST_ENABLE mode when rbuf->jsonPath is NULL Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/efdc0d6b-89e6-4423-b202-a900f5683839 Co-authored-by: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com> Remove accidentally committed dummy directory and update .gitignore Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/efdc0d6b-89e6-4423-b202-a900f5683839 Co-authored-by: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com> Fix IssueTypeSplitterTest to match new issueTypeSplitter behavior (no built-in special-char removal) Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/00abcaba-8a41-4b88-ae12-07b5ff780ff9 Co-authored-by: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com> Fix empty/whitespace IssueType bypassing processIssueTypeEvent guards Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/4de31e24-70d8-496c-ac6a-a5376771d936 Co-authored-by: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com> fix: preserve hyphens in archive filename so portal can parse it correctly rrd_logproc_convert_issue_type() was converting '-' to '_', turning the suffix '_Search-67768-67' into '_SEARCH_67768_67'. This added extra '_' separators into the archive filename that broke the analytics portal's filename parser — it could no longer identify the timestamp field, so download requests used an incorrect S3 key. Fix: keep '-' as '-' in the sanitized output. The archive filename now uses '_' to separate structural fields (MAC, issueType, timestamp) and '-' within the UUID suffix, giving the portal a reliable delimiter. Also increase issue_type_sanitized buffer in uploadRRDLogs.c from 64 to 256 bytes so a full UUID suffix never causes a silent truncation failure. Before: 04B86A12F9F8_DEVICE_DEVICEIP_SEARCH_67768_67_<timestamp>_RRD_DEBUG_LOGS.tgz After: 04B86A12F9F8_DEVICE_DEVICEIP_SEARCH-67768-67_<timestamp>_RRD_DEBUG_LOGS.tgz All 331 tests pass. Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/981b6bc1-c9d2-4150-9e9d-851004942ffc Co-authored-by: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com> fix: replace _Search-/_LogSearch- prefix check with suffix length <= 9 rule split_issue_type() now discards any suffix whose total length (including the leading '_') exceeds 9 characters. The old _Search-/_LogSearch- prefix validation is removed entirely. Rule: strlen(underscore) <= 9 → suffix accepted strlen(underscore) > 9 → suffix discarded This means: - Short session tokens (e.g. "_ab12345", 8 chars) are carried through - Long UUID-based suffixes like "_Search-b6877385-...) are discarded, preventing extra '_' delimiters from breaking the portal filename parser Affected tests updated: - UnderscoreSplitsBaseAndSuffix : uses a short accepted suffix - MultipleUnderscoresSplitsAtFirst: "_def_ghi" (8 chars) now kept - BaseTruncatedWhenTooSmall / ExactFitBase: "_suffix" (7 chars) now kept - SuffixTruncatedWhenTooSmall: uses 9-char suffix with 5-byte buffer - OnlyUnderscoreInput: "_" (1 char) now kept - LogSearchSuffixIsValid → NineCharSuffixIsAccepted (boundary test) - SearchSuffixIsValid → LongSuffixIsDiscarded - InvalidSuffixPrefixDiscarded / SearchWithoutHyphenIsInvalid / LogSearchWithoutHyphenIsInvalid: updated comments (same outcomes) - ProcessIssueTypeEvntTest comments updated to reflect new rule All 331 tests pass. Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/c6d6fc29-da2a-46af-a417-c2de67a18448 Co-authored-by: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com> refactor: improve RRD_MAX_SUFFIX_LEN comment and rename length-based tests - Expand the RRD_MAX_SUFFIX_LEN comment to explain why 9 chars is the limit - Rename misleading test names that referenced old prefix-based validation: InvalidSuffixPrefixDiscarded → SuffixExceedingMaxLengthDiscarded SearchWithoutHyphenIsInvalid → SuffixSeventeenCharsDiscarded LogSearchWithoutHyphenIsInvalid → SuffixTwentyCharsDiscarded - LongSuffixIsDiscarded: switch to a neutral _1234567890 example so the test does not imply any Search-specific behavior All 331 tests pass. Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/c6d6fc29-da2a-46af-a417-c2de67a18448 Co-authored-by: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com> Update rrdJsonParser.c Update uploadRRDLogs.c Update uploadRRDLogs.c Update rrdJsonParser.c Delete .gitignore Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Update rrdEventProcess.c Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Update rrdJsonParser.c Update rrdEventProcess.c sanitize split_issue_type suffix to [A-Za-z0-9_-] to prevent injection Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/72e164ed-ae53-4076-8fb1-5ff1e21375e9 Co-authored-by: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com> Update rrdEventProcess.c Delete .gitignore Update rrdRunCmdThread.c Update rrdRunCmdThread.h Delete src/unittest/UTJson/device.properties Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Update rrdRunCmdThread.c Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
RDK-60236 : Remote Debugger Supports UUID Information in Debug Report File
| @@ -88,24 +116,52 @@ void processIssueTypeEvent(data_buf *rbuf) | |||
| } | |||
| cmdBuff->appendMode = rbuf->appendMode; | |||
| cmdBuff->mdata = (char *)calloc(1, dataMsgLen); | |||
|
|
|||
| /* Store suffix for this issue type */ | |||
| cmdBuff->suffix = NULL; | |||
| if (local_suffix[0] != '\0') { | |||
| cmdBuff->suffix = strdup(local_suffix); | |||
| if (cmdBuff->suffix == NULL) | |||
| { | |||
| RDK_LOG(RDK_LOG_ERROR, LOG_REMDEBUG, "[%s:%d]: Failed to allocate memory for suffix... \n", __FUNCTION__, __LINE__); | |||
| } | |||
| } | |||
| if (cmdBuff->mdata) | |||
| { | |||
| strncpy((char *)cmdBuff->mdata, cmdMap[index], dataMsgLen); | |||
| strncpy((char *)cmdBuff->mdata, base, dataMsgLen); | |||
| processIssueType(cmdBuff); | |||
| } | |||
| else | |||
| { | |||
| RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: Memory Allocation Failed... \n", __FUNCTION__, __LINE__); | |||
| } | |||
| free(cmdBuff); | |||
| if(cmdBuff) | |||
| { | |||
| if (cmdBuff->suffix) | |||
| { | |||
| free(cmdBuff->suffix); | |||
| cmdBuff->suffix = NULL; | |||
| } | |||
| free(cmdBuff); | |||
| cmdBuff = NULL; | |||
| } | |||
| int rrd_upload_cleanup_source_dir(const char *dir_path) { | ||
| if (!dir_path) return -1; | ||
|
|
||
| RDK_LOG(RDK_LOG_INFO, LOG_REMDEBUG, "%s: Removing source directory: %s\n", __FUNCTION__, dir_path); | ||
|
|
||
| char cmd[1024]; | ||
| snprintf(cmd, sizeof(cmd), "rm -rf %s", dir_path); | ||
|
|
||
| int ret = system(cmd); | ||
| if (ret == 0) { | ||
| RDK_LOG(RDK_LOG_INFO, LOG_REMDEBUG, "%s: Successfully removed source directory: %s\n", | ||
| __FUNCTION__, dir_path); | ||
| return 0; | ||
| } else { | ||
| RDK_LOG(RDK_LOG_ERROR, LOG_REMDEBUG, "%s: Failed to remove source directory: %s (ret: %d)\n", | ||
| __FUNCTION__, dir_path, ret); | ||
| return -1; | ||
| } |
| rbusError_t rc = RBUS_ERROR_BUS_ERROR; | ||
| rbusValue_t value; | ||
| rbusValue_Init(&value); | ||
| rbusValue_SetString(value,"root"); | ||
| rc = rbus_set(rrdRbusHandle, RRD_WEBCFG_FORCE_SYNC, value, NULL); | ||
| if (rc != RBUS_ERROR_SUCCESS) | ||
| #ifndef USE_L2_SUPPORT | ||
| if (rc != RBUS_ERROR_SUCCESS) | ||
| { | ||
| RDK_LOG(RDK_LOG_ERROR, LOG_REMDEBUG, "[%s:%d]: rbus_set failed for [%s] with error [%d]\n\n", __FUNCTION__, __LINE__,RRD_WEBCFG_FORCE_SYNC ,rc); | ||
| return; | ||
| } | ||
| RDK_LOG(RDK_LOG_INFO, LOG_REMDEBUG, "[%s:%d]: Invoking WebCfg Force Sync: %s... \n", __FUNCTION__, __LINE__, RRD_WEBCFG_FORCE_SYNC); | ||
| #else | ||
| #endif | ||
| RDK_LOG(RDK_LOG_INFO, LOG_REMDEBUG, "[%s:%d]: Invoking WebCfg Force Sync: %s... \n", __FUNCTION__, __LINE__, RRD_WEBCFG_FORCE_SYNC); |
| }, | ||
| "DeepSleep": { | ||
| "Audio" : { | ||
| "AudioStatus" : { | ||
| "Commands": "cat /sys/class/avsync_session0/session_stat;cat /sys/class/vdec/vdec_status;hal_dump", | ||
| "Timeout" : 10 | ||
| } | ||
| }, | ||
| "Video" : { | ||
| "VideoStatus" : { | ||
| "Commands": "cat /sys/class/avsync_session0/session_stat;cat /sys/class/vdec/vdec_status;hal_dump", | ||
| "Timeout" : 10 | ||
| } | ||
| }, | ||
| "Process" : { | ||
| "ProcessStatus" : { | ||
| "Commands": "cat /opt/logs/top_log.txt*", | ||
| "Timeout" : 10 | ||
| }, | ||
| "ServiceStatus" : { | ||
| "Commands": "systemctl list-units --type=service --all", | ||
| "Timeout" : 10 | ||
| } | ||
|
|
||
| } | ||
| } |
| remotedebugger_SOURCES = rrdMain.c rrdEventProcess.c rrdJsonParser.c rrdRunCmdThread.c rrdCommandSanity.c rrdDynamic.c rrdExecuteScript.c rrdMsgPackDecoder.c rrdInterface.c | ||
| remotedebugger_CFLAGS = -I$(top_srcdir)/include/rrd -I$(PKG_CONFIG_SYSROOT_DIR)${includedir}/trower-base64/ -I$(PKG_CONFIG_SYSROOT_DIR)${includedir}/rbus/ -I$(PKG_CONFIG_SYSROOT_DIR)${includedir} $(CJSON_CFLAGS) | ||
| AM_LDFLAGS="-lpthread -lrdkloggers -lmsgpackc -ltrower-base64 -lwebconfig_framework -lrbus -lsecure_wrapper " | ||
|
|
||
| remotedebugger_SOURCES = rrdMain.c rrdEventProcess.c rrdJsonParser.c rrdRunCmdThread.c rrdCommandSanity.c rrdDynamic.c rrdExecuteScript.c rrdMsgPackDecoder.c rrdInterface.c | ||
| remotedebugger_CFLAGS = -I$(top_srcdir)/include/rrd -I$(PKG_CONFIG_SYSROOT_DIR)${includedir}/trower-base64/ -I$(PKG_CONFIG_SYSROOT_DIR)${includedir}/rbus/ $(CJSON_CFLAGS) | ||
| AM_LDFLAGS="-lpthread -lrdkloggers -lmsgpackc -ltrower-base64 -lwebconfig_framework -lrbus -lsecure_wrapper" | ||
| if IARMBUS_ENABLE | ||
| remotedebugger_SOURCES += rrdIarmEvents.c | ||
| remotedebugger_SOURCES += rrdIarmEvents.c uploadRRDLogs.c rrd_config.c rrd_sysinfo.c rrd_logproc.c rrd_archive.c rrd_upload.c | ||
| remotedebugger_CFLAGS += -I$(PKG_CONFIG_SYSROOT_DIR)${includedir}/rdk/iarmbus/ -I$(PKG_CONFIG_SYSROOT_DIR)${includedir}/rdk/iarmmgrs/rdmmgr -I$(PKG_CONFIG_SYSROOT_DIR)${includedir}/rdk/iarmmgrs-hal -DIARMBUS_SUPPORT | ||
| AM_LDFLAGS += "-lIARMBus -lrfcapi -ltr181api" | ||
| endif | ||
| remotedebugger_LDFLAGS = $(AM_LDFLAGS) $(CJSON_LDFLAGS) $(CJSON_LIBS) -fno-common | ||
| if IARMBUS_ENABLE | ||
| remotedebugger_LDFLAGS += -luploadstblogs | ||
| remotedebugger_LDADD = -lfwutils -lz -luploadstblogs | ||
| endif |
| yes) L2_SUPPORT_ENABLE=true | ||
| L2_SUPPORT_FLAG="-DUSE_L2_SUPPORT" | ||
| m4_if(m4_sysval,[0],[SUBDIRS_L2_SUPPORT="src"]) ;; | ||
| no) L2_SUPPORT_ENABLE=false AC_MSG_ERROR([L2_SUPPORT is disabled]) ;; |
RRD release 1.3.4 for UUID fix
Create test_rrd_static_profile_report_with_suffix_negative_case.py Potential fix for pull request finding RRD 1.3.4 release changelog updates Fix dynamic subcategory service log assertions for timestamped names Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/f0806557-f409-45cc-8993-700be01b59f2 Remove accidental pycache artifact from test changes Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/f0806557-f409-45cc-8993-700be01b59f2 Update test_rrd_background_cmd_static_profile_report.py Update test_rrd_c_api_upload.py Update test_rrd_debug_report_upload.py Update test_rrd_deepsleep_static_report.py Update test_rrd_dynamic_profile_report.py Update test_rrd_static_profile_category_report.py Update test_rrd_static_profile_report.py Update test_rrd_static_profile_report_with_suffix.py Update test_rrd_static_profile_report_with_suffix_negative_case.py Update test_rrd_background_cmd_static_profile_report.py Update test_rrd_dynamic_profile_missing_report.py Strengthen service-start assertions for timestamped runtime names Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/ec85a8af-7e00-4410-8ca2-4e20cd06cfd4 Add helper docstring for service-start success assertion Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/ec85a8af-7e00-4410-8ca2-4e20cd06cfd4 Improve helper docstring with Args and Raises Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/ec85a8af-7e00-4410-8ca2-4e20cd06cfd4 Refine service-start helper naming and assertion messages Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/ec85a8af-7e00-4410-8ca2-4e20cd06cfd4 Update test_rrd_background_cmd_static_profile_report.py Update test_rrd_dynamic_profile_missing_report.py Add feature files for static suffix report scenarios Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/59dfaf33-25ef-48a2-9549-dd1f571a3b55 L2 Potential fix for pull request finding Update test_rrd_static_profile_report_with_suffix.py Update test_rrd_static_profile_report_with_suffix_negative_case.py Update test_rrd_static_profile_report_with_suffix_negative_case.py Fix service check in negative test case Update test_rrd_static_profile_report_with_suffix_negative_case.py Update test_rrd_dynamic_profile_missing_report.py Update test_rrd_dynamic_profile_missing_report.py Update test_rrd_dynamic_profile_missing_report.py Update test_rrd_dynamic_profile_missing_report.py Update test_rrd_dynamic_profile_missing_report.py Stabilize remotedebugger startup in missing-profile test Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/eafe5a9f-2bbc-448a-966f-61c3067b7239 Remove accidental pycache artifact from PR Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/eafe5a9f-2bbc-448a-966f-61c3067b7239 Replace startup retry magic numbers with constants Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/eafe5a9f-2bbc-448a-966f-61c3067b7239 Remove accidental pycache artifact again Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/eafe5a9f-2bbc-448a-966f-61c3067b7239 Refine remotedebugger PID retry logic in missing-profile test Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/eafe5a9f-2bbc-448a-966f-61c3067b7239 Simplify startup PID retry loop for missing-profile test Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/eafe5a9f-2bbc-448a-966f-61c3067b7239
| def test_remote_debugger_trigger_event(): | ||
| reset_issuetype_rfc() | ||
| sleep(10) | ||
| command = [ | ||
| 'rbuscli', 'set', | ||
| 'Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.RDKRemoteDebugger.IssueType', | ||
| 'string', 'Device.Info_ab1bghjh' | ||
| ] | ||
| result = subprocess.run(command, capture_output=True, text=True) |
| SCRIPT_SUCCESS = "Debug Information Report upload Failed" | ||
| SCRIPT_FAILURE = "Debug Information Report upload Success" | ||
| if SCRIPT_SUCCESS in grep_rrdlogs(SCRIPT_SUCCESS): | ||
| print("Script execution success") | ||
| elif SCRIPT_FAILURE in grep_rrdlogs(SCRIPT_FAILURE): | ||
| print("Script execution failed") | ||
| else: |
| # Test Case 1: Set profile data to "all" and get all categories | ||
| print("Test Case 1: Setting profile data to 'all'") | ||
| stdout, stderr, rc = run_rbuscli_cmd(f'rbuscli set "all" {set_param}') | ||
| print(f"Set command result: stdout='{stdout}', stderr='{stderr}', rc={rc}") | ||
| assert rc == 0, f"rbuscli set 'all' failed: {stderr}" |
| int rrd_upload_cleanup_source_dir(const char *dir_path) { | ||
| if (!dir_path) return -1; | ||
|
|
||
| RDK_LOG(RDK_LOG_INFO, LOG_REMDEBUG, "%s: Removing source directory: %s\n", __FUNCTION__, dir_path); | ||
|
|
||
| char cmd[1024]; | ||
| snprintf(cmd, sizeof(cmd), "rm -rf %s", dir_path); | ||
|
|
||
| int ret = system(cmd); | ||
| if (ret == 0) { |
| while (1) | ||
| { | ||
| RDK_LOG(RDK_LOG_INFO, LOG_REMDEBUG, "[%s:%d]:Waiting for for TR69/RBUS Events... \n", __FUNCTION__, __LINE__); | ||
|
|
||
| if (msgrcv(msqid, (void *)&msgHdr, sizeof(void *), 0, 0) < 0) | ||
| { | ||
| RDK_LOG(RDK_LOG_ERROR, LOG_REMDEBUG, "[%s:%d]:Message Reception failed for Message Queue Id:[%d]!!! \n", __FUNCTION__, __LINE__, msqid); | ||
| break; | ||
| } | ||
| rbuf = (data_buf *)msgHdr.mbody; | ||
| RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]:SUCCESS: Message Reception Done for ID=%d MSG=%s TYPE=%u... \n", __FUNCTION__, __LINE__, msqid, rbuf->mdata, rbuf->mtype); | ||
|
|
||
| switch (rbuf->mtype) | ||
| { | ||
| case EVENT_MSG: | ||
| processIssueTypeEvent(rbuf); | ||
| break; | ||
| case EVENT_WEBCFG_MSG: | ||
| processWebCfgTypeEvent(rbuf); | ||
| break; | ||
| case DEEPSLEEP_EVENT_MSG: | ||
| /*Process Deep Sleep Events*/ | ||
| RRDProcessDeepSleepAwakeEvents(rbuf); | ||
| break; | ||
| default: | ||
| RDK_LOG(RDK_LOG_ERROR, LOG_REMDEBUG, "[%s:%d]: Invalid Message Type %d!!!\n", __FUNCTION__, __LINE__, rbuf->mtype); | ||
| free(rbuf->mdata); | ||
| free(rbuf); | ||
| break; | ||
| } | ||
| } | ||
|
|
||
| return arg; | ||
| } | ||
|
|
||
| bool isRRDEnabled(void) | ||
| { | ||
| bool ret = true; | ||
| RFC_ParamData_t param; | ||
| WDMP_STATUS status = getRFCParameter("RDKRemoteDebugger", RRD_RFC, ¶m); | ||
| if(status == WDMP_SUCCESS || status == WDMP_ERR_DEFAULT_VALUE) { | ||
| RDK_LOG(RDK_LOG_DEBUG,LOG_REMDEBUG,"[%s:%d]:getRFCParameter() name=%s,type=%d,value=%s\n", __FUNCTION__, __LINE__, param.name, param.type, param.value); | ||
| if (strcasecmp("false", param.value) == 0) { | ||
| ret = false; | ||
| } | ||
| } | ||
| else { | ||
| RDK_LOG(RDK_LOG_DEBUG,LOG_REMDEBUG,"[%s:%d]:ERROR in getRFCParameter()\n", __FUNCTION__, __LINE__); | ||
| } | ||
|
|
||
| return ret; | ||
| } | ||
|
|
||
| int main(int argc, char *argv[]) | ||
|
|
||
| { | ||
| pthread_t RRDTR69ThreadID; | ||
|
|
||
| rdk_logger_init(DEBUG_INI_FILE); | ||
|
|
||
| /* Store Device Info.*/ | ||
| RRDStoreDeviceInfo(&devPropData); | ||
|
|
||
| /* Initialize Cache */ | ||
| initCache(); | ||
|
|
||
| /* Check RRD Enable RFC */ | ||
| bool isEnabled = isRRDEnabled(); | ||
| if(!isEnabled) { | ||
| RDK_LOG(RDK_LOG_DEBUG,LOG_REMDEBUG,"[%s:%d]:RFC is disabled, stopping remote-debugger\n", __FUNCTION__, __LINE__); | ||
| exit(0); | ||
| } | ||
|
|
||
| RDK_LOG(RDK_LOG_DEBUG,LOG_REMDEBUG,"[%s:%d]:Starting RDK Remote Debugger Daemon \n",__FUNCTION__,__LINE__); | ||
| if ((msqid = msgget(key, IPC_CREAT | 0666 )) < 0) | ||
| { | ||
| RDK_LOG(RDK_LOG_ERROR,LOG_REMDEBUG,"[%s:%d]:Message Queue ID Creation failed, msqid=%d!!!\n",__FUNCTION__,__LINE__,msqid); | ||
| exit(1); | ||
| } | ||
| RDK_LOG(RDK_LOG_DEBUG,LOG_REMDEBUG,"[%s:%d]:SUCCESS: Message Queue ID Creation Done, msqid=%d...\n",__FUNCTION__,__LINE__,msqid); | ||
|
|
||
| RRD_subscribe(); | ||
| RDK_LOG(RDK_LOG_DEBUG,LOG_REMDEBUG,"[%s:%d]:Started RDK Remote Debugger Daemon \n",__FUNCTION__,__LINE__); | ||
|
|
||
| IARM_Bus_RDMMgr_EventData_t eventData; | ||
| strcpy(eventData.rdm_pkg_info.pkg_name, "RDK-RRD-DEEPSLEEP"); | ||
| strcpy(eventData.rdm_pkg_info.pkg_inst_path, "/media/apps/RDK-RRD-DEEPSLEEP"); | ||
| eventData.rdm_pkg_info.pkg_inst_status = RDM_PKG_INSTALL_COMPLETE; | ||
|
|
||
| const char *owner = IARM_BUS_RDMMGR_NAME; | ||
| IARM_EventId_t eventId = IARM_BUS_RDMMGR_EVENT_APP_INSTALLATION_STATUS; | ||
| size_t len = sizeof(IARM_Bus_RDMMgr_EventData_t); | ||
| pthread_create(&RRDTR69ThreadID, NULL, RRDEventThreadFunc, NULL); | ||
| // Give the thread a moment to start (optional but helpful) | ||
| sleep(1); | ||
| PowerController_PowerState_t state1 = POWER_STATE_STANDBY_DEEP_SLEEP; | ||
| PowerController_PowerState_t state2 = POWER_STATE_STANDBY_DEEP_SLEEP; | ||
| void* userdata = NULL; | ||
| _pwrManagerEventHandler(state1, state2, userdata); | ||
| state2 = POWER_STATE_ON; | ||
| _pwrManagerEventHandler(state1, state2, userdata); | ||
| sleep(2); | ||
| _rdmManagerEventHandler(owner, eventId, &eventData, len); | ||
| // Now wait for the thread to finish (if it ever does) | ||
| pthread_join(RRDTR69ThreadID, NULL); | ||
| RDK_LOG(RDK_LOG_DEBUG,LOG_REMDEBUG,"[%s:%d]:Stopping RDK Remote Debugger Daemon \n",__FUNCTION__,__LINE__); |
| AC_ARG_ENABLE([L2support], | ||
| AS_HELP_STRING([--enable-L2support],[enable L2support (default is no)]), | ||
| [ | ||
| case "${enableval}" in | ||
| yes) L2_SUPPORT_ENABLE=true | ||
| L2_SUPPORT_FLAG="-DUSE_L2_SUPPORT" | ||
| m4_if(m4_sysval,[0],[SUBDIRS_L2_SUPPORT="src"]) ;; | ||
| no) L2_SUPPORT_ENABLE=false AC_MSG_ERROR([L2_SUPPORT is disabled]) ;; | ||
| *) AC_MSG_ERROR([bad value ${enableval} for --enable-L2support]) ;; | ||
| esac | ||
| ], | ||
| [echo "L2support is disabled"]) | ||
|
|
| # Define the libraries to link against | ||
| COMMON_LDADD = -lgtest -lgtest_main -lgmock_main -lgmock -lcjson -lmsgpackc -lgcov | ||
| COMMON_LDADD = -lgtest -lgtest_main -lgmock_main -lgmock -lcjson -lmsgpackc -lgcov -lz | ||
|
|
||
| # Define the compiler flags | ||
| COMMON_CXXFLAGS = -frtti -fprofile-arcs -ftest-coverage | ||
| COMMON_CXXFLAGS = -frtti -fprofile-arcs -ftest-coverage -fpermissive | ||
|
|
| rbusError_t rc = RBUS_ERROR_BUS_ERROR; | ||
| rbusValue_t value; | ||
| rbusValue_Init(&value); | ||
| rbusValue_SetString(value,"root"); | ||
| rc = rbus_set(rrdRbusHandle, RRD_WEBCFG_FORCE_SYNC, value, NULL); | ||
| if (rc != RBUS_ERROR_SUCCESS) | ||
| #ifndef USE_L2_SUPPORT | ||
| if (rc != RBUS_ERROR_SUCCESS) | ||
| { | ||
| RDK_LOG(RDK_LOG_ERROR, LOG_REMDEBUG, "[%s:%d]: rbus_set failed for [%s] with error [%d]\n\n", __FUNCTION__, __LINE__,RRD_WEBCFG_FORCE_SYNC ,rc); | ||
| return; | ||
| } | ||
| RDK_LOG(RDK_LOG_INFO, LOG_REMDEBUG, "[%s:%d]: Invoking WebCfg Force Sync: %s... \n", __FUNCTION__, __LINE__, RRD_WEBCFG_FORCE_SYNC); | ||
| #else | ||
| #endif |
… File (#199) * Create rrd_uuid_support_implementation.HLD * Rename rrd_uuid_support_implementation.HLD to rrd_uuid_support_implementation_HLD.md * Update rrd_uuid_support_implementation_HLD.md * Move docs from .github directory --------- Co-authored-by: Abhinav P V <Abhinav_Valappil@comcast.com> Co-authored-by: nhanasi <navihansi@gmail.com>
| RDK_LOG(RDK_LOG_INFO,LOG_REMDEBUG,"[%s:%d]: Stopping %s service...\n",__FUNCTION__,__LINE__,remoteDebuggerServiceStr); | ||
| #if !defined(GTEST_ENABLE) | ||
| v_secure_system("systemctl stop %s", remoteDebuggerServiceStr); | ||
| v_secure_system("systemctl reset-failed %s", remoteDebuggerServiceStr); | ||
| free(cmdData->rfcvalue); // free rfcvalue received from RRDEventThreadFunc | ||
| free(cmdData->command); // free updated command info received from RRDEventThreadFunc | ||
| free(cmdData); | ||
| #endif |
| def test_second_remotedebugger_instance_is_not_started(): | ||
| kill_rrd() | ||
| sleep(2) | ||
| command_to_get_pid = "pidof remotedebugger" | ||
| pid1 = run_shell_command(command_to_get_pid) | ||
| pid1 = run_shell_command(command_to_get_pid).strip().split() | ||
|
|
||
| if is_remotedebugger_running(): | ||
| print("remotedebugger process is already running") | ||
| print(f"remotedebugger process is already running with PID(s): {pid1}") | ||
| else: | ||
| command_to_start = "nohup /usr/local/bin/remotedebugger > /dev/null 2>&1 &" | ||
| run_shell_silent(command_to_start) | ||
| sleep(2) | ||
| pid1 = run_shell_command(command_to_get_pid).strip().split() |
| print("Test Case 1: Setting profile data to 'all'") | ||
| stdout, stderr, rc = run_rbuscli_cmd(f'rbuscli set "all" {set_param}') | ||
| print(f"Set command result: stdout='{stdout}', stderr='{stderr}', rc={rc}") | ||
| assert rc == 0, f"rbuscli set 'all' failed: {stderr}" |
No description provided.