-
Notifications
You must be signed in to change notification settings - Fork 25
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
[VC-37264] Update E2E test to check for certificate in the API #629
base: master
Are you sure you want to change the base?
Conversation
f5b2cc7
to
90b32db
Compare
90b32db
to
18ed1ca
Compare
Signed-off-by: Richard Wall <[email protected]>
18ed1ca
to
7e0b8d0
Compare
set +o pipefail | ||
kubectl logs deployments/venafi-kubernetes-agent \ | ||
--follow \ | ||
--namespace venafi \ | ||
| timeout 60 jq 'if .msg | test("Data sent successfully") then . | halt_error(0) end' | ||
set -o pipefail |
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.
I'd accidentally removed this pipefail trick in #596
and it resulted in the test always exiting with a 141 status.
I've restored it here so that the new shell lines can run after the "Data sent successfully" message.
} | ||
|
||
# Wait 5 minutes for the certificate to appear. | ||
for ((i=0;;i++)); do if getCertificate; then exit 0; fi; sleep 30; done | timeout -v -- 5m cat |
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.
I didn't realise that you can pipe into the timeout
command. This allows me to run the getCertificate
repeatedly until it succeeds, or until the timeout expires.
I adapted the commands that @maelvls described in the PR #628.
The E2E test script will now create a TLS certificate in a Secret (not managed by cert-manager) with a unique common name,
and wait for a certificate with that unique common name to appear in the Venafi Cloud API.
Signifying that the venafi-kubernetes-agent has successfully uploaded the data and that the TLSPK backend has successfully processed the data.