-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Verify certificates can be uploaded with custom root cert path
- Loading branch information
1 parent
f0fa54f
commit 7bb67d5
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
tests/RobotFramework/tests/tedge/tedge_upload_cert_custom_root_cert_path.robot
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
*** Settings *** | ||
Documentation Run certificate upload test and fails to upload the cert because there is no root certificate directory, | ||
... Then check the negative response in stderr | ||
Resource ../../resources/common.resource | ||
Library ThinEdgeIO | ||
|
||
Test Tags theme:cli theme:mqtt theme:c8y adapter:docker | ||
Test Teardown Get Logs | ||
|
||
*** Test Cases *** | ||
tedge cert upload c8y respects root cert path | ||
[Setup] Setup With Self-Signed Certificate | ||
Execute Command sudo tedge disconnect c8y | ||
${output}= Execute Command sudo tedge cert renew stderr=${True} stdout=${False} ignore_exit_code=${True} | ||
Should Contain ${output} Certificate was successfully renewed, for un-interrupted service, the certificate has to be uploaded to the cloud | ||
Execute Command mv /etc/ssl/certs /etc/ssl/certs_test | ||
Execute Command tedge config set c8y.root_cert_path /etc/ssl/certs_test | ||
Execute Command cmd=sudo env C8Y_USER='${C8Y_CONFIG.username}' C8Y_PASSWORD='${C8Y_CONFIG.password}' tedge cert upload c8y | ||
${output}= Execute Command sudo tedge connect c8y | ||
Should Contain ${output} Connection check is successful. | ||
|
||
*** Keywords *** | ||
Setup With Self-Signed Certificate | ||
${DEVICE_SN}= Setup skip_bootstrap=${True} | ||
Set Test Variable $DEVICE_SN | ||
Execute Command test -f ./bootstrap.sh && ./bootstrap.sh --cert-method selfsigned |