-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add and update regarding device.id and tedge connect
* tedge connect c8y uses device.id directly. The CN from certificate is no longer used to determine device.id * tedge connect c8y returns an error if device.id mismatches the certificate's CN when auth method is certificate Signed-off-by: Rina Fujino <[email protected]>
- Loading branch information
Showing
2 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
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
34 changes: 34 additions & 0 deletions
34
tests/RobotFramework/tests/tedge_connect/tedge_connect_cn_validation.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,34 @@ | ||
*** Settings *** | ||
Resource ../../resources/common.resource | ||
Library Cumulocity | ||
Library ThinEdgeIO | ||
Library ../../.venv/lib/python3.11/site-packages/robot/libraries/String.py | ||
|
||
Suite Teardown Get Logs | ||
Test Setup Custom Setup | ||
|
||
Test Tags theme:c8y theme:cli | ||
|
||
|
||
*** Test Cases *** | ||
Certificate's CN must match device.id | ||
${cert_output}= Execute Command tedge cert show | ||
Should Contain ${cert_output} ${DEVICE_SN} | ||
|
||
Execute Command tedge config set device.id foo | ||
${output}= Execute Command tedge connect c8y | ||
... exp_exit_code=1 | ||
... stdout=False | ||
... stderr=True | ||
... timeout=0 | ||
... strip=True | ||
Should Be Equal | ||
... ${output} | ||
... error: device.id 'foo' mismatches to the device certificate's CN '${DEVICE_SN}' | ||
|
||
|
||
*** Keywords *** | ||
Custom Setup | ||
${device_sn}= Setup skip_bootstrap=${True} | ||
Execute Command ./bootstrap.sh --no-connect | ||
Set Test Variable $DEVICE_SN ${device_sn} |