-
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 #3028 from reubenmiller/fix-builtin-bridge-qos-0
fix: built-in MQTT bridge handling of QoS 0 messages published to the cloud topic
- Loading branch information
Showing
2 changed files
with
54 additions
and
1 deletion.
There are no files selected for viewing
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
37 changes: 37 additions & 0 deletions
37
tests/RobotFramework/tests/cumulocity/bridge_config/builtin_bridge.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,37 @@ | ||
*** Settings *** | ||
Resource ../../../resources/common.resource | ||
Library Cumulocity | ||
Library ThinEdgeIO | ||
|
||
Test Setup Custom Setup | ||
Test Teardown Get Logs | ||
|
||
*** Test Cases *** | ||
|
||
Connection test | ||
[Documentation] Repeatedly test the cloud connection | ||
FOR ${attempt} IN RANGE 0 10 1 | ||
${output}= Execute Command tedge connect c8y --test timeout=10 | ||
Should Not Contain ${output} connection check failed | ||
END | ||
|
||
|
||
Support publishing QoS 0 messages to c8y topic #2960 | ||
[Documentation] Verify the publishing of multiple QoS 0 message directly to the cloud connection | ||
... Note 1: Since QoS 0 aren't guarenteed to be delivered, use a non-strict assertion on the exact event count in the cloud. | ||
... During testing the test would reliably fail if the expected count is less than 10 messages. | ||
... Note 2: The bridge will automatically change the QoS from 0 when translating messages from te/# to c8y/#, | ||
... we can't use the te/# topics in the test. | ||
FOR ${attempt} IN RANGE 0 20 1 | ||
Execute Command tedge mqtt pub -q 0 c8y/s/us '400,test_q0,Test event with qos 0 attempt ${attempt}' timeout=10 | ||
END | ||
Cumulocity.Device Should Have Event/s expected_text=Test event with qos 0.* type=test_q0 minimum=10 | ||
|
||
|
||
*** Keywords *** | ||
|
||
Custom Setup | ||
${DEVICE_SN}= Setup | ||
Set Suite Variable ${DEVICE_SN} | ||
Execute Command tedge config set mqtt.bridge.built_in true | ||
Execute Command tedge reconnect c8y |