-
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.
tests: add system tests for tedge config add/remove commands
Signed-off-by: Krzysztof Piotrowski <[email protected]>
- Loading branch information
Showing
1 changed file
with
59 additions
and
0 deletions.
There are no files selected for viewing
59 changes: 59 additions & 0 deletions
59
tests/RobotFramework/tests/tedge/tedge_config_add_remove.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,59 @@ | ||
*** Settings *** | ||
Resource ../../resources/common.resource | ||
Library ThinEdgeIO | ||
|
||
Suite Setup Setup | ||
Suite Teardown Get Logs | ||
|
||
Test Tags theme:cli theme:configuration | ||
|
||
|
||
*** Test Cases *** | ||
tedge config add/remove value in empty array type config | ||
Execute Command sudo tedge config add c8y.smartrest.templates 1 | ||
${add} Execute Command tedge config list | ||
Should Contain ${add} c8y.smartrest.templates=["1"] | ||
|
||
Execute Command sudo tedge config remove c8y.smartrest.templates 1 | ||
${remove} Execute Command tedge config list | ||
Should Contain ${remove} c8y.smartrest.templates=[] | ||
|
||
tedge config add/remove value in non-empty array type config | ||
Execute Command sudo tedge config set c8y.smartrest.templates 1 | ||
${set} Execute Command tedge config list | ||
Should Contain ${set} c8y.smartrest.templates=["1"] | ||
|
||
Execute Command sudo tedge config add c8y.smartrest.templates 2,3 | ||
${add} Execute Command tedge config list | ||
Should Contain ${add} c8y.smartrest.templates=["1", "2", "3"] | ||
|
||
Execute Command sudo tedge config remove c8y.smartrest.templates 1,2,3 | ||
${remove} Execute Command tedge config list | ||
Should Contain ${remove} c8y.smartrest.templates=[] | ||
|
||
tedge config add/remove value in single value type config | ||
Execute Command sudo tedge config add device.type changed-type | ||
${add} Execute Command tedge config list | ||
Should Contain ${add} device.type=changed-type | ||
|
||
Execute Command sudo tedge config remove device.type changed-type | ||
${remove} Execute Command tedge config list | ||
Should Contain ${remove} device.type=thin-edge.io | ||
|
||
tedge config skip duplicates | ||
Execute Command sudo tedge config add c8y.smartrest.templates 1,2 | ||
${add} Execute Command tedge config list | ||
Should Contain ${add} c8y.smartrest.templates=["1", "2"] | ||
|
||
Execute Command sudo tedge config add c8y.smartrest.templates 1,2 | ||
${add} Execute Command tedge config list | ||
Should Contain ${add} c8y.smartrest.templates=["1", "2"] | ||
|
||
tedge config skip value to remove if it does not match | ||
Execute Command sudo tedge config add c8y.smartrest.templates 1,2 | ||
${add} Execute Command tedge config list | ||
Should Contain ${add} c8y.smartrest.templates=["1", "2"] | ||
|
||
Execute Command sudo tedge config remove c8y.smartrest.templates 3,4 | ||
${remove} Execute Command tedge config list | ||
Should Contain ${remove} c8y.smartrest.templates=["1", "2"] |