-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Fix all TLS tests and framework #6170
Conversation
8009fd8
to
1431851
Compare
Thanks for working on this @Smjert. It looks like the BUCK errors are easy to fix and caused by fixing the placement of the enroll plugins. The test failures may be because we need to seed the RNG for the HTTPS server port selection, that and implement a retry for when it select a random port already in use. Is there anything I can do to help move this forward out of draft? |
Thanks for the offer and for the tips! |
Ah wow, this will be super awesome to have! It looks like this should take us a very long way in building testing for #6197. @Smjert lemme know if there's anything I can do to help! I'll get a review on this today, but I think I'll hold off on doing too much heavy lifting to get tests for #6197 until this ships, as this should help a lot in testing our TLS verifications, thanks! |
- Return a Status when starting the test_http_server, so tests will fail if the server start fails. - Fixes to support HTTP 1.1 - Changes to make the script and configuration files it depends on relocatable, avoiding hardcoded paths or paths relative to the script itself - Do not accept partial failures, they could hide bugs; in the future if there are specific cases where the test is expected to fail, lets check for those specific cases, one by one. - Move osquery/remote/enroll plugin and tests to plugin/remote/enroll
Also change how the python script is launched, avoiding having to go through a shell. In this way we immediately have the pid of the python script, and we can more easily understand if the listening port is matched with the right process.
1431851
to
ee3aa1d
Compare
@muffins This should be ready; I also had to change the function that launches the python script process because it was using a shell in between and it was causing issues with matching pids, to understand if the process that was using a certain port was the one we expected or not. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Just one nitpick
} | ||
ASSERT_FALSE(status.ok()); | ||
|
||
#if OSQUERY_WINDOWS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick, I think we should use isPlatform instead of the preprocessor here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm! Thanks for the hard work here @Smjert !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah looks like there's some trouble with that PlatformType
, maybe missing the header include? Or the lib in BUCK for #include <osquery/utils/info/platform_type.h>
? Otherwise lgtm!
38c4bb5
to
2ffd913
Compare
Yeah sorry, was too quick, just changed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Outstanding!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
if the server start fails.
relocatable, avoiding hardcoded paths or paths relative
to the script itself
if there are specific cases where the test is expected to fail,
lets check for those specific cases, one by one.
Closes #5768
Should address #6169