-
Notifications
You must be signed in to change notification settings - Fork 8
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
Add basic TLS common tests #72
Conversation
Start a cluster with TLS and verify that ered can communicate with the cluster, and verify the behavior when using an expired client certificate. Some tests require the tool `faketime` to modify the system time, but tests are skipped if the tool is not available in PATH. https://manpages.ubuntu.com/manpages/trusty/man1/faketime.1.html
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.
Skimmed though it. Looks good. We could do something to avoid the duplicated helper code, if you want.
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! TLS tests are good to have.
Just a question about the tls
directory. Do we want it to created by the test in the current directory? I can't see any problem with that right now, so guess it's fine.
end. | ||
|
||
generate_tls_certs() -> | ||
filelib:ensure_path("tls/"), |
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.
This requires that the current directory is something specific? At least, the test needs write permissions in the current directory to create the tls directory and the certs.
The test doesn't delete the certs afterwards, right? Will openssl overwrite the files if we run the test again?
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.
When using rebar3, as we do in CI and probably most users, the current directory path is set by the common test runner.
The tls files are placed like:
<ered repo>/_build/test/logs/[email protected]_15.42.48/tls/client.crt
These files are not overwritten since rebar3 creates a new directory for each run, which might be good when reproducing an issue.
Start a cluster with TLS and verify that ered can communicate with the cluster,
and verify the behavior when using an expired client certificate.
Some tests require the tool faketime to modify the system time,
but tests are skipped if the tool is not available in PATH.