Skip to content

Commit

Permalink
test: add system test for custom topic
Browse files Browse the repository at this point in the history
Signed-off-by: Krzysztof Piotrowski <[email protected]>
  • Loading branch information
Ruadhri17 committed Oct 16, 2024
1 parent 27bc06d commit 121f19c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[exec]
topic = "${.topic.root_prefix}/custom/topic/one"
on_fragment = "c8y_Command"
command = "/etc/tedge/operations/command ${.payload.c8y_Command.text}"
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,20 @@ Run shell custom operation for main device and do not publish the status
... minimum=0
... maximum=0

Run shell custom operation for main device with custom topic
ThinEdgeIO.Transfer To Device ${CURDIR}/c8y_Command_3 /etc/tedge/operations/c8y/c8y_Command
Restart Service tedge-mapper-c8y
${prefix}= Execute Command tedge config get c8y.bridge.topic_prefix strip=True

Execute Command
... tedge mqtt pub --retain '${prefix}/custom/topic/one' '{"status":"PENDING","id":"1234","c8y_Command":{"text":"echo helloworld"},"externalSource":{"externalId":"${DEVICE_SN}","type":"c8y_Serial"}}'

Should Have MQTT Messages
... c8y/s/us
... message_pattern=^(504|505|506),[0-9]+($|,\\"helloworld\n\\")
... minimum=2
... maximum=2


*** Keywords ***
Custom Setup
Expand Down

0 comments on commit 121f19c

Please sign in to comment.