Skip to content

RDK-60476: Update L1 and L2 testcases for fork elimination#260

Open
yogeswaransky wants to merge 13 commits intodevelopfrom
topic/RDK-60476
Open

RDK-60476: Update L1 and L2 testcases for fork elimination#260
yogeswaransky wants to merge 13 commits intodevelopfrom
topic/RDK-60476

Conversation

@yogeswaransky
Copy link
Contributor

No description provided.

Signed-off-by: Yogeswaran K <yogeswaransky@gmail.com>
Copilot AI review requested due to automatic review settings February 11, 2026 13:14
@yogeswaransky yogeswaransky requested a review from a team as a code owner February 11, 2026 13:14
Copy link
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

Updates unit tests to align with the new “fork elimination” HTTP implementation (connection-pool + libcurl), replacing older pipe/fork/read-based expectations and expanding the test mocks to interpose additional libcurl calls.

Changes:

  • Enable previously disabled xconf-client and protocol HTTP tests and update them to use curl/pool expectations instead of fork()/pipe().
  • Extend FileioMock interposition to cover curl_easy_getinfo() and curl_easy_setopt().
  • Add helper logic intended to avoid deadlocks when GTest/logging writes to FILE* while file I/O is mocked.

Reviewed changes

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

File Description
source/test/xconf-client/xconfclientTest.cpp Enables/updates doHttpGet tests to mock curl/pool behavior; adds a helper macro intended to prevent GTest logging deadlocks.
source/test/protocol/ProtocolTest.cpp Updates protocol HTTP tests to mock curl/pool behavior; adds default curl behaviors in fixture setup and a helper macro/comment.
source/test/mocks/FileioMock.h Adds/adjusts mock method signatures for curl interposition (curl_easy_setopt).
source/test/mocks/FileioMock.cpp Adds interposed curl_easy_getinfo() and a new interposed curl_easy_setopt() implementation for tests.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Signed-off-by: Yogeswaran K <yogeswaransky@gmail.com>
Signed-off-by: Yogeswaran K <yogeswaransky@gmail.com>
Copilot AI review requested due to automatic review settings February 13, 2026 20:05
Copy link
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 13 out of 13 changed files in this pull request and generated 6 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Signed-off-by: Yogeswaran K <yogeswaransky@gmail.com>
Signed-off-by: Yogeswaran K <yogeswaransky@gmail.com>
Copilot AI review requested due to automatic review settings February 15, 2026 07:38
Copy link
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 13 out of 13 changed files in this pull request and generated 12 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Signed-off-by: Yogeswaran K <yogeswaransky@gmail.com>
Signed-off-by: Yogeswaran K <yogeswaransky@gmail.com>
Copilot AI review requested due to automatic review settings February 15, 2026 10:48
Copy link
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 13 out of 13 changed files in this pull request and generated 8 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Signed-off-by: Yogeswaran K <yogeswaransky@gmail.com>
Signed-off-by: Yogeswaran K <yogeswaransky@gmail.com>
Copilot AI review requested due to automatic review settings February 15, 2026 16:14
Copy link
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 14 out of 14 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Signed-off-by: Yogeswaran K <yogeswaransky@gmail.com>
Signed-off-by: Yogeswaran K <yogeswaransky@gmail.com>
Copilot AI review requested due to automatic review settings February 15, 2026 17:46
Copy link
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 13 out of 13 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Signed-off-by: yogeswaransky <yogeswaransky@gmail.com>
Signed-off-by: yogeswaransky <yogeswaransky@gmail.com>
Copilot AI review requested due to automatic review settings February 16, 2026 14:29
Copy link
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 7 out of 7 changed files in this pull request and generated 16 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

return CURLE_OK;
});

//Add curl_easy_cleanup expectation
Copy link

Copilot AI Feb 16, 2026

Choose a reason for hiding this comment

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

Comment style inconsistency: This comment starts with a lowercase letter ('Add') while most other comments in the file start with uppercase letters or follow proper capitalization rules. For consistency, it should be 'Add curl_easy_cleanup expectation' with proper capitalization.

Suggested change
//Add curl_easy_cleanup expectation
// Add curl_easy_cleanup expectation

Copilot uses AI. Check for mistakes.
Comment on lines +324 to 325
EXPECT_EQ(T2ERROR_SUCCESS, sendReportOverHTTP(httpURL, payload));
free(payload);
Copy link

Copilot AI Feb 16, 2026

Choose a reason for hiding this comment

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

Inconsistent indentation: these lines use 6 spaces for indentation while the surrounding code uses 4 spaces. The indentation should be consistent with the rest of the test function.

Copilot uses AI. Check for mistakes.
})
.WillOnce(Return(-1));
EXPECT_EQ(T2ERROR_FAILURE, doHttpGet("https://test.com", &data));
//Add curl_easy_cleanup expectation
Copy link

Copilot AI Feb 16, 2026

Choose a reason for hiding this comment

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

Comment style inconsistency: This comment starts with a lowercase letter ('Add') while most other comments in the file start with uppercase letters or follow proper capitalization rules. For consistency, it should be 'Add curl_easy_cleanup expectation' with proper capitalization.

Suggested change
//Add curl_easy_cleanup expectation
// Add curl_easy_cleanup expectation

Copilot uses AI. Check for mistakes.
}

// Pre-allocate easy handles and initialize pool entries
// Allocating easy handles and initialize pool entries
Copy link

Copilot AI Feb 16, 2026

Choose a reason for hiding this comment

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

Grammar issue: The comment should be 'Allocate easy handles and initialize pool entries' (with 'Allocate' in present tense to match 'initialize'). As written, 'Allocating' is a gerund/present participle while 'initialize' is a verb, creating a grammatical inconsistency.

Suggested change
// Allocating easy handles and initialize pool entries
// Allocate easy handles and initialize pool entries

Copilot uses AI. Check for mistakes.
}

// Clean up certificates - only for non-LIBRDKCERTSEL_BUILD path
// In case of CertSelector, CertSelector will take care of freeing the certicates
Copy link

Copilot AI Feb 16, 2026

Choose a reason for hiding this comment

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

Spelling error: 'certicates' should be 'certificates'.

Suggested change
// In case of CertSelector, CertSelector will take care of freeing the certicates
// In case of CertSelector, CertSelector will take care of freeing the certificates

Copilot uses AI. Check for mistakes.
CURL_SETOPT_CHECK(easy, CURLOPT_SSL_VERIFYPEER, 1L);

// Execute the request directly
// Execute the request and retry incase of certificate related error
Copy link

Copilot AI Feb 16, 2026

Choose a reason for hiding this comment

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

Spelling error: 'incase' should be two words: 'in case'.

Suggested change
// Execute the request and retry incase of certificate related error
// Execute the request and retry in case of certificate related error

Copilot uses AI. Check for mistakes.
Comment on lines +274 to 275
EXPECT_EQ(T2ERROR_SUCCESS, sendReportOverHTTP(httpURL, payload));
free(payload);
Copy link

Copilot AI Feb 16, 2026

Choose a reason for hiding this comment

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

Inconsistent indentation: these lines use 6 spaces for indentation while the surrounding code uses 4 spaces. The indentation should be consistent with the rest of the test function.

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