-
Notifications
You must be signed in to change notification settings - Fork 5.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial CMocka testing against web_client.c (issue #7229). #7264
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Live data from captured from an instrumented host, this mixed fuzzing by the tool against access from various browsers. A CMocka test-driver has been added to replay the headers against the http request processing code. Enough stubs / mocking code has been written to check that we can inject a chosen raw request into the web_client code and check it was processed.
This is a modified version of Vlad's clag-format from his WIP PR on the exporters, and the code updated to match it.
Each endpoint in the API will be checked against a variety of http requests. This function builds the request on demand for each test-case and cleans up afterwards. Quick sketch of how this will be hooked into the testgenerator for CMocka. Current problems: * Produces incorrect status codes (unit-test or request validation?) * Strange sizes being reported during execution of web_client code. * Needs to step through partial buffer fills.
We don't need the live capture data in the tree (squashing this chain of commits will remove it) and @vlvkobal was currently changing the .clang-format so avoid conflicts. Although this version was better :)
amoss
requested review from
cakrit,
cosmix,
knatsakis,
mfundul,
thiagoftsm and
vlvkobal
as code owners
November 6, 2019 22:40
Manage this branch in SquashTest this branch here: https://amossissue-7229-eqtn8.squash.io |
amoss
requested review from
ilyam8
and removed request for
knatsakis,
cakrit,
mfundul and
thiagoftsm
November 6, 2019 22:41
vlvkobal
approved these changes
Nov 7, 2019
ilyam8
approved these changes
Nov 7, 2019
jackyhuang85
pushed a commit
to jackyhuang85/netdata
that referenced
this pull request
Jan 1, 2020
…tdata#7264) * Start of unit-test for http request processing. A CMocka test-driver has been added to replay the live-capture headers against the http request processing code. Enough stubs / mocking code have been written to check that we can inject a chosen raw request into the web_client code and check how it was processed. A parameterised buffer building function can setup requests for testing in `web_buffer` structures. Each endpoint in the API will be checked against a variety of http requests. This PoC demonstrates enough functionality to show building the request on demand for each test-case and cleaning up afterwards.
Saruspete
pushed a commit
to Saruspete/netdata
that referenced
this pull request
May 21, 2020
…tdata#7264) * Start of unit-test for http request processing. A CMocka test-driver has been added to replay the live-capture headers against the http request processing code. Enough stubs / mocking code have been written to check that we can inject a chosen raw request into the web_client code and check how it was processed. A parameterised buffer building function can setup requests for testing in `web_buffer` structures. Each endpoint in the API will be checked against a variety of http requests. This PoC demonstrates enough functionality to show building the request on demand for each test-case and cleaning up afterwards.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #7229
Component Name
area/web
area/testing
Additional Information
PoC for CMocka testing against
web_client.c
. Marks the end of investigating which parts of the http request processing code need to be tested.