Skip to content

RDKEMW-19229 : Improve L1 Coverage for tr69hostif and Fix Errors - #503

Open
madhubabutt wants to merge 1 commit into
developfrom
topic/RDKEMW-19229
Open

RDKEMW-19229 : Improve L1 Coverage for tr69hostif and Fix Errors#503
madhubabutt wants to merge 1 commit into
developfrom
topic/RDKEMW-19229

Conversation

@madhubabutt

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings June 30, 2026 10:12
@madhubabutt
madhubabutt requested a review from a team as a code owner June 30, 2026 10:12
@github-actions

Copy link
Copy Markdown

Code Coverage Summary

                                        Total:|31.5%  8297|46.9% 544|    -    0

1 similar comment
@github-actions

Copy link
Copy Markdown

Code Coverage Summary

                                        Total:|31.5%  8297|46.9% 544|    -    0

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR focuses on increasing L1 unit-test coverage for tr69hostif by adding Google Test cases that exercise additional error-handling and edge-condition paths across hostIf utils, DeviceInfo profile logic, parodusClient data-model helpers, and the HTTP server request handler test suite.

Changes:

  • Added new negative/edge-case tests for utilities (e.g., unexpected BS update source, invalid NTP date parsing).
  • Added DeviceInfo tests for MemInsight Trigger setter validation paths.
  • Added multiple new tests in parodusClient and httpserver suites to cover additional boundary/error scenarios.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 11 comments.

File Description
src/hostif/src/gtest/gtest_src.cpp Adds coverage for unexpected BS update sources and invalid NTP date formatting.
src/hostif/profiles/DeviceInfo/gtest/gtest_main.cpp Adds tests for MemInsight Trigger setter error handling (but currently introduces a duplicate test name).
src/hostif/parodusClient/gtest/dm_test.cpp Adds coverage for freeDataModelParam, time delta negative case, notification payload bounds, and validation scenarios (but currently introduces a duplicate test name).
src/hostif/httpserver/src/gtest/gtest_httpserver.cpp Adds several new request-handler tests and conversion-path tests (but currently includes non-compiling uses of req_struct/get_req_t and incorrect calls to convertAndAssignParamValue).

EXPECT_EQ(param.faultCode, fcInvalidParameterType);
}

TEST(deviceTest, set_Device_DeviceInfo_X_RDKCENTRAL_COM_MemInsight_Trigger_InvalidType) {
Comment thread src/hostif/parodusClient/gtest/dm_test.cpp Outdated
Comment on lines +1038 to +1049
TEST(HTTPServerTest, handleRFCRequest_SET_InvalidParam_ReturnsError) {
req_struct reqSt;
memset(&reqSt, 0, sizeof(req_struct));
reqSt.request.type = WDMP_SET;
reqSt.request.u.setReq = nullptr;

res_struct* respSt = handleRequest("rfc", &reqSt);
if (respSt) {
EXPECT_TRUE(respSt->retStatus[0] != WDMP_SUCCESS);
wdmp_free_res_struct(respSt);
}
}
Comment on lines +1051 to +1068
TEST(HTTPServerTest, handleRFCRequest_GET_EmptyParam_ReturnsError) {
req_struct reqSt;
memset(&reqSt, 0, sizeof(req_struct));
reqSt.request.type = WDMP_GET;
reqSt.request.u.getReq = (get_req_t *)malloc(sizeof(get_req_t));
if (reqSt.request.u.getReq) {
memset(reqSt.request.u.getReq, 0, sizeof(get_req_t));
reqSt.request.u.getReq->paramCount = 0;
reqSt.request.u.getReq->paramNames = nullptr;

res_struct* respSt = handleRequest("rfc", &reqSt);
if (respSt) {
EXPECT_TRUE(respSt->retStatus[0] != WDMP_SUCCESS || respSt->paramCnt == 0);
wdmp_free_res_struct(respSt);
}
free(reqSt.request.u.getReq);
}
}
Comment on lines +1070 to +1094
TEST(HTTPServerTest, handleRFCRequest_REPLACE_ValidParam) {
req_struct reqSt;
memset(&reqSt, 0, sizeof(req_struct));
reqSt.request.type = WDMP_REPLACE;
reqSt.request.u.setReq = (set_req_t *)malloc(sizeof(set_req_t));
if (reqSt.request.u.setReq) {
memset(reqSt.request.u.setReq, 0, sizeof(set_req_t));
reqSt.request.u.setReq->paramCount = 1;
reqSt.request.u.setReq->param = (param_t *)malloc(sizeof(param_t));
memset(reqSt.request.u.setReq->param, 0, sizeof(param_t));
reqSt.request.u.setReq->param[0].name = strdup("Device.DeviceInfo.SerialNumber");
reqSt.request.u.setReq->param[0].value = strdup("TestSN");
reqSt.request.u.setReq->param[0].type = WDMP_STRING;

res_struct* respSt = handleRequest("rfc", &reqSt);
if (respSt) {
EXPECT_TRUE(respSt->retStatus[0] != WDMP_SUCCESS || respSt->paramCnt > 0);
wdmp_free_res_struct(respSt);
}
free(reqSt.request.u.setReq->param[0].name);
free(reqSt.request.u.setReq->param[0].value);
free(reqSt.request.u.setReq->param);
free(reqSt.request.u.setReq);
}
}
Comment on lines +1155 to +1168
TEST(HTTPServerTest, convertAndAssignParamValue_BoolType) {
param_t param;
memset(&param, 0, sizeof(param_t));
param.type = WDMP_BOOLEAN;
param.value = (char*)"true";
param.name = (char*)"Device.Test.Param";

HOSTIF_MsgData_t msgData;
memset(&msgData, 0, sizeof(HOSTIF_MsgData_t));
strncpy(msgData.paramName, param.name, TR69HOSTIFMGR_MAX_PARAM_LEN - 1);

int ret = convertAndAssignParamValue(&msgData, param);
EXPECT_TRUE(ret == 0 || ret == -1);
}
Comment on lines +1170 to +1183
TEST(HTTPServerTest, convertAndAssignParamValue_IntType) {
param_t param;
memset(&param, 0, sizeof(param_t));
param.type = WDMP_INT;
param.value = (char*)"42";
param.name = (char*)"Device.Test.IntParam";

HOSTIF_MsgData_t msgData;
memset(&msgData, 0, sizeof(HOSTIF_MsgData_t));
strncpy(msgData.paramName, param.name, TR69HOSTIFMGR_MAX_PARAM_LEN - 1);

int ret = convertAndAssignParamValue(&msgData, param);
EXPECT_TRUE(ret == 0 || ret == -1);
}
Comment on lines +1185 to +1205
TEST(HTTPServerTest, handleRFCRequest_ATTRS_UnknownParam_ReturnsNone) {
req_struct reqSt;
memset(&reqSt, 0, sizeof(req_struct));
reqSt.request.type = WDMP_ATTR;
reqSt.request.u.getReq = (get_req_t *)malloc(sizeof(get_req_t));
if (reqSt.request.u.getReq) {
memset(reqSt.request.u.getReq, 0, sizeof(get_req_t));
reqSt.request.u.getReq->paramCount = 1;
reqSt.request.u.getReq->paramNames = (char **)malloc(sizeof(char*));
reqSt.request.u.getReq->paramNames[0] = strdup("Device.Unknown.UnknownParam");

res_struct* respSt = handleRequest("rfc", &reqSt);
if (respSt) {
EXPECT_TRUE(respSt->retStatus[0] != WDMP_SUCCESS || respSt->paramCnt == 0);
wdmp_free_res_struct(respSt);
}
free(reqSt.request.u.getReq->paramNames[0]);
free(reqSt.request.u.getReq->paramNames);
free(reqSt.request.u.getReq);
}
}
Comment thread src/hostif/httpserver/src/gtest/gtest_httpserver.cpp Outdated
Comment thread src/hostif/httpserver/src/gtest/gtest_httpserver.cpp Outdated
Copilot AI review requested due to automatic review settings June 30, 2026 10:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 4 out of 4 changed files in this pull request and generated 9 comments.

Comment on lines +4262 to +4280
TEST(deviceTest, set_Device_DeviceInfo_X_RDKCENTRAL_COM_MemInsight_Trigger_InvalidType) {
int instanceNumber = 0;
HOSTIF_MsgData_t param = { 0 };
memset(&param, 0, sizeof(HOSTIF_MsgData_t));
param.reqType = HOSTIF_SET;
strncpy(param.paramName, "Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.MemInsight.Trigger", TR69HOSTIFMGR_MAX_PARAM_LEN - 1);
param.bsUpdate = HOSTIF_NONE;
param.requestor = HOSTIF_SRC_RFC;
put_boolean(param.paramValue, true);
param.paramtype = hostIf_BooleanType;
param.paramLen = sizeof(hostIf_BooleanType);

hostIf_DeviceInfo *pIface = hostIf_DeviceInfo::getInstance(instanceNumber);
ASSERT_NE(pIface, nullptr);

int ret = pIface->set_Device_DeviceInfo_X_RDKCENTRAL_COM_MemInsight_Trigger(&param);
EXPECT_EQ(ret, NOK);
EXPECT_EQ(param.faultCode, fcInvalidParameterType);
}
Comment thread src/hostif/parodusClient/gtest/dm_test.cpp Outdated
Comment on lines +1038 to +1049
TEST(HTTPServerTest, handleRFCRequest_SET_InvalidParam_ReturnsError) {
req_struct reqSt;
memset(&reqSt, 0, sizeof(req_struct));
reqSt.request.type = WDMP_SET;
reqSt.request.u.setReq = nullptr;

res_struct* respSt = handleRequest("rfc", &reqSt);
if (respSt) {
EXPECT_TRUE(respSt->retStatus[0] != WDMP_SUCCESS);
wdmp_free_res_struct(respSt);
}
}
Comment on lines +1051 to +1068
TEST(HTTPServerTest, handleRFCRequest_GET_EmptyParam_ReturnsError) {
req_struct reqSt;
memset(&reqSt, 0, sizeof(req_struct));
reqSt.request.type = WDMP_GET;
reqSt.request.u.getReq = (get_req_t *)malloc(sizeof(get_req_t));
if (reqSt.request.u.getReq) {
memset(reqSt.request.u.getReq, 0, sizeof(get_req_t));
reqSt.request.u.getReq->paramCount = 0;
reqSt.request.u.getReq->paramNames = nullptr;

res_struct* respSt = handleRequest("rfc", &reqSt);
if (respSt) {
EXPECT_TRUE(respSt->retStatus[0] != WDMP_SUCCESS || respSt->paramCnt == 0);
wdmp_free_res_struct(respSt);
}
free(reqSt.request.u.getReq);
}
}
Comment on lines +1070 to +1094
TEST(HTTPServerTest, handleRFCRequest_REPLACE_ValidParam) {
req_struct reqSt;
memset(&reqSt, 0, sizeof(req_struct));
reqSt.request.type = WDMP_REPLACE;
reqSt.request.u.setReq = (set_req_t *)malloc(sizeof(set_req_t));
if (reqSt.request.u.setReq) {
memset(reqSt.request.u.setReq, 0, sizeof(set_req_t));
reqSt.request.u.setReq->paramCount = 1;
reqSt.request.u.setReq->param = (param_t *)malloc(sizeof(param_t));
memset(reqSt.request.u.setReq->param, 0, sizeof(param_t));
reqSt.request.u.setReq->param[0].name = strdup("Device.DeviceInfo.SerialNumber");
reqSt.request.u.setReq->param[0].value = strdup("TestSN");
reqSt.request.u.setReq->param[0].type = WDMP_STRING;

res_struct* respSt = handleRequest("rfc", &reqSt);
if (respSt) {
EXPECT_TRUE(respSt->retStatus[0] != WDMP_SUCCESS || respSt->paramCnt > 0);
wdmp_free_res_struct(respSt);
}
free(reqSt.request.u.setReq->param[0].name);
free(reqSt.request.u.setReq->param[0].value);
free(reqSt.request.u.setReq->param);
free(reqSt.request.u.setReq);
}
}
Comment on lines +1130 to +1153
TEST(HTTPServerTest, validateDataModel_REPLACE_WithNoAttr) {
req_struct reqSt;
memset(&reqSt, 0, sizeof(req_struct));
reqSt.request.type = WDMP_REPLACE;
reqSt.request.u.setReq = (set_req_t *)malloc(sizeof(set_req_t));
if (reqSt.request.u.setReq) {
memset(reqSt.request.u.setReq, 0, sizeof(set_req_t));
reqSt.request.u.setReq->paramCount = 1;
reqSt.request.u.setReq->param = (param_t *)malloc(sizeof(param_t));
memset(reqSt.request.u.setReq->param, 0, sizeof(param_t));
reqSt.request.u.setReq->param[0].name = strdup("Device.DeviceInfo.ModelName");
reqSt.request.u.setReq->param[0].value = strdup("NewModel");
reqSt.request.u.setReq->param[0].type = WDMP_STRING;

res_struct* respSt = handleRequest("rfc", &reqSt);
ASSERT_NE(respSt, nullptr);
EXPECT_TRUE(respSt->retStatus[0] != WDMP_SUCCESS || respSt->paramCnt >= 0);
wdmp_free_res_struct(respSt);
free(reqSt.request.u.setReq->param[0].name);
free(reqSt.request.u.setReq->param[0].value);
free(reqSt.request.u.setReq->param);
free(reqSt.request.u.setReq);
}
}
Comment on lines +1185 to +1205
TEST(HTTPServerTest, handleRFCRequest_ATTRS_UnknownParam_ReturnsNone) {
req_struct reqSt;
memset(&reqSt, 0, sizeof(req_struct));
reqSt.request.type = WDMP_ATTR;
reqSt.request.u.getReq = (get_req_t *)malloc(sizeof(get_req_t));
if (reqSt.request.u.getReq) {
memset(reqSt.request.u.getReq, 0, sizeof(get_req_t));
reqSt.request.u.getReq->paramCount = 1;
reqSt.request.u.getReq->paramNames = (char **)malloc(sizeof(char*));
reqSt.request.u.getReq->paramNames[0] = strdup("Device.Unknown.UnknownParam");

res_struct* respSt = handleRequest("rfc", &reqSt);
if (respSt) {
EXPECT_TRUE(respSt->retStatus[0] != WDMP_SUCCESS || respSt->paramCnt == 0);
wdmp_free_res_struct(respSt);
}
free(reqSt.request.u.getReq->paramNames[0]);
free(reqSt.request.u.getReq->paramNames);
free(reqSt.request.u.getReq);
}
}
Comment thread src/hostif/httpserver/src/gtest/gtest_httpserver.cpp Outdated
Comment thread src/hostif/httpserver/src/gtest/gtest_httpserver.cpp Outdated
@github-actions

Copy link
Copy Markdown

Code Coverage Summary

                                        Total:|56.9%  8297|77.2% 544|    -    0

1 similar comment
@github-actions

Copy link
Copy Markdown

Code Coverage Summary

                                        Total:|56.9%  8297|77.2% 544|    -    0

Copilot AI review requested due to automatic review settings June 30, 2026 10:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 5 out of 5 changed files in this pull request and generated 7 comments.

Comment on lines +1075 to +1079
res_struct* respSt = handleRequest("rfc", &reqSt);
if (respSt) {
EXPECT_TRUE(respSt->retStatus[0] != WDMP_SUCCESS || respSt->paramCnt == 0);
wdmp_free_res_struct(respSt);
}
Comment on lines +1053 to +1057
res_struct* respSt = handleRequest("rfc", &reqSt);
if (respSt) {
EXPECT_TRUE(respSt->retStatus[0] != WDMP_SUCCESS);
wdmp_free_res_struct(respSt);
}
Comment on lines +1098 to +1102
res_struct* respSt = handleRequest("rfc", &reqSt);
if (respSt) {
EXPECT_TRUE(respSt->retStatus[0] == WDMP_SUCCESS || respSt->retStatus[0] != WDMP_SUCCESS);
wdmp_free_res_struct(respSt);
}
Comment on lines +1129 to +1133
res_struct* respSt = handleRequest("rfc", &reqSt);
if (respSt) {
EXPECT_TRUE(respSt->retStatus[0] == WDMP_SUCCESS || respSt->retStatus[0] != WDMP_SUCCESS);
wdmp_free_res_struct(respSt);
}
Comment on lines +1157 to +1160
res_struct* respSt = handleRequest("rfc", &reqSt);
ASSERT_NE(respSt, nullptr);
EXPECT_TRUE(respSt->retStatus[0] == WDMP_SUCCESS || respSt->retStatus[0] != WDMP_SUCCESS);
wdmp_free_res_struct(respSt);
Comment on lines +1198 to +1202
res_struct* respSt = handleRequest("rfc", &reqSt);
if (respSt) {
EXPECT_TRUE(respSt->retStatus[0] != WDMP_SUCCESS || respSt->paramCnt == 0);
wdmp_free_res_struct(respSt);
}
Comment thread src/hostif/parodusClient/gtest/dm_test.cpp Outdated
@github-actions

Copy link
Copy Markdown

Code Coverage Summary

                                        Total:|61.9%  8297|81.6% 544|    -    0

@github-actions

Copy link
Copy Markdown

Code Coverage Summary

                                        Total:|61.9%  8297|81.6% 544|    -    0

1 similar comment
@github-actions

Copy link
Copy Markdown

Code Coverage Summary

                                        Total:|61.9%  8297|81.6% 544|    -    0

Copilot AI review requested due to automatic review settings June 30, 2026 11:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 5 out of 5 changed files in this pull request and generated 8 comments.

Comment on lines +1053 to +1057
res_struct* respSt = handleRequest("rfc", &reqSt);
if (respSt) {
EXPECT_TRUE(respSt->retStatus[0] != WDMP_SUCCESS);
wdmp_free_res_struct(respSt);
}
Comment on lines +1075 to +1079
res_struct* respSt = handleRequest("rfc", &reqSt);
if (respSt) {
EXPECT_TRUE(respSt->retStatus[0] != WDMP_SUCCESS || respSt->paramCnt == 0);
wdmp_free_res_struct(respSt);
}
Comment on lines +1098 to +1102
res_struct* respSt = handleRequest("rfc", &reqSt);
if (respSt) {
EXPECT_TRUE(respSt->retStatus[0] == WDMP_SUCCESS || respSt->retStatus[0] != WDMP_SUCCESS);
wdmp_free_res_struct(respSt);
}
Comment on lines +1129 to +1133
res_struct* respSt = handleRequest("rfc", &reqSt);
if (respSt) {
EXPECT_TRUE(respSt->retStatus[0] == WDMP_SUCCESS || respSt->retStatus[0] != WDMP_SUCCESS);
wdmp_free_res_struct(respSt);
}
Comment on lines +1157 to +1160
res_struct* respSt = handleRequest("rfc", &reqSt);
ASSERT_NE(respSt, nullptr);
EXPECT_TRUE(respSt->retStatus[0] == WDMP_SUCCESS || respSt->retStatus[0] != WDMP_SUCCESS);
wdmp_free_res_struct(respSt);
Comment on lines +1173 to +1174
convertAndAssignParamValueFunc()(&msgData, (char*)"true");
EXPECT_EQ(0, 0);
Comment on lines +1183 to +1184
convertAndAssignParamValueFunc()(&msgData, (char*)"42");
EXPECT_EQ(0, 0);
Comment on lines +408 to +412
TEST(datamodelTest, freeDataModelParam_EmptyStruct) {
DataModelParam dmParam = {0};
freeDataModelParam(dmParam);
EXPECT_EQ(0, 0);
}
Copilot AI review requested due to automatic review settings June 30, 2026 11:23
@github-actions

Copy link
Copy Markdown

Code Coverage Summary

                                        Total:|74.7%  8297|94.9% 544|    -    0

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 5 out of 5 changed files in this pull request and generated 4 comments.

Comment on lines +1075 to +1079
res_struct* respSt = handleRequest("rfc", &reqSt);
if (respSt) {
EXPECT_TRUE(respSt->retStatus[0] != WDMP_SUCCESS || respSt->paramCnt == 0);
wdmp_free_res_struct(respSt);
}
Comment on lines +1098 to +1102
res_struct* respSt = handleRequest("rfc", &reqSt);
if (respSt) {
EXPECT_TRUE(respSt->retStatus[0] == WDMP_SUCCESS || respSt->retStatus[0] != WDMP_SUCCESS);
wdmp_free_res_struct(respSt);
}
Comment on lines +1129 to +1133
res_struct* respSt = handleRequest("rfc", &reqSt);
if (respSt) {
EXPECT_TRUE(respSt->retStatus[0] == WDMP_SUCCESS || respSt->retStatus[0] != WDMP_SUCCESS);
wdmp_free_res_struct(respSt);
}
Comment on lines +1157 to +1160
res_struct* respSt = handleRequest("rfc", &reqSt);
ASSERT_NE(respSt, nullptr);
EXPECT_TRUE(respSt->retStatus[0] == WDMP_SUCCESS || respSt->retStatus[0] != WDMP_SUCCESS);
wdmp_free_res_struct(respSt);
@github-actions

Copy link
Copy Markdown

Code Coverage Summary

                                        Total:|74.7%  8297|94.9% 544|    -    0

@madhubabutt
madhubabutt force-pushed the topic/RDKEMW-19229 branch from 97a66ee to 0307a04 Compare July 1, 2026 11:10
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

Code Coverage Summary

                                        Total:|70.8%  8297|91.2% 544|    -    0

Copilot AI review requested due to automatic review settings July 6, 2026 11:03
@madhubabutt
madhubabutt force-pushed the topic/RDKEMW-19229 branch from 8e310a8 to 6f3b60c Compare July 6, 2026 11:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 6 out of 6 changed files in this pull request and generated 7 comments.

Comment on lines 245 to +254
TEST(srcTest, isWebpaReady) {
bool ret = isWebpaReady();
EXPECT_EQ(ret, true);
}

TEST(srcTest, isWebpaReadyFalseWhenFileMissing) {
std::remove("/tmp/webpa/start_time");
bool ret = isWebpaReady();
EXPECT_EQ(ret, false);
}
Comment on lines 256 to +265
TEST(srcTest, isNtpTimeFilePresent) {
bool ret = isNtpTimeFilePresent();
EXPECT_EQ(ret, true);
}

TEST(srcTest, isNtpTimeFilePresentFalseWhenFileMissing) {
std::remove("/tmp/timeReceivedNTP");
bool ret = isNtpTimeFilePresent();
EXPECT_EQ(ret, false);
}
Comment on lines +99 to +106
soup_message_body_append(reqBody, SOUP_MEMORY_COPY, body, strlen(body));
soup_message_body_complete(reqBody);
// Ensure tests provide non-empty request data even when body helpers do not materialize it immediately.
if ((reqBody->data == nullptr || reqBody->length == 0) && strlen(body) > 0)
{
reqBody->data = static_cast<char*>(g_strdup(body));
reqBody->length = strlen(body);
}
Comment on lines +1228 to +1232
res_struct* respSt = handleRequest("rfc", &reqSt);
if (respSt) {
EXPECT_TRUE(respSt->retStatus[0] != WDMP_SUCCESS || respSt->paramCnt == 0);
wdmp_free_res_struct(respSt);
}
Comment on lines +1251 to +1255
res_struct* respSt = handleRequest("rfc", &reqSt);
if (respSt) {
EXPECT_TRUE(respSt->retStatus[0] == WDMP_SUCCESS || respSt->retStatus[0] != WDMP_SUCCESS);
wdmp_free_res_struct(respSt);
}
Comment on lines +1282 to +1286
res_struct* respSt = handleRequest("rfc", &reqSt);
if (respSt) {
EXPECT_TRUE(respSt->retStatus[0] == WDMP_SUCCESS || respSt->retStatus[0] != WDMP_SUCCESS);
wdmp_free_res_struct(respSt);
}
Comment on lines +1310 to +1313
res_struct* respSt = handleRequest("rfc", &reqSt);
ASSERT_NE(respSt, nullptr);
EXPECT_TRUE(respSt->retStatus[0] == WDMP_SUCCESS || respSt->retStatus[0] != WDMP_SUCCESS);
wdmp_free_res_struct(respSt);
Copilot AI review requested due to automatic review settings July 6, 2026 11:08
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

Code Coverage Summary

                                        Total:|70.8%  8297|91.2% 544|    -    0

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

Code Coverage Summary

                                        Total:|70.7%  8297|91.2% 544|    -    0

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 6 out of 6 changed files in this pull request and generated 6 comments.

Comment on lines 245 to 248
TEST(srcTest, isWebpaReady) {
bool ret = isWebpaReady();
EXPECT_EQ(ret, true);
}
Comment on lines 256 to 259
TEST(srcTest, isNtpTimeFilePresent) {
bool ret = isNtpTimeFilePresent();
EXPECT_EQ(ret, true);
}
Comment on lines +284 to +287
TEST(datamodelTest, isParamEndsWithInstance_NonInstanceSuffix) {
int instance = isParamEndsWithInstance("Device.IP.Interface.1.");
EXPECT_NE(instance, 0);
}
Comment on lines +1251 to +1255
res_struct* respSt = handleRequest("rfc", &reqSt);
if (respSt) {
EXPECT_TRUE(respSt->retStatus[0] == WDMP_SUCCESS || respSt->retStatus[0] != WDMP_SUCCESS);
wdmp_free_res_struct(respSt);
}
Comment on lines +1310 to +1313
res_struct* respSt = handleRequest("rfc", &reqSt);
ASSERT_NE(respSt, nullptr);
EXPECT_TRUE(respSt->retStatus[0] == WDMP_SUCCESS || respSt->retStatus[0] != WDMP_SUCCESS);
wdmp_free_res_struct(respSt);
Comment on lines +151 to +161
TEST(httpserverTest, HTTPServerStartThread_WithoutDataModel_ReturnsNull) {
// This test intentionally runs before any loadDataModel() invocation.
argList.httpServerPort = 0;
std::remove("/tmp/.tr69hostif_http_server_ready");

void *thread_result = HTTPServerStartThread(nullptr);
EXPECT_EQ(thread_result, nullptr);

std::ifstream ready_file("/tmp/.tr69hostif_http_server_ready");
EXPECT_FALSE(ready_file.good());
}
@madhubabutt
madhubabutt force-pushed the topic/RDKEMW-19229 branch from 160d9fb to 1ed03bd Compare July 6, 2026 11:21
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

Code Coverage Summary

                                        Total:|70.8%  8297|91.2% 544|    -    0

1 similar comment
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

Code Coverage Summary

                                        Total:|70.8%  8297|91.2% 544|    -    0

Copilot AI review requested due to automatic review settings July 6, 2026 11:37
@madhubabutt
madhubabutt force-pushed the topic/RDKEMW-19229 branch from 228cf61 to 7455782 Compare July 6, 2026 11:37
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

Code Coverage Summary

                                        Total:|75.0%  8297|95.2% 544|    -    0

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 6 out of 6 changed files in this pull request and generated 12 comments.

Comment on lines 245 to 248
TEST(srcTest, isWebpaReady) {
bool ret = isWebpaReady();
EXPECT_EQ(ret, true);
}
Comment on lines 256 to 259
TEST(srcTest, isNtpTimeFilePresent) {
bool ret = isNtpTimeFilePresent();
EXPECT_EQ(ret, true);
}
{
setResetState((eSTBResetState)999);
triggerResetScript();
EXPECT_EQ(0, 0);
Comment on lines +422 to +426
TEST(datamodelTest, freeDataModelParam_EmptyStruct) {
DataModelParam dmParam = {0};
freeDataModelParam(dmParam);
EXPECT_EQ(0, 0);
}
Comment on lines +145 to +155
TEST(httpserverTest, HTTPServerStartThread_WithoutDataModel_ReturnsNull) {
// This test intentionally runs before any loadDataModel() invocation.
argList.httpServerPort = 0;
std::remove("/tmp/.tr69hostif_http_server_ready");

void *thread_result = HTTPServerStartThread(nullptr);
EXPECT_EQ(thread_result, nullptr);

std::ifstream ready_file("/tmp/.tr69hostif_http_server_ready");
EXPECT_FALSE(ready_file.good());
}
Comment on lines +1246 to +1250
res_struct* respSt = handleRequest("rfc", &reqSt);
if (respSt) {
EXPECT_TRUE(respSt->retStatus[0] == WDMP_SUCCESS || respSt->retStatus[0] != WDMP_SUCCESS);
wdmp_free_res_struct(respSt);
}
Comment on lines +1277 to +1281
res_struct* respSt = handleRequest("rfc", &reqSt);
if (respSt) {
EXPECT_TRUE(respSt->retStatus[0] == WDMP_SUCCESS || respSt->retStatus[0] != WDMP_SUCCESS);
wdmp_free_res_struct(respSt);
}
Comment on lines +1305 to +1308
res_struct* respSt = handleRequest("rfc", &reqSt);
ASSERT_NE(respSt, nullptr);
EXPECT_TRUE(respSt->retStatus[0] == WDMP_SUCCESS || respSt->retStatus[0] != WDMP_SUCCESS);
wdmp_free_res_struct(respSt);
msgData.paramtype = hostIf_BooleanType;

convertAndAssignParamValueFunc()(&msgData, (char*)"true");
EXPECT_EQ(0, 0);
msgData.paramtype = hostIf_IntegerType;

convertAndAssignParamValueFunc()(&msgData, (char*)"42");
EXPECT_EQ(0, 0);
Copilot Bot review requested due to automatic review settings July 6, 2026 11:43
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

Code Coverage Summary

                                        Total:|75.1%  8297|95.2% 544|    -    0

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 6 out of 6 changed files in this pull request and generated 5 comments.

Comment on lines +1223 to +1227
res_struct* respSt = handleRequest("rfc", &reqSt);
if (respSt) {
EXPECT_TRUE(respSt->retStatus[0] != WDMP_SUCCESS || respSt->paramCnt == 0);
wdmp_free_res_struct(respSt);
}
Comment on lines +1246 to +1250
res_struct* respSt = handleRequest("rfc", &reqSt);
if (respSt) {
EXPECT_TRUE(respSt->retStatus[0] == WDMP_SUCCESS || respSt->retStatus[0] != WDMP_SUCCESS);
wdmp_free_res_struct(respSt);
}
Comment on lines +1277 to +1281
res_struct* respSt = handleRequest("rfc", &reqSt);
if (respSt) {
EXPECT_TRUE(respSt->retStatus[0] == WDMP_SUCCESS || respSt->retStatus[0] != WDMP_SUCCESS);
wdmp_free_res_struct(respSt);
}
Comment on lines +1305 to +1308
res_struct* respSt = handleRequest("rfc", &reqSt);
ASSERT_NE(respSt, nullptr);
EXPECT_TRUE(respSt->retStatus[0] == WDMP_SUCCESS || respSt->retStatus[0] != WDMP_SUCCESS);
wdmp_free_res_struct(respSt);
Comment on lines +1201 to +1205
res_struct* respSt = handleRequest("rfc", &reqSt);
if (respSt) {
EXPECT_TRUE(respSt->retStatus[0] != WDMP_SUCCESS);
wdmp_free_res_struct(respSt);
}
@madhubabutt
madhubabutt force-pushed the topic/RDKEMW-19229 branch from 6b7480a to c4b0915 Compare July 6, 2026 12:23
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

Code Coverage Summary

                                        Total:|75.1%  8297|95.2% 544|    -    0

Copilot Bot review requested due to automatic review settings July 6, 2026 12:39
@madhubabutt
madhubabutt force-pushed the topic/RDKEMW-19229 branch from c4b0915 to a2e6f97 Compare July 6, 2026 12:39
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

Code Coverage Summary

                                        Total:|75.1%  8297|95.2% 544|    -    0

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 6 out of 6 changed files in this pull request and generated 11 comments.

Comment on lines +108 to +129
static SoupServerMessage* createServerMessage(const char* method, const char* uri, const char* body)
{
(void)method;
(void)uri;
SoupServerMessage* msg = static_cast<SoupServerMessage*>(g_object_new(SOUP_TYPE_SERVER_MESSAGE, NULL));
if (!msg)
{
return nullptr;
}

if (body != nullptr)
{
SoupMessageBody* reqBody = soup_server_message_get_request_body(msg);
if (reqBody)
{
soup_message_body_append(reqBody, SOUP_MEMORY_COPY, body, strlen(body));
soup_message_body_complete(reqBody);
}
}

return msg;
}
Comment on lines +1225 to +1229
res_struct* respSt = handleRequest("rfc", &reqSt);
if (respSt) {
EXPECT_TRUE(respSt->retStatus[0] != WDMP_SUCCESS);
wdmp_free_res_struct(respSt);
}
Comment on lines +1247 to +1251
res_struct* respSt = handleRequest("rfc", &reqSt);
if (respSt) {
EXPECT_TRUE(respSt->retStatus[0] != WDMP_SUCCESS || respSt->paramCnt == 0);
wdmp_free_res_struct(respSt);
}
Comment on lines +1267 to +1274
reqSt.reqType = REPLACE_ROWS;
reqSt.u.setReq = setReq;

res_struct* respSt = handleRequest("rfc", &reqSt);
if (respSt) {
EXPECT_TRUE(respSt->retStatus[0] == WDMP_SUCCESS || respSt->retStatus[0] != WDMP_SUCCESS);
wdmp_free_res_struct(respSt);
}
Comment on lines +1298 to +1305
reqSt.reqType = REPLACE_ROWS;
reqSt.u.setReq = setReq;

res_struct* respSt = handleRequest("rfc", &reqSt);
if (respSt) {
EXPECT_TRUE(respSt->retStatus[0] == WDMP_SUCCESS || respSt->retStatus[0] != WDMP_SUCCESS);
wdmp_free_res_struct(respSt);
}
Comment on lines +250 to +254
TEST(srcTest, isWebpaReadyFalseWhenFileMissing) {
std::remove("/tmp/webpa/start_time");
bool ret = isWebpaReady();
EXPECT_EQ(ret, false);
}
Comment on lines +261 to +265
TEST(srcTest, isNtpTimeFilePresentFalseWhenFileMissing) {
std::remove("/tmp/timeReceivedNTP");
bool ret = isNtpTimeFilePresent();
EXPECT_EQ(ret, false);
}
Comment on lines +395 to +398
const char* attrValue = "Device.WiFi.SSID.{i}.";
char* paramName = (char*)"Device.WiFi.SSID.12.";
int ret = 0;
int retValue = checkMatchingParameter(attrValue, paramName, &ret);
Comment on lines +4249 to +4253
param.requestor = HOSTIF_SRC_RFC;
put_boolean(param.paramValue, true);
param.paramtype = hostIf_BooleanType;
param.paramLen = sizeof(hostIf_BooleanType);

Comment on lines +285 to +289
TEST(srcTest, get_system_manageble_ntp_time_MissingFileReturnsZero) {
std::remove("/tmp/timeReceivedNTP");
unsigned long ret = get_system_manageble_ntp_time();
EXPECT_EQ(ret, 0UL);
}
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.

2 participants