Skip to content

rebase#129

Open
Abhinavpv28 wants to merge 50 commits into
feature/new_testfrom
develop
Open

rebase#129
Abhinavpv28 wants to merge 50 commits into
feature/new_testfrom
develop

Conversation

@Abhinavpv28
Copy link
Copy Markdown
Contributor

No description provided.

Abhinavpv28 and others added 6 commits May 5, 2025 15:49
…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>
@Abhinavpv28 Abhinavpv28 requested a review from a team as a code owner May 17, 2025 16:08
@Abhinavpv28 Abhinavpv28 requested a review from a team May 17, 2025 16:08
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented May 17, 2025

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
5 out of 6 committers have signed the CLA.

✅ nhanasi
✅ venkat0557
✅ Abhinavpv28
✅ AravindanNC
✅ Alan-Ryan
❌ naveenkumarhanasi
You have signed the CLA already but the status is still pending? Let us recheck it.

naveenkumarhanasi and others added 21 commits May 19, 2025 16:40
Added release to fix remotedebugger bug fixes
… process exited with error code." (#134)

* Update rrdRunCmdThread.c

* Update rrdRunCmdThread.c

* Update rrdRunCmdThread.c

* Update rrdRunCmdThread.c

* Update rrdRunCmdThread.c
…rogress (#136)

* Update rrdInterface.c

* Update rrdInterface.c

* Update rrdInterface.c
Release 1.2.8 tag for RRD
* Update Client_Mock.cpp

* Update Client_Mock.h

* Update rrdUnitTestRunner.cpp

* Update rrdUnitTestRunner.cpp

* Update rrdUnitTestRunner.cpp

* Update rrdInterface.c

* Update rrdInterface.h

* Update rrdRunCmdThread.c

* Update rrdIarmEvents.c

* Update rrdInterface.h

* Update rrdDynamic.c

* Update code-coverage.yml
Create deepsleep_main.c

Update Makefile

Create power_controller.h

Update run_l2.sh

Update cov_build.sh

Create pwrMgr.h

Update cov_build.sh

Update cov_build.sh

Update Makefile

Rename deepsleep_main.c to main.c

Update Makefile

update Makefile

Delete test/functional-tests/tests/rrdIarmEvents.c

Update run_l2.sh

Update remote_debugger.json

Update remote_debugger.json

Create test_deepsleep_static.py

Update run_l2.sh

Update run_l2.sh

Create test_deepsleep_dynamic.py

Update run_l2.sh

Update rrdInterface.c

Update create_json.sh

Create test_append.py

Create test_category.py

Update test_rrd_dynamic_profile_missing_report.py

Create test_rrd_dynamic_with_download_harmful.py

Create test_rrd_negative.py

Update configure.ac

Update cov_build.sh

Update run_l2.sh

Update main.c

Rename main.c to deepsleep_main.c

Update Makefile

Create rrd_append_report.feature

Create rrd_deepsleep_static.feature

Create rrd_deepsleep_dynamic.feature

Create rrd_dynamic_with_download_harmful_report.feature

Update rrd_dynamic_profile_missing_report.feature

Update test_rrd_dynamic_profile_missing_report.py

Update cov_build.sh

Update test_rrd_single_instance.py

Update test_category.py

Update run_l2.sh

Update test_rrd_dynamic_profile_missing_report.py

Update rrdInterface.c

Update rrdInterface.c

Update rrdInterface.c

Update rrdIarmEvents.c

Update rrdIarmEvents.c

Delete test/functional-tests/tests/test_deepsleep_dynamic.py

Delete test/functional-tests/tests/test_rrd_negative.py

Update run_l2.sh

Update test_category.py

Update cov_build.sh

Update configure.ac

Update configure.ac

Delete test/functional-tests/features/rrd_deepsleep_dynamic.feature

Update rrd_dynamic_profile_missing_report.feature

Update rrd_dynamic_profile_missing_report.feature

Delete test/functional-tests/tests/test_rrd_dynamic_with_download_harmful.py

Delete test/functional-tests/tests/deepsleep_main.c

Delete test/functional-tests/tests/Makefile

Update run_l2.sh

Update run_l2.sh

Delete test/functional-tests/features/rrd_dynamic_with_download_harmful_report.feature

Create rrd_dynamic_profile_subcategory_report.feature

Update run_l2.sh

Rename test_append.py to test_rrd_append_report.py

Rename test_category.py to test_rrd_dynamic_subcategory_report.py

Rename test_deepsleep_static.py to test_rrd_deepsleep_static_report.py

Rename rrd_deepsleep_static.feature to rrd_deepsleep_static_report.feature

Update rrd_dynamic_profile_missing_report.feature

Update rrd_dynamic_profile_missing_report.feature

Update rrd_dynamic_profile_missing_report.feature
RDK-56291 - [RDKE] Increase L2 Test Coverage For Remote Debugger : Target 80% [ Phase 2 ]
Deploy fossid_integration_stateless_diffscan_target_repo action
…rget 80% [ Phase 2 ] (#157)

* Update rrdInterface.c

* Update rrdIarmEvents.c

* Update configure.ac

* Update cov_build.sh

* Update remote_debugger.json

* Update create_json.sh

* Create Makefile

* Create deepsleep_main.c

---------

Co-authored-by: nhanasi <navihansi@gmail.com>
Copilot AI review requested due to automatic review settings March 20, 2026 19:00
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 63 out of 63 changed files in this pull request and generated 9 comments.

Comment on lines +4 to +26
# 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)
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test module performs file I/O and overwrites /etc/rrd/remote_debugger.json at import time. If the file is missing or the test runner lacks permissions, collection will fail before any tests run, and it also makes the suite order-dependent. Move this JSON read/update/write logic into a dedicated test (or a setup/fixture) and prefer writing to a temporary copy of the config rather than mutating /etc directly.

Copilot uses AI. Check for mistakes.
Comment thread src/rrdEventProcess.c
Comment on lines 145 to 302
pIssueNode = (issueNodeData *)malloc(sizeof(issueNodeData));
if(pIssueNode)
{
getIssueInfo((char *)rbuf->mdata, pIssueNode); // issue data extract
RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: Extracted Node %s and Sub Node %s \n", __FUNCTION__, __LINE__, pIssueNode->Node, pIssueNode->subNode);
if (rbuf->appendMode)
{
RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: Received append request to process static and dynamic profiles... \n", __FUNCTION__, __LINE__);
RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: Reading dynamic profile command info... \n", __FUNCTION__, __LINE__);
dynamicprofiledata = processIssueTypeInDynamicProfileappend(rbuf, pIssueNode);
if (dynamicprofiledata == NULL)
{
RDK_LOG(RDK_LOG_INFO, LOG_REMDEBUG, "[%s:%d]: Dynamic Profie Info not found, Download RDM package... \n", __FUNCTION__, __LINE__);
}
else
{
RDK_LOG(RDK_LOG_INFO, LOG_REMDEBUG, "[%s:%d]: Read complete for Dynamic Profile: RFCValue: %s, Command: %s, Timeout: %d... \n", __FUNCTION__, __LINE__, dynamicprofiledata->rfcvalue, dynamicprofiledata->command, dynamicprofiledata->timeout);
RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: Reading static profile command info... \n", __FUNCTION__, __LINE__);
staticprofiledata = processIssueTypeInStaticProfileappend(rbuf, pIssueNode);
if (staticprofiledata == NULL)
{
RDK_LOG(RDK_LOG_INFO, LOG_REMDEBUG, "[%s:%d]: Static Command Info not found for IssueType!!! \n", __FUNCTION__, __LINE__);
// Free dynamicprofiledata since we can't proceed
if (dynamicprofiledata != NULL)
{
if (dynamicprofiledata->rfcvalue != NULL)
{
free(dynamicprofiledata->rfcvalue);
}
if (dynamicprofiledata->command != NULL)
{
free(dynamicprofiledata->command);
}
free(dynamicprofiledata);
}
}
else
{
RDK_LOG(RDK_LOG_INFO, LOG_REMDEBUG, "[%s:%d]: Read complete for Static Profile: RFCValue: %s, Command: %s, Timeout: %d... \n", __FUNCTION__, __LINE__, staticprofiledata->rfcvalue, staticprofiledata->command, staticprofiledata->timeout);
//Remove the double quotes
size_t staticstrlen = strlen(staticprofiledata->command);
size_t dynamicstrlen = strlen(dynamicprofiledata->command);
if (staticstrlen > 0 && staticprofiledata->command[staticstrlen - 1] == '"') {
staticprofiledata->command[staticstrlen - 1] = '\0';
}
if (dynamicprofiledata->command[0] == '"') {
dynamicprofiledata->command[0] = COMMAND_DELIM;

// Check if commands are NULL before using them
if (dynamicprofiledata->command == NULL || staticprofiledata->command == NULL)
{
RDK_LOG(RDK_LOG_ERROR, LOG_REMDEBUG, "[%s:%d]: Command is NULL in dynamic or static profile... \n", __FUNCTION__, __LINE__);
// Free dynamicprofiledata
if (dynamicprofiledata != NULL)
{
if (dynamicprofiledata->rfcvalue != NULL)
{
free(dynamicprofiledata->rfcvalue);
}
if (dynamicprofiledata->command != NULL)
{
free(dynamicprofiledata->command);
}
free(dynamicprofiledata);
}
// Free staticprofiledata
if (staticprofiledata != NULL)
{
if (staticprofiledata->rfcvalue != NULL)
{
free(staticprofiledata->rfcvalue);
}
if (staticprofiledata->command != NULL)
{
free(staticprofiledata->command);
}
free(staticprofiledata);
}
}
RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: Static Profile Commands: %s, Dynamic Profile Commands: %s\n", __FUNCTION__, __LINE__, staticprofiledata->command, dynamicprofiledata->command);

size_t appendstrlen = ((staticstrlen - 1) + dynamicstrlen + 1);
char *appendcommandstr = (char *)realloc(staticprofiledata->command, appendstrlen);
if (appendcommandstr == NULL) {
RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: Memory Allocation Failed... \n", __FUNCTION__, __LINE__);
else
{
//Remove the double quotes
size_t staticstrlen = strlen(staticprofiledata->command);
size_t dynamicstrlen = strlen(dynamicprofiledata->command);
if (staticstrlen > 0 && staticprofiledata->command[staticstrlen - 1] == '"') {
staticprofiledata->command[staticstrlen - 1] = '\0';
staticstrlen--; // Update length after removing trailing quote
}
if (dynamicprofiledata->command[0] == '"') {
dynamicprofiledata->command[0] = COMMAND_DELIM;
}
RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: Static Profile Commands: %s, Dynamic Profile Commands: %s\n", __FUNCTION__, __LINE__, staticprofiledata->command, dynamicprofiledata->command);

size_t appendstrlen = (staticstrlen + dynamicstrlen + 1);
char *appendcommandstr = (char *)realloc(staticprofiledata->command, appendstrlen);
if (appendcommandstr == NULL) {
RDK_LOG(RDK_LOG_ERROR, LOG_REMDEBUG, "[%s:%d]: Memory Allocation Failed... \n", __FUNCTION__, __LINE__);
// Free staticprofiledata on realloc failure
if (staticprofiledata != NULL)
{
if (staticprofiledata->rfcvalue != NULL)
{
free(staticprofiledata->rfcvalue);
}
if (staticprofiledata->command != NULL)
{
free(staticprofiledata->command);
}
free(staticprofiledata);
staticprofiledata = NULL; // Set to NULL to prevent double-free
}
// Free dynamicprofiledata on realloc failure
if (dynamicprofiledata != NULL)
{
if (dynamicprofiledata->rfcvalue != NULL)
{
free(dynamicprofiledata->rfcvalue);
}
if (dynamicprofiledata->command != NULL)
{
free(dynamicprofiledata->command);
}
free(dynamicprofiledata);
dynamicprofiledata = NULL; // Set to NULL to prevent double-free
}
}
else
{
strcat(appendcommandstr, dynamicprofiledata->command);
staticprofiledata->command = appendcommandstr;
RDK_LOG(RDK_LOG_INFO, LOG_REMDEBUG, "[%s:%d]: Updated command after append from dynamic and static profile: %s \n", __FUNCTION__, __LINE__, staticprofiledata->command);
RDK_LOG(RDK_LOG_DEBUG,LOG_REMDEBUG,"[%s:%d]: Executing Commands in Runtime Service... \n",__FUNCTION__,__LINE__);
checkIssueNodeInfo(pIssueNode, NULL, rbuf, false, staticprofiledata);
// NOTE: staticprofiledata is freed by executeCommands() via checkIssueNodeInfo()
// Do NOT free staticprofiledata here to avoid double-free
}
// Free dynamicprofiledata after use
if (dynamicprofiledata != NULL)
{
if (dynamicprofiledata->rfcvalue != NULL)
{
free(dynamicprofiledata->rfcvalue);
}
if (dynamicprofiledata->command != NULL)
{
free(dynamicprofiledata->command);
}
free(dynamicprofiledata);
}
}
strcat(appendcommandstr, dynamicprofiledata->command);
staticprofiledata->command = appendcommandstr;
RDK_LOG(RDK_LOG_INFO, LOG_REMDEBUG, "[%s:%d]: Updated command after append from dynamic and static profile: %s \n", __FUNCTION__, __LINE__, staticprofiledata->command);
RDK_LOG(RDK_LOG_DEBUG,LOG_REMDEBUG,"[%s:%d]: Executing Commands in Runtime Service... \n",__FUNCTION__,__LINE__);
checkIssueNodeInfo(pIssueNode, NULL, rbuf, false, staticprofiledata);
}
}
}
else if (rbuf->inDynamic)
{
RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: Checking if Issue marked inDynamic... \n", __FUNCTION__, __LINE__);
processIssueTypeInDynamicProfile(rbuf, pIssueNode);
}
else
{
RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: Issue not marked as inDynamic... \n", __FUNCTION__, __LINE__);
RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: Checking Issue from Static... \n", __FUNCTION__, __LINE__);
processIssueTypeInStaticProfile(rbuf, pIssueNode);
}
//CID-336989: Resource leak
free(pIssueNode);
}
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

processIssueType() allocates pIssueNode via malloc() but it is never freed on any path (the previous free(pIssueNode) was removed). Since this runs per event, this introduces an unbounded memory leak in the daemon. Ensure pIssueNode is freed before returning (including error paths), and avoid freeing it inside helpers that don't own it.

Copilot uses AI. Check for mistakes.
Comment thread src/rrd_upload.c
Comment on lines +188 to +206
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;
}
}
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rrd_upload_cleanup_source_dir() builds a shell command and calls system("rm -rf %s"). This is vulnerable to command injection if dir_path contains shell metacharacters, and it also violates the project's stated goal of avoiding system() calls where possible. Replace this with a safe recursive deletion implementation (e.g., nftw()/unlinkat() traversal) and validate that dir_path is within an expected base directory before deleting.

Copilot uses AI. Check for mistakes.
Comment thread src/rrd_archive.c
Comment on lines +99 to +109
/* 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';
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

write_tar_header() splits long paths into prefix/name by taking an arbitrary cut (prefix_len = name_len - 101). This doesn't respect tar's requirement that the split occur on a '/' boundary, and can produce archives with invalid/incorrect entry names for paths >100 chars. Prefer splitting at the last '/' that keeps prefix<=155 and name<=100 (or reject paths that can't be represented).

Suggested change
/* 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';
/* split into prefix and name at a '/' boundary according to POSIX ustar */
size_t split_index = (size_t)-1;
size_t prefix_len = 0;
size_t name_part_len = 0;
/* search for the rightmost '/' that yields valid prefix/name lengths */
for (size_t i = name_len; i > 0; --i) {
if (name[i - 1] == '/') {
size_t p_len = i - 1; /* characters before '/' */
size_t n_len = name_len - i; /* characters after '/' */
if (p_len > 0 &&
p_len <= sizeof(hdr.prefix) - 1 &&
n_len > 0 &&
n_len <= sizeof(hdr.name) - 1) {
split_index = i - 1;
prefix_len = p_len;
name_part_len = n_len;
break;
}
}
}
if (split_index == (size_t)-1) {
RDK_LOG(RDK_LOG_ERROR, LOG_REMDEBUG, "[%s] File name too long: %s (length %zu)\n",
__FUNCTION__, name, name_len);
return -1;
}
/* copy prefix and name parts, ensuring null termination */
strncpy(hdr.prefix, name, prefix_len);
hdr.prefix[prefix_len] = '\0';
strncpy(hdr.name, name + split_index + 1, name_part_len);
hdr.name[name_part_len] = '\0';

Copilot uses AI. Check for mistakes.
Comment thread run_l2.sh
mkdir -p /media/apps/RDK-RRD-Test/etc/rrd

touch /media/apps/RDK-RRD-Test/etc/rrd/remote_debugger.json
echo "AA:BB:CC:DD:EE:FF" >> /tmp/.estb_mac
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This appends the mock MAC to /tmp/.estb_mac on every run, which will accumulate multiple lines and can break any code that expects a single MAC value. Use overwrite (>) or truncate the file before writing the mock MAC.

Suggested change
echo "AA:BB:CC:DD:EE:FF" >> /tmp/.estb_mac
echo "AA:BB:CC:DD:EE:FF" > /tmp/.estb_mac

Copilot uses AI. Check for mistakes.
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
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in step text: "shopuld" should be "should".

Copilot uses AI. Check for mistakes.
Comment on lines +54 to +55
THERMAL_TEMPERATURE_CRITICAL = 4 /* Critial Thermal Temperature */
} PowerController_ThermalTemperature_t;
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in enum comment: "Critial" should be "Critical".

Copilot uses AI. Check for mistakes.
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
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in step text: "shopuld" should be "should".

Copilot uses AI. Check for mistakes.
Comment thread src/rrd_config.c
Comment on lines +110 to +116
// Check BUILD_TYPE for prod override logic (matching shell script lines 81-83)
bool is_prod_with_override = (strcmp(config->build_type, "prod") != 0 && file_exists("/opt/dcm.properties"));
if (is_prod_with_override) {
RDK_LOG(RDK_LOG_WARN, LOG_REMDEBUG,
"%s: Configurable service end-points will not be used for %s Builds due to overriden /opt/dcm.properties!!!\n",
__FUNCTION__, config->build_type);
} else {
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The boolean name is_prod_with_override doesn't match its condition (BUILD_TYPE != prod && /opt/dcm.properties exists). This makes the override logic hard to reason about and easy to misread. Rename it to reflect the actual condition (e.g., non_prod_with_opt_dcm_override) or adjust the condition to match the name.

Copilot uses AI. Check for mistakes.
nhanasi and others added 2 commits April 10, 2026 14:32
* 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
Copilot AI review requested due to automatic review settings April 23, 2026 14:20
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 81 out of 81 changed files in this pull request and generated 8 comments.

Comment on lines +47 to +52
pid2 = run_shell_command(command_to_get_pid).strip().split()

# Assert only one PID exists (no second instance)
assert len(pid2) == 1, f"A second instance of remotedebugger was started: {pid2}"
# ensure it's the same PID as before
assert pid1[0] == pid2[0], f"PID changed unexpectedly: before={pid1}, after={pid2}"
Copy link

Copilot AI Apr 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pid1 can be an empty list if remotedebugger fails to start (or pidof returns nothing). The later pid1[0] indexing will raise IndexError and hide the real failure. Add an explicit assertion that pid1 is non-empty after the start attempt (and possibly assert pid2 is non-empty too) before comparing PIDs.

Copilot uses AI. Check for mistakes.
Comment thread configure.ac
Comment on lines +65 to +76
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"])
Copy link

Copilot AI Apr 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The --enable-L2support option currently sets L2_SUPPORT_FLAG/SUBDIRS_L2_SUPPORT but neither is substituted nor used by any Makefile, so enabling it has no effect. Also, passing --enable-L2support=no hard-errors even though the help says the default is no. Consider (1) AC_SUBST'ing L2_SUPPORT_FLAG and wiring it into AM_CFLAGS/CPPFLAGS, or (2) removing the option if it's not needed, and avoid AC_MSG_ERROR for the 'no' case.

Copilot uses AI. Check for mistakes.
Comment on lines +149 to +155
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:
Copy link

Copilot AI Apr 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SCRIPT_SUCCESS/SCRIPT_FAILURE variables are reversed: SCRIPT_SUCCESS is set to the 'upload Failed' log line and SCRIPT_FAILURE to the 'upload Success' line, which makes the printed status misleading. Swap the constants (or rename them) so the variable name matches the log meaning.

Copilot uses AI. Check for mistakes.
Comment on lines +49 to +50
And Command output shopuld be added to the output file
And the issuetype systemd service should start successfully
Copy link

Copilot AI Apr 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in step text: "shopuld" → "should".

Copilot uses AI. Check for mistakes.
Comment on lines +39 to +40
And Command output shopuld be added to the output file
And the issuetype systemd service should start successfully
Copy link

Copilot AI Apr 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in step text: "shopuld" → "should".

Copilot uses AI. Check for mistakes.
Comment thread src/rrd_upload.c
Comment on lines +188 to +197
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) {
Copy link

Copilot AI Apr 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rrd_upload_cleanup_source_dir builds a shell command with an unquoted dir_path and passes it to system("rm -rf %s"). If dir_path is ever influenced by external input, this becomes a command-injection risk and can delete unintended paths (spaces/globs). Prefer a non-shell recursive delete (nftw/unlinkat) and/or strictly validate/escape the directory path before deletion.

Copilot uses AI. Check for mistakes.
Comment thread src/rrd_sysinfo.h
Comment on lines +37 to +42
/* Get the device MAC address.
* @param mac_addr Buffer to store MAC address (min 18 bytes)
* @param size Size of buffer
* @return 0 on success, -1 on error
*/
int rrd_sysinfo_get_mac_address(char *mac_addr, size_t size);
Copy link

Copilot AI Apr 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The header comment says the MAC buffer must be at least 18 bytes, but the implementation strips colons and only needs 13 bytes (12 hex chars + NUL). Update the comment to match the actual required size (or change the implementation to return the colon-separated form).

Copilot uses AI. Check for mistakes.
Comment thread run_l2.sh
Comment on lines +33 to +34
echo "AA:BB:CC:DD:EE:FF" >> /tmp/.estb_mac

Copy link

Copilot AI Apr 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This appends to /tmp/.estb_mac on every run, which can create a multi-line MAC file and break consumers expecting a single MAC value. Use overwrite (>) or ensure the file is truncated before writing.

Copilot uses AI. Check for mistakes.
naveenkumarhanasi and others added 5 commits April 23, 2026 17:47
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
Copilot AI review requested due to automatic review settings May 14, 2026 01:01
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 83 out of 84 changed files in this pull request and generated 5 comments.

Comment thread remote_debugger.json
}
}
},
"DeepSleep": {

# 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}')
Comment thread src/rrdRunCmdThread.c
Comment on lines +379 to +390
time_t epochTime = time(NULL);
snprintf(remoteDebuggerServiceStr, sizeof(remoteDebuggerServiceStr),"%s%s%ld", remoteDebuggerPrefix, cmdData->rfcvalue, (long)epochTime);
removeQuotes(cmdData->command);

FILE *systemdfp = v_secure_popen("r", "systemd-run -r --unit=%s --service-type=oneshot /bin/sh -c %s", remoteDebuggerServiceStr, cmdData->command);
FILE *systemdfp = v_secure_popen("r", "systemd-run -r --unit=%s --service-type=oneshot -p RemainAfterExit=yes /bin/sh -c %s", remoteDebuggerServiceStr, cmdData->command);
if(systemdfp == NULL)
{
RDK_LOG(RDK_LOG_ERROR,LOG_REMDEBUG,"[%s:%d]: Starting remote_debugger_%s service failed!!!\n",__FUNCTION__,__LINE__,cmdData->rfcvalue);
RDK_LOG(RDK_LOG_ERROR,LOG_REMDEBUG,"[%s:%d]: Starting %s service failed!!!\n",__FUNCTION__,__LINE__,remoteDebuggerServiceStr);
}
else
{
RDK_LOG(RDK_LOG_INFO,LOG_REMDEBUG,"[%s:%d]: Starting remote_debugger_%s service success...\n",__FUNCTION__,__LINE__,cmdData->rfcvalue);
RDK_LOG(RDK_LOG_INFO,LOG_REMDEBUG,"[%s:%d]: Starting %s service success...\n",__FUNCTION__,__LINE__,remoteDebuggerServiceStr);
Comment thread src/rrdEventProcess.c
@@ -191,7 +342,6 @@ static void processIssueType(data_buf *rbuf)
processIssueTypeInStaticProfile(rbuf, pIssueNode);
}
//CID-336989: Resource leak
Comment thread cov_build.sh
Comment on lines +46 to 47
git clone https://github.com/rdkcentral/dcm-agent.git -b develop

naveenkumarhanasi and others added 4 commits May 14, 2026 14:25
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
Copilot AI review requested due to automatic review settings May 19, 2026 14:25
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 88 out of 89 changed files in this pull request and generated 5 comments.

Comment on lines +69 to +70
ISSUE_MSG = f'MSG={ISSUE_STRING}'
assert ISSUE_MSG in grep_rrdlogs(ISSUE_MSG)
Comment on lines +56 to +58
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}"
Comment on lines +34 to +45
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()
Comment thread src/rrdIarmEvents.c
Comment on lines 155 to 165
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;
}
Comment thread src/rrdIarmEvents.c
Comment on lines 221 to 230
@@ -235,7 +229,6 @@ void _pwrManagerEventHandler(const char *owner, IARM_EventId_t eventId, void *da
return;
}
… 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>
Copilot AI review requested due to automatic review settings May 19, 2026 14:45
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 89 out of 90 changed files in this pull request and generated 5 comments.

Comments suppressed due to low confidence (5)

test/functional-tests/tests/test_rrd_profile_data.py:79

  • This rbuscli set invocation has the value before the parameter name, unlike the supported rbuscli set <parameter> string <value> form used by the surrounding functional tests. This will not set setProfileData to Device, so the following get does not validate the intended category path.
    test/functional-tests/tests/test_rrd_profile_data.py:100
  • This command also uses rbuscli set <value> <parameter> instead of the parameter/type/value ordering used elsewhere. Because the category is never written to setProfileData, this test can pass or fail based on stale state rather than validating the Process selection.
    test/functional-tests/tests/test_rrd_profile_data.py:143
  • The negative test uses the same reversed rbuscli set argument order, so it is testing rbuscli's malformed-command handling rather than how setProfileData handles an unknown category. Use the actual profile-data parameter with the string type argument, then assert the expected behavior.
    test/functional-tests/tests/test_rrd_profile_data.py:165
  • This empty-string case is also using a malformed rbuscli set command, so the test never reliably writes an empty value to setProfileData. Please use the same rbuscli set <parameter> string "" form as the other RFC tests before validating the get behavior.
    src/rrdIarmEvents.c:230
  • The RBUS value initialized here is never released after rbus_set, including the error path. Repeated deep-sleep events will leak RBUS value objects; release the value before any return from this branch.

Comment on lines +56 to +58
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}"
Comment thread src/rrdIarmEvents.c
Comment on lines 155 to 165
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;
}
Comment thread cov_build.sh
if [ ! -d tr69hostif ]; then
git clone https://github.com/rdkcentral/tr69hostif.git
fi
git clone https://github.com/rdkcentral/dcm-agent.git -b develop
Comment on lines +34 to +45
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()
Comment on lines +116 to +118
# Clean up
remove_logfile()
kill_rrd()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.