RDK-60476: Update L1 and L2 testcases for fork elimination#260
RDK-60476: Update L1 and L2 testcases for fork elimination#260yogeswaransky wants to merge 13 commits intodevelopfrom
Conversation
Signed-off-by: Yogeswaran K <yogeswaransky@gmail.com>
There was a problem hiding this comment.
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
FileioMockinterposition to covercurl_easy_getinfo()andcurl_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>
There was a problem hiding this comment.
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>
There was a problem hiding this comment.
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>
There was a problem hiding this comment.
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>
There was a problem hiding this comment.
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>
There was a problem hiding this comment.
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>
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
| //Add curl_easy_cleanup expectation | |
| // Add curl_easy_cleanup expectation |
| EXPECT_EQ(T2ERROR_SUCCESS, sendReportOverHTTP(httpURL, payload)); | ||
| free(payload); |
There was a problem hiding this comment.
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.
| }) | ||
| .WillOnce(Return(-1)); | ||
| EXPECT_EQ(T2ERROR_FAILURE, doHttpGet("https://test.com", &data)); | ||
| //Add curl_easy_cleanup expectation |
There was a problem hiding this comment.
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.
| //Add curl_easy_cleanup expectation | |
| // Add curl_easy_cleanup expectation |
| } | ||
|
|
||
| // Pre-allocate easy handles and initialize pool entries | ||
| // Allocating easy handles and initialize pool entries |
There was a problem hiding this comment.
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.
| // Allocating easy handles and initialize pool entries | |
| // Allocate easy handles and initialize pool entries |
| } | ||
|
|
||
| // Clean up certificates - only for non-LIBRDKCERTSEL_BUILD path | ||
| // In case of CertSelector, CertSelector will take care of freeing the certicates |
There was a problem hiding this comment.
Spelling error: 'certicates' should be 'certificates'.
| // In case of CertSelector, CertSelector will take care of freeing the certicates | |
| // In case of CertSelector, CertSelector will take care of freeing the certificates |
| CURL_SETOPT_CHECK(easy, CURLOPT_SSL_VERIFYPEER, 1L); | ||
|
|
||
| // Execute the request directly | ||
| // Execute the request and retry incase of certificate related error |
There was a problem hiding this comment.
Spelling error: 'incase' should be two words: 'in case'.
| // Execute the request and retry incase of certificate related error | |
| // Execute the request and retry in case of certificate related error |
| EXPECT_EQ(T2ERROR_SUCCESS, sendReportOverHTTP(httpURL, payload)); | ||
| free(payload); |
There was a problem hiding this comment.
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.
No description provided.