Skip to content

Commit a2e2e19

Browse files
committed
test: robust teardown for Cumulocity CA cloud profile test
Disconnect the device before deleting it from Cumulocity. Otherwise the mapper that's left running can re-create the deleted device, with the availability messages that's sent periodically.
1 parent d06b8a5 commit a2e2e19

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tests/RobotFramework/tests/cumulocity/registration/cumulocity_ca.robot

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ Certificate Renewal with Cloud Profiles
7676

7777
${cert_after}= Execute Command tedge cert show c8y --profile customer | grep Thumbprint
7878
Should Not Be Equal ${cert_before} ${cert_after}
79-
[Teardown] Cumulocity.Delete Managed Object And Device User external_id=${DEVICE_SN_2}
79+
[Teardown] Disconnect And Delete Device From Cumulocity profile=customer external_id=${DEVICE_SN_2}
8080

8181

8282
*** Keywords ***
@@ -91,3 +91,8 @@ Setup With Self-Signed Certificate
9191
Setup With Cumulocity CA Certificate
9292
${DEVICE_SN}= Setup register_using=c8y-ca
9393
Set Test Variable $DEVICE_SN
94+
95+
Disconnect And Delete Device From Cumulocity
96+
[Arguments] ${profile} ${external_id}
97+
Execute Command tedge disconnect c8y --profile ${profile} ignore_exit_code=${True}
98+
Cumulocity.Delete Managed Object And Device User ${external_id}

0 commit comments

Comments
 (0)