summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorGligor <gligorisaev@gmail.com>2022-08-05 12:10:40 +0200
committerGligor <gligorisaev@gmail.com>2022-08-10 11:29:44 +0200
commit4907b14d6a43546837babe7c6d9a05423b7346bb (patch)
tree77e417dea7698096e577fe0fb9a0ba5904d56698 /tests
parentfd178124731a39aac6384be65218a33e4e137480 (diff)
Add RF test case for MQTT health check c8y
Testing MQTT Health endpoints, both testcases added in one robot file
Diffstat (limited to 'tests')
-rw-r--r--tests/RobotFramework/MQTT_health_check/MQTT_health_endpoints.robot53
1 files changed, 53 insertions, 0 deletions
diff --git a/tests/RobotFramework/MQTT_health_check/MQTT_health_endpoints.robot b/tests/RobotFramework/MQTT_health_check/MQTT_health_endpoints.robot
new file mode 100644
index 00000000..e719b507
--- /dev/null
+++ b/tests/RobotFramework/MQTT_health_check/MQTT_health_endpoints.robot
@@ -0,0 +1,53 @@
+*** Settings ***
+Library SSHLibrary
+Suite Setup Open Connection And Log In
+Suite Teardown SSHLibrary.Close All Connections
+
+*** Variables ***
+${HOST} 192.168.100.110
+${USERNAME} pi
+${PASSWORD} thinedge
+${pid}
+*** Tasks ***
+
+Connect to Cumulocity
+ ${rc}= Execute Command sudo tedge connect c8y
+ Log ${rc}=
+
+Start c8y-log-plugin
+ ${rc}= Execute Command sudo systemctl start c8y-log-plugin.service return_stdout=False return_rc=True
+ Should Be Equal As Integers ${rc} 0
+
+Note the PID Number
+ ${pid} Execute Command pgrep c8y_log_plugin
+ Set Suite Variable ${pid}
+
+Start MQTT Subscriber c8y-log-plugin & send empty message
+
+ Write sudo tedge mqtt sub 'tedge/health/c8y-log-plugin' &
+ Write sudo tedge mqtt pub 'tedge/health-check/c8y-log-plugin' ''
+ ${output}= Read delay=1s
+ Should Contain ${output} "pid":${pid}
+ Should Contain ${output} "status":"up"
+
+Start c8y-configuration-plugin
+ ${rc}= Execute Command sudo systemctl start c8y-configuration-plugin.service return_stdout=False return_rc=True
+ Should Be Equal As Integers ${rc} 0
+
+Note the PID Number
+ ${pid} Execute Command pgrep c8y_configurati
+ Set Suite Variable ${pid}
+
+Start MQTT Subscriber health-check & send empty message
+
+ Write sudo tedge mqtt sub 'tedge/health/c8y-configuration-plugin' &
+ Write sudo tedge mqtt pub 'tedge/health-check/c8y-configuration-plugin' ''
+ ${output}= Read delay=1s
+ Should Contain ${output} "pid":${pid}
+ Should Contain ${output} "status":"up"
+
+*** Keywords ***
+Open Connection And Log In
+ SSHLibrary.Open Connection ${HOST}
+ SSHLibrary.Login ${USERNAME} ${PASSWORD}
+ \ No newline at end of file