Skip to content

Commit dcd4329

Browse files
committed
Add operation test and connectivity check in telemetry test
Signed-off-by: James Rhodes <jarhodes314@gmail.com>
1 parent eaad4bd commit dcd4329

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
*** Settings ***
2+
Resource ../../../resources/common.resource
3+
Library Cumulocity
4+
Library ThinEdgeIO
5+
6+
Test Tags theme:c8y theme:troubleshooting theme:plugins
7+
Suite Setup Custom Setup
8+
Test Teardown Get Logs
9+
10+
*** Test Cases ***
11+
12+
Successful shell command with output
13+
${operation}= Cumulocity.Execute Shell Command echo helloworld
14+
Operation Should Be SUCCESSFUL ${operation}
15+
Should Be Equal ${operation.to_json()["c8y_Command"]["result"]} helloworld\n
16+
17+
Check Successful shell command with literal double quotes output
18+
${operation}= Cumulocity.Execute Shell Command echo \\"helloworld\\"
19+
Operation Should Be SUCCESSFUL ${operation}
20+
Should Be Equal ${operation.to_json()["c8y_Command"]["result"]} "helloworld"\n
21+
22+
Execute multiline shell command
23+
${operation}= Cumulocity.Execute Shell Command echo "hello"${\n}echo "world"
24+
Operation Should Be SUCCESSFUL ${operation}
25+
Should Be Equal ${operation.to_json()["c8y_Command"]["result"]} hello\nworld\n
26+
27+
Failed shell command
28+
${operation}= Cumulocity.Execute Shell Command exit 1
29+
Operation Should Be FAILED ${operation}
30+
31+
32+
*** Keywords ***
33+
34+
Custom Setup
35+
${DEVICE_SN}= Setup
36+
Set Suite Variable $DEVICE_SN
37+
Device Should Exist ${DEVICE_SN}
38+
ThinEdgeIO.Execute Command tedge config set c8y.bridge.built_in true
39+
ThinEdgeIO.Execute Command tedge config set c8y.bridge.topic_prefix custom-c8y
40+
ThinEdgeIO.Transfer To Device ${CURDIR}/command_handler.* /etc/tedge/operations/command
41+
ThinEdgeIO.Transfer To Device ${CURDIR}/c8y_Command* /etc/tedge/operations/c8y/
42+
ThinEdgeIO.Restart Service tedge-agent
43+
ThinEdgeIO.Execute Command tedge reconnect c8y

tests/RobotFramework/tests/cumulocity/telemetry/thin-edge_device_telemetry_built-in_bridge.robot

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,3 +276,5 @@ Custom Setup
276276
ThinEdgeIO.Execute Command tedge reconnect c8y
277277
File Should Not Exist /etc/tedge/mosquitto-conf/c8y-bridge.conf
278278
Service Health Status Should Be Up tedge-mapper-c8y
279+
${output}= Execute Command sudo tedge connect c8y --test
280+
Should Contain ${output} Connection check to c8y cloud is successful.

0 commit comments

Comments
 (0)