File tree Expand file tree Collapse file tree 2 files changed +33
-2
lines changed
crates/common/mqtt_channel/src
tests/RobotFramework/tests/mqtt Expand file tree Collapse file tree 2 files changed +33
-2
lines changed Original file line number Diff line number Diff line change @@ -271,9 +271,10 @@ impl Connection {
271
271
. await ?;
272
272
}
273
273
274
- if config. session_name . is_none ( ) {
274
+ if config. session_name . is_none ( ) || !ack . session_present {
275
275
// Workaround for https://github.com/bytebeamio/rumqtt/issues/250
276
- // If session_name is not provided, then re-subscribe
276
+ // If session_name is not provided or if the broker session persistence
277
+ // is not enabled or working, then re-subscribe
277
278
278
279
let subscriptions = config. subscriptions . filters ( ) ;
279
280
// Need check here otherwise it will hang waiting for a SubAck, and none will come when there is no subscription.
Original file line number Diff line number Diff line change
1
+ *** Settings ***
2
+ Resource ../../resources/common.resource
3
+ Library Cumulocity
4
+ Library ThinEdgeIO
5
+
6
+ Test Setup Custom Setup
7
+ Test Teardown Get Logs
8
+
9
+ Test Tags theme:mqtt theme:c8y
10
+
11
+
12
+ *** Test Cases ***
13
+ Agent Processes Operations After Local MQTT Broker Disconnects Without Mosquitto Persistence Settings
14
+ # Force tedge-agent to disconnect by restarting mosquitto
15
+ Restart Service mosquitto
16
+ ${operation } = Cumulocity.Get Configuration tedge-configuration-plugin
17
+ Operation Should Be SUCCESSFUL ${operation }
18
+
19
+
20
+ *** Keywords ***
21
+ Custom Setup
22
+ ${DEVICE_SN } = Setup
23
+ Set Suite Variable $DEVICE_SN
24
+ Device Should Exist ${DEVICE_SN }
25
+ # Remove mosquitto persistence settings
26
+ Execute Command sed -i '/^persistence.*/d' /etc/mosquitto/mosquitto.conf
27
+
28
+ # Restart mosquitto to start again ignoring pre-existing persisted data
29
+ # Note: Tests should not rely on the mosquitto service restarting in the test setup
30
+ Restart Service mosquitto
You can’t perform that action at this time.
0 commit comments