dapr
dapr copied to clipboard
Add e2e test for root cert installation feature
Description
Add end to end test for certificate installation feature. This PR tests the cert installation feature with HTTPS bindings. A web server (part of test app) hosts a secured endpoint that is invoked by the sidecar using HTTP binding. This requires the sidecar to trust the correct SSL certificate.
Overview of the PR:
- utils/http-server.go -
StartServer
supports anenableTLS
option to start a secured server based on two environment variables -DAPR_TESTS_TLS_CERT
andDAPR_TESTS_TLS_KEY
. - utils/tls.go - Helper function to generate new SSL certificate and key
- platforms/kubernetes - Two new configurations -
AppVolumeMounts
to mount volumes to the app container, andDaprEnv
to set sidecar environment variables - test/apps/injectorapp-init - Generates new certificate and key before the actual containers start. This is used by (1) app container to start new HTTPS server, and (2) sidecar container to trust them while making HTTPS call.
- test/apps.injectorapp - Set the required env var and start another server in background with HTTPS enabled. Also adds a
bindingTest
method for testing the HTTPS binding. - e2e/injector - Sets up the k8s pods and container and triggers test for testing if SSL cert was installed.
Issue reference
Please reference the issue this PR will close: #4835
Checklist
Please make sure you've completed the relevant tasks for this PR, out of the following list:
- [ ] Code compiles correctly
- [ ] Created/updated tests
- [ ] Unit tests passing
- [ ] End-to-end tests passing
- [ ] Extended the documentation / Created issue in the https://github.com/dapr/docs/ repo: dapr/docs#[issue number]
- [ ] Specification has been updated / Created issue in the https://github.com/dapr/docs/ repo: dapr/docs#[issue number]
- [ ] Provided sample for the feature / Created issue in the https://github.com/dapr/docs/ repo: dapr/docs#[issue number]
Codecov Report
Merging #4931 (6e13cc5) into master (327900f) will increase coverage by
0.02%
. The diff coverage isn/a
.
@@ Coverage Diff @@
## master #4931 +/- ##
==========================================
+ Coverage 65.53% 65.55% +0.02%
==========================================
Files 112 112
Lines 12325 12325
==========================================
+ Hits 8077 8080 +3
+ Misses 3671 3669 -2
+ Partials 577 576 -1
Impacted Files | Coverage Δ | |
---|---|---|
pkg/actors/internal/placement.go | 89.11% <0.00%> (+1.55%) |
:arrow_up: |
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
/ok-to-test
Congrats! All end-to-end tests have passed on linux. Thanks for your contribution!
End-to-end tests failed on windows. Please check the build logs
/ok-to-test
Congrats! All end-to-end tests have passed on linux. Thanks for your contribution!
End-to-end tests failed on windows. Please check the build logs
/ok-to-test
Congrats! All end-to-end tests have passed on linux. Thanks for your contribution!
Congrats! All end-to-end tests have passed on windows. Thanks for your contribution!
FYI @ItalyPaleAle
LGTM!