-
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.
Merge pull request #2602 from Ruadhri17/custom-operation-subcommands
Add support for commands with multiple arguments in custom operations
- Loading branch information
Showing
9 changed files
with
93 additions
and
10 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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
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
4 changes: 4 additions & 0 deletions
4
...tFramework/tests/cumulocity/custom_operation/custom_operation_multiple_args/c8y_Command_1
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,4 @@ | ||
[exec] | ||
topic = "c8y/s/ds" | ||
on_message = "511" | ||
command = "sh /etc/tedge/operations/command_1.sh" |
2 changes: 2 additions & 0 deletions
2
...otFramework/tests/cumulocity/custom_operation/custom_operation_multiple_args/command_1.sh
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,2 @@ | ||
#!/bin/bash | ||
echo "command 1" |
26 changes: 26 additions & 0 deletions
26
...om_operation/custom_operation_multiple_args/operation_multiple_arguments_in_command.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,26 @@ | ||
*** Settings *** | ||
Resource ../../../../resources/common.resource | ||
Library Cumulocity | ||
Library ThinEdgeIO | ||
|
||
Test Setup Custom Setup | ||
Test Teardown Get Logs | ||
|
||
Test Tags theme:c8y theme:operation theme:custom | ||
|
||
|
||
*** Test Cases *** | ||
Run the custom operation with multiple arguments | ||
${operation}= Cumulocity.Create Operation description=do something fragments={"c8y_Command":{"text":""}} | ||
Operation Should Be SUCCESSFUL ${operation} | ||
Should Be Equal ${operation.to_json()["c8y_Command"]["result"]} command 1\n | ||
|
||
|
||
*** Keywords *** | ||
Custom Setup | ||
${DEVICE_SN}= Setup | ||
Set Suite Variable $DEVICE_SN | ||
Device Should Exist ${DEVICE_SN} | ||
ThinEdgeIO.Transfer To Device ${CURDIR}/command_1.sh /etc/tedge/operations/ | ||
Execute Command chmod a+x /etc/tedge/operations/command_1.sh | ||
ThinEdgeIO.Transfer To Device ${CURDIR}/c8y_Command_1 /etc/tedge/operations/c8y/c8y_Command |
952f0d1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Robot Results