Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
6edfc37
RDK-56115 : [RDKE] Fix coverity issues in RRD
Apr 1, 2025
29662b0
RDK-56115 : Fix for Uninitialised Variable
Apr 1, 2025
f9f44d0
Update rrdIarmEvents.c
Saranya2421 Apr 1, 2025
09006e0
RDk-56115 : Fix for L2 Test Failure
Apr 2, 2025
960b643
Merge branch 'feature/RDK-56115-coverity' of https://github.com/rdkce…
Apr 2, 2025
8f37f99
RDK-56115 : Coverity fix
Apr 2, 2025
6bfd977
RDK-56115 : Fix for coverity in RRD
Apr 2, 2025
4955236
RDK-56115 : Coverity fix
Apr 2, 2025
97e6a6e
RDK-56115: Coverity fix
Apr 2, 2025
e861d4c
RDK-56115 : Dynamic profile Test change
Apr 3, 2025
39b2796
RDK-56115 : Coverity Fix
Apr 3, 2025
b2d91ed
Update rrdJsonParser.c
Saranya2421 Apr 7, 2025
72bd2b1
Update rrdRunCmdThread.c
Saranya2421 Apr 7, 2025
c3c9c09
Merge branch 'develop' into feature/RDK-56115-coverity
Saranya2421 Apr 15, 2025
ffb99f1
Update test_rrd_debug_report_upload.py
Saranya2421 Apr 15, 2025
8163edc
Update test_rrd_debug_report_upload.py
Saranya2421 Apr 15, 2025
d5447f9
Update test_rrd_debug_report_upload.py
Saranya2421 Apr 17, 2025
cc28e73
Merge pull request #108 from rdkcentral/feature/RDK-56115-coverity
Saranya2421 Apr 21, 2025
33d4cd2
1.2.6 release changelog updates
Apr 28, 2025
76e82bc
Merge branch 'release/1.2.6'
Apr 28, 2025
81ef88a
Merge tag '1.2.6' into develop
Apr 28, 2025
e86dd66
RDK-56291 L2 Tests And Integration With CI for Remote Debugger Dynam…
Abhinavpv28 May 5, 2025
e33aa12
RDKEMW-3380 : Evaluate the Deepsleep Scenario for Static and Dynamic …
Abhinavpv28 May 12, 2025
9ce8a74
Revert " RDK-56291 L2 Tests And Integration With CI for Remote Debugg…
nhanasi May 13, 2025
0f3b06d
RDKEMW-3380 : Evaluate the Deepsleep Scenario for Static and Dynamic …
Abhinavpv28 May 15, 2025
3748ea7
[DELIA-68036] RRD failing in device for some commands, getting invali…
Abhinavpv28 May 16, 2025
d893197
1.2.7 release changelog updates
naveenkumarhanasi May 16, 2025
94ee9ee
Merge branch 'release/1.2.7' into main
naveenkumarhanasi May 19, 2025
37a89a1
Merge tag '1.2.7' into develop
naveenkumarhanasi May 19, 2025
6ae85f4
DELIA-68076: RRD Various commands getting "failed because the control…
AravindanNC May 29, 2025
778c4c1
DELIA-68122 - RRD device stopped running RRD commands, logs show no p…
Abhinavpv28 Jun 25, 2025
84074ba
1.2.8 release changelog updates
nhanasi Jun 30, 2025
d5b06c7
Merge branch 'release/1.2.8' into main
nhanasi Jun 30, 2025
6a54657
Merge tag '1.2.8' into develop
nhanasi Jun 30, 2025
3f8ad3a
RDKEMW-5275 Improve L1 Coverage for RemoteDebugger (#143)
Abhinavpv28 Jul 30, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/code-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Code Coverage

on:
pull_request:
branches: [ main ]
branches: [ main, develop]

jobs:
execute-unit-code-coverage-report-on-release:
Expand Down
33 changes: 33 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,45 @@ All notable changes to this project will be documented in this file. Dates are d

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### [1.2.8](https://github.com/rdkcentral/remote_debugger/compare/1.2.7...1.2.8)

- DELIA-68122 - RRD device stopped running RRD commands, logs show no progress [`#136`](https://github.com/rdkcentral/remote_debugger/pull/136)
- DELIA-68076: RRD Various commands getting "failed because the control process exited with error code." [`#134`](https://github.com/rdkcentral/remote_debugger/pull/134)
- Merge tag '1.2.7' into develop [`37a89a1`](https://github.com/rdkcentral/remote_debugger/commit/37a89a12e83462bc5e2c36e677d7f3ebab32c200)

#### [1.2.7](https://github.com/rdkcentral/remote_debugger/compare/1.2.6...1.2.7)

> 19 May 2025

- [DELIA-68036] RRD failing in device for some commands, getting invalid message type (SCXI11BEI) [`#121`](https://github.com/rdkcentral/remote_debugger/pull/121)
- RDKEMW-3380 : Evaluate the Deepsleep Scenario for Static and Dynamic method [`#125`](https://github.com/rdkcentral/remote_debugger/pull/125)
- Revert " RDK-56291 L2 Tests And Integration With CI for Remote Debugger Dynam…" [`#126`](https://github.com/rdkcentral/remote_debugger/pull/126)
- RDKEMW-3380 : Evaluate the Deepsleep Scenario for Static and Dynamic method [`#123`](https://github.com/rdkcentral/remote_debugger/pull/123)
- RDK-56291 L2 Tests And Integration With CI for Remote Debugger Dynamic Updates [`#117`](https://github.com/rdkcentral/remote_debugger/pull/117)
- 1.2.7 release changelog updates [`d893197`](https://github.com/rdkcentral/remote_debugger/commit/d893197f25f8f2f27394e1d757669000c38b1068)
- Merge tag '1.2.6' into develop [`81ef88a`](https://github.com/rdkcentral/remote_debugger/commit/81ef88a4171be7188d4fd72dfecd4fc9b48288dc)

#### [1.2.6](https://github.com/rdkcentral/remote_debugger/compare/1.2.5...1.2.6)

> 28 April 2025

- Feature/rdk 56115 coverity [`#108`](https://github.com/rdkcentral/remote_debugger/pull/108)
- [RDKE] L2 Tests And Integration With CI for Remote Debugger Dynamic Updates [`#98`](https://github.com/rdkcentral/remote_debugger/pull/98)
- RDKECMF-219 Enable component build workflow on Pull Request and remove unnecessary token [`#70`](https://github.com/rdkcentral/remote_debugger/pull/70)
- RDK-56451 [RDKE] Move tr69hostif L2 binary into common docker repo [`#104`](https://github.com/rdkcentral/remote_debugger/pull/104)
- RDK-56115 : [RDKE] Fix coverity issues in RRD [`6edfc37`](https://github.com/rdkcentral/remote_debugger/commit/6edfc376fbd899e2992ed2c26cdeb86351c925aa)
- RDK-56115 : Coverity fix [`4955236`](https://github.com/rdkcentral/remote_debugger/commit/49552366c6ff0d59024e3a449e3a52868a4222de)
- 1.2.6 release changelog updates [`33d4cd2`](https://github.com/rdkcentral/remote_debugger/commit/33d4cd2024a769b4a3d2714f616441fb75ddc8c2)

#### [1.2.5](https://github.com/rdkcentral/remote_debugger/compare/1.2.4...1.2.5)

> 27 March 2025

- RDK-55702: Update the MW clients to use Power Manager Plugin [`#100`](https://github.com/rdkcentral/remote_debugger/pull/100)
- RDKEMW-1768 -Fix UT in RRD with Static profile update and Null Check [`#102`](https://github.com/rdkcentral/remote_debugger/pull/102)
- RDKECMF-219 Remove redundant variable [`#96`](https://github.com/rdkcentral/remote_debugger/pull/96)
- RDKB-58835-[Productisation] Enable RRD Dynamic Profile for RDKB platforms [`#88`](https://github.com/rdkcentral/remote_debugger/pull/88)
- 1.2.5 release changelog updates [`8c49b9c`](https://github.com/rdkcentral/remote_debugger/commit/8c49b9cd05f4c16c5ea2dea79963a2b81b697d6a)
- Merge tag '1.2.4' into develop [`9c234d3`](https://github.com/rdkcentral/remote_debugger/commit/9c234d33e7649424a503259411c749e024e8d986)

#### [1.2.4](https://github.com/rdkcentral/remote_debugger/compare/1.2.3...1.2.4)
Expand Down
2 changes: 1 addition & 1 deletion cov_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,5 @@ cd $WORKDIR
autoreconf -i
autoupdate
./configure --prefix=${INSTALL_DIR} --enable-iarmbusSupport=yes
make remotedebugger_CFLAGS="-I/usr/include/cjson -I/usr/local/include/wdmp-c -I/usr/local/include/rbus -I/usr/local/include -I/usr/local/include/trower-base64 -DIARMBUS_SUPPORT" remotedebugger_LDFLAGS="-L/usr/local/lib -lrdkloggers -lcjson -lrfcapi -lrbus -lmsgpackc -lsecure_wrapper -lwebconfig_framework -lIARMBus -ltr181api -L/usr/local/lib/x86_64-linux-gnu -ltrower-base64 -L/usr/lib/x86_64-linux-gnu"
make remotedebugger_CFLAGS="-I/usr/include/cjson -I/usr/local/include/wdmp-c -I/usr/local/include/rbus -I/usr/local/include -I/usr/local/include/trower-base64 -DIARMBUS_SUPPORT -DUSECOV" remotedebugger_LDFLAGS="-L/usr/local/lib -lrdkloggers -lcjson -lrfcapi -lrbus -lmsgpackc -lsecure_wrapper -lwebconfig_framework -lIARMBus -ltr181api -L/usr/local/lib/x86_64-linux-gnu -ltrower-base64 -L/usr/lib/x86_64-linux-gnu"
make install
6 changes: 3 additions & 3 deletions src/rrdDynamic.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ int RRDGetProfileStringLength(issueNodeData *pissueStructNode, bool isDeepSleepA
* @param bool isDeepSleepAwakeEvent - Flag to indicate if this is a deep sleep awake event.
* @return void
*/
#if !defined(GTEST_ENABLE)

void RRDRdmManagerDownloadRequest(issueNodeData *pissueStructNode, char *dynJSONPath, data_buf *rbuf, bool isDeepSleepAwakeEvent)
{
char *paramString = NULL;
Expand Down Expand Up @@ -219,7 +219,7 @@ void RRDRdmManagerDownloadRequest(issueNodeData *pissueStructNode, char *dynJSON
{
#ifdef IARMBUS_SUPPORT
if (isDeepSleepAwakeEvent)
strncpy(msgDataString, paramString, msgDataStringSize);
strncpy(msgDataString, paramString, (msgDataStringSize - strlen(RDM_PKG_SUFFIX)));
else
snprintf(msgDataString, msgDataStringSize, "%s%s", RDM_PKG_PREFIX, pissueStructNode->Node);
#else
Expand Down Expand Up @@ -282,7 +282,7 @@ void RRDRdmManagerDownloadRequest(issueNodeData *pissueStructNode, char *dynJSON
RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: ...Exiting...\n", __FUNCTION__, __LINE__);
return;
}
#endif

/*
* @function RRDCheckIssueInDynamicProfile
* @brief Checks for a specific issue in the dynamic JSON profile associated with the given
Expand Down
29 changes: 23 additions & 6 deletions src/rrdEventProcess.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ void processWebCfgTypeEvent(data_buf *rbuf)
*/
void processIssueTypeEvent(data_buf *rbuf)
{
char **cmdMap;
char **cmdMap = NULL;
int index = 0, count = 0, dataMsgLen = 0;
data_buf *cmdBuff = NULL;

Expand Down Expand Up @@ -97,15 +97,28 @@ void processIssueTypeEvent(data_buf *rbuf)
{
RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: Memory Allocation Failed... \n", __FUNCTION__, __LINE__);
}
free(cmdBuff);
if(cmdBuff)
{
free(cmdBuff);
cmdBuff = NULL;
}
}
else
{
RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: Memory Allocation Failed... \n", __FUNCTION__, __LINE__);
}
free(cmdMap[index]);
if( cmdMap[index])
{
free(cmdMap[index]);
cmdMap[index] = NULL;
}

}
free(cmdMap);
if( cmdMap)
{
free(cmdMap);
cmdMap = NULL;
}
}
}

Expand Down Expand Up @@ -190,6 +203,7 @@ static void processIssueType(data_buf *rbuf)
RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: Checking Issue from Static... \n", __FUNCTION__, __LINE__);
processIssueTypeInStaticProfile(rbuf, pIssueNode);
}
//CID-336989: Resource leak
}
else
{
Expand Down Expand Up @@ -295,9 +309,12 @@ static void processIssueTypeInStaticProfile(data_buf *rbuf, issueNodeData *pIssu
isStaticIssue = findIssueInParsedJSON(pIssueNode, jsonParsed);
if (isStaticIssue)
{
// Issue in Static Profile JSON
RDK_LOG(RDK_LOG_INFO, LOG_REMDEBUG, "[%s:%d]: Issue Data Node: %s and Sub-Node: %s found in Static JSON File %s... \n", __FUNCTION__, __LINE__, pIssueNode->Node, pIssueNode->subNode, RRD_JSON_FILE);
checkIssueNodeInfo(pIssueNode, jsonParsed, rbuf, false, NULL); // sanity Check and Get Command List
// CID 336988: Double free (USE_AFTER_FREE)
if(rbuf)
{
checkIssueNodeInfo(pIssueNode, jsonParsed, rbuf, false, NULL); // sanity Check and Get Command List
}
}
else
{
Expand Down
18 changes: 6 additions & 12 deletions src/rrdIarmEvents.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,17 +144,14 @@ int RRD_IARM_subscribe()
void _pwrManagerEventHandler(const PowerController_PowerState_t currentState,
const PowerController_PowerState_t newState, void* userdata)
{
#if !defined(ENABLE_WEBCFG_FEATURE)
data_buf *sbuf = NULL;
int msgLen = strlen(DEEP_SLEEP_STR) + 1;
#endif
RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: ...Entering.. currentState =%d, newState = %d\n", __FUNCTION__, __LINE__, currentState, newState);

if ((currentState == POWER_STATE_STANDBY_DEEP_SLEEP &&
newState != POWER_STATE_STANDBY_DEEP_SLEEP))
{
RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: Received state from Power Manager Current :[%d] New[%d] \n", __FUNCTION__, __LINE__, currentState, newState);
#ifdef ENABLE_WEBCFG_FEATURE
rbusError_t rc = RBUS_ERROR_BUS_ERROR;
rbusValue_t value;
rbusValue_Init(&value);
Expand All @@ -166,26 +163,24 @@ void _pwrManagerEventHandler(const PowerController_PowerState_t currentState,
return;
}
RDK_LOG(RDK_LOG_INFO, LOG_REMDEBUG, "[%s:%d]: Invoking WebCfg Force Sync: %s... \n", __FUNCTION__, __LINE__, RRD_WEBCFG_FORCE_SYNC);
#else
RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: Copying Message Received to the queue.. \n", __FUNCTION__, __LINE__);
sbuf = (data_buf *)malloc(sizeof(data_buf));
if (!sbuf)
{
RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: Memory Allocation Failed for EventId %d \n", __FUNCTION__, __LINE__, eventId);
RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: Memory Allocation Failed for EventId \n", __FUNCTION__, __LINE__);
return;
}

RRD_data_buff_init(sbuf, DEEPSLEEP_EVENT_MSG, RRD_DEEPSLEEP_RDM_DOWNLOAD_PKG_INITIATE);
sbuf->mdata = (char *)malloc(msgLen);
if (!sbuf->mdata)
{
RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: Memory Allocation Failed for EventId %d \n", __FUNCTION__, __LINE__, eventId);
RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: Memory Allocation Failed for EventId \n", __FUNCTION__, __LINE__);
RRD_data_buff_deAlloc(sbuf);
return;
}
strncpy((char *)sbuf->mdata, (const char *)DEEP_SLEEP_STR, msgLen);
RRDMsgDeliver(msqid, sbuf);
#endif
}
else
{
Expand All @@ -207,10 +202,8 @@ void _pwrManagerEventHandler(const PowerController_PowerState_t currentState,
void _pwrManagerEventHandler(const char *owner, IARM_EventId_t eventId, void *data, size_t len)
{
IARM_Bus_PWRMgr_EventData_t *eventData = NULL;
#if !defined(ENABLE_WEBCFG_FEATURE)
data_buf *sbuf = NULL;
int msgLen = strlen(DEEP_SLEEP_STR) + 1;
#endif
RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: ...Entering.. \n", __FUNCTION__, __LINE__);

if (strcmp(owner, IARM_BUS_PWRMGR_NAME) == 0)
Expand All @@ -223,7 +216,6 @@ void _pwrManagerEventHandler(const char *owner, IARM_EventId_t eventId, void *da
{
RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: Event ID found for IARM_BUS_RDK_REMOTE_DEBUGGER_DEEPSLEEP_AWAKE %d \n", __FUNCTION__, __LINE__, eventId);
RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: Received state from Power Manager Current :[%d] New[%d] \n", __FUNCTION__, __LINE__, eventData->data.state.curState, eventData->data.state.newState);
#ifdef ENABLE_WEBCFG_FEATURE
rbusError_t rc = RBUS_ERROR_BUS_ERROR;
rbusValue_t value;
rbusValue_Init(&value);
Expand All @@ -235,7 +227,6 @@ void _pwrManagerEventHandler(const char *owner, IARM_EventId_t eventId, void *da
return;
}
RDK_LOG(RDK_LOG_INFO, LOG_REMDEBUG, "[%s:%d]: Invoking WebCfg Force Sync: %s... \n", __FUNCTION__, __LINE__, RRD_WEBCFG_FORCE_SYNC);
#else
RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: Copying Message Received to the queue.. \n", __FUNCTION__, __LINE__);
sbuf = (data_buf *)malloc(sizeof(data_buf));
if (!sbuf)
Expand All @@ -253,7 +244,11 @@ void _pwrManagerEventHandler(const char *owner, IARM_EventId_t eventId, void *da
return;
}
strncpy((char *)sbuf->mdata, (const char *)DEEP_SLEEP_STR, msgLen);
#if !defined(GTEST_ENABLE)
RRDMsgDeliver(msqid, sbuf);
#endif
#ifdef USECOV
RRD_data_buff_deAlloc(sbuf);
#endif
}
else
Expand All @@ -268,7 +263,6 @@ void _pwrManagerEventHandler(const char *owner, IARM_EventId_t eventId, void *da
RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: ...Exit.. \n", __FUNCTION__, __LINE__);
}
#endif

/*
* @function _rdmManagerEventHandler
* @brief Receives the RDM Manager event and sends the value as a message in the message-queue
Expand Down
7 changes: 4 additions & 3 deletions src/rrdInterface.c
Original file line number Diff line number Diff line change
Expand Up @@ -318,14 +318,15 @@ void _remoteDebuggerEventHandler(rbusHandle_t handle, rbusEvent_t const* event,
return;
}

int len = strlen(rbusValue_GetString(value, NULL));
int len = strlen(rbusValue_GetString(value, NULL))+1;
dataMsg = (char *) calloc(1, len);
if(!dataMsg)
{
RDK_LOG(RDK_LOG_ERROR,LOG_REMDEBUG,"[%s:%d]: Memory Allocation Failed for %s \n", __FUNCTION__, __LINE__, rbusValue_ToString(value, NULL, 0));
return;
}
strncpy(dataMsg, rbusValue_GetString(value, NULL), len);
strncpy(dataMsg, rbusValue_GetString(value, NULL), len-1);
dataMsg[len-1]='\0';
if (dataMsg[0] == '\0' || len <= 0 )
{
RDK_LOG(RDK_LOG_DEBUG,LOG_REMDEBUG,"[%s:%d]: Message Received is empty, Exit Processing!!! \n", __FUNCTION__, __LINE__);
Expand Down Expand Up @@ -398,7 +399,7 @@ int RRD_unsubscribe()
int ret = 0;

RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: ...Entering... \n", __FUNCTION__, __LINE__);
#ifdef IARMBUS_SUPPORT
#if defined(IARMBUS_SUPPORT) || defined(GTEST_ENABLE)
ret = RRD_IARM_unsubscribe();
if (ret != 0)
{
Expand Down
4 changes: 1 addition & 3 deletions src/rrdInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,22 +45,20 @@ extern "C"
#define RRD_PROCESS_NAME "remotedebugger"
#define RRD_RBUS_TIMEOUT 60

#ifdef IARMBUS_SUPPORT
/*Enum for IARM Events*/
typedef enum _RemoteDebugger_EventId_t {
IARM_BUS_RDK_REMOTE_DEBUGGER_ISSUETYPE = 0,
IARM_BUS_RDK_REMOTE_DEBUGGER_WEBCFGDATA,
IARM_BUS_RDK_REMOTE_DEBUGGER_MAX_EVENT
} IARM_Bus_RemoteDebugger_EventId_t;
#endif

/*Event Handler Function*/
#if !defined(GTEST_ENABLE)
void _remoteDebuggerEventHandler(rbusHandle_t handle, rbusEvent_t const* event, rbusEventSubscription_t* subscription);
void _remoteDebuggerWebCfgDataEventHandler(rbusHandle_t handle, rbusEvent_t const* event, rbusEventSubscription_t* subscription);
void _rdmDownloadEventHandler(rbusHandle_t handle, rbusEvent_t const* event, rbusEventSubscription_t* subscription);
#endif
#ifdef IARMBUS_SUPPORT
#if defined(IARMBUS_SUPPORT) || defined(GTEST_ENABLE)
int RRD_IARM_subscribe(void);
int RRD_IARM_unsubscribe(void);
void _rdmManagerEventHandler(const char *owner, IARM_EventId_t eventId, void *data, size_t len);
Expand Down
7 changes: 7 additions & 0 deletions src/rrdJsonParser.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ char * readJsonFile(char *jsonfile)
if(ch_count < 1)
{
RDK_LOG(RDK_LOG_ERROR,LOG_REMDEBUG,"[%s:%d]: Json File %s is Empty!!! \n",__FUNCTION__,__LINE__,jsonfile);
// CID 278332: Resource leak (RESOURCE_LEAK)
fclose(fp);
return NULL;
}
fseek(fp, 0, SEEK_SET);
Expand Down Expand Up @@ -488,6 +490,11 @@ void checkIssueNodeInfo(issueNodeData *issuestructNode, cJSON *jsoncfg, data_buf
ctime = time (NULL);
ltime = localtime (&ctime);
dlen=snprintf(outdir,BUF_LEN_256,"%s%s-DebugReport-",RRD_OUTPUT_DIR,issuestructNode->Node);
RDK_LOG(RDK_LOG_DEBUG,LOG_REMDEBUG,"[%s:%d]: debug print issuestructNode->Node: %s !!! \n",__FUNCTION__,__LINE__, issuestructNode->Node);
if ((strcmp(issuestructNode->Node, DEEP_SLEEP_STR) == 0)|| (strcmp(issuestructNode->Node, "deepsleep")== 0))
{
isDeepSleepAwakeEventValid = true;
}
strftime (outdir + dlen, sizeof(outdir) - dlen, "%Y-%m-%d-%H-%M-%S", ltime);
RDK_LOG(RDK_LOG_DEBUG,LOG_REMDEBUG,"[%s:%d]: Creating Directory %s for Issue Category to store Output data...\n",__FUNCTION__,__LINE__,outdir);
if (mkdir(outdir,0777) != 0)
Expand Down
5 changes: 3 additions & 2 deletions src/rrdRunCmdThread.c
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ bool executeCommands(issueData *cmdinfo)

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);
Expand Down Expand Up @@ -416,11 +416,12 @@ bool executeCommands(issueData *cmdinfo)

/*Stop or Reset runtime service for issue*/
RDK_LOG(RDK_LOG_INFO,LOG_REMDEBUG,"[%s:%d]: Stopping remote_debugger_%s service...\n",__FUNCTION__,__LINE__,cmdData->rfcvalue);
#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
return true;
}
}
Expand Down
7 changes: 5 additions & 2 deletions src/unittest/mocks/Client_Mock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#include <cstdarg>

/* -------- IARM ---------------- */
#ifdef IARMBUS_SUPPORT
ClientIARMMock *g_mock = nullptr;

void setMock(ClientIARMMock *mock)
Expand Down Expand Up @@ -81,7 +80,6 @@ extern "C"
return IARM_RESULT_SUCCESS;
}
}
#endif

/* ---------- RBUS --------------*/
RBusApiInterface *RBusApiWrapper::impl = nullptr;
Expand Down Expand Up @@ -128,6 +126,11 @@ rbusError_t RBusApiWrapper::rbus_set(rbusHandle_t handle, char const *objectName
EXPECT_NE(impl, nullptr);
return impl->rbus_set(handle, objectName, value, respHandler);
}
rbusError_t RBusApiWrapper::rbus_get(rbusHandle_t handle, char const *objectName, rbusValue_t value, rbusMethodAsyncRespHandler_t respHandler)
{
EXPECT_NE(impl, nullptr);
return impl->rbus_get(handle, objectName, value, respHandler);
}
const char* rbusError_ToString(rbusError_t e)
{
#define rbusError_String(E, S) case E: s = S; break;
Expand Down
Loading