Skip to content

Commit

Permalink
tests: add system tests for tedge config add/remove commands
Browse files Browse the repository at this point in the history
Signed-off-by: Krzysztof Piotrowski <[email protected]>
  • Loading branch information
Ruadhri17 committed Jun 18, 2024
1 parent f907298 commit e1fe9b3
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions tests/RobotFramework/tests/tedge/tedge_config_add_remove.robot
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"]

0 comments on commit e1fe9b3

Please sign in to comment.