|
22 | 22 | | | Subscribe to MQTT Broker and Validate | client.id=${client} | topic=${topic} | message=${message} |
23 | 23 |
|
24 | 24 | | Publish multiple messages and confirm that validation succeeds only after correct message is published |
25 | | -| | Sleep | 1s |
26 | 25 | | | ${time} | Get Time | epoch |
27 | 26 | | | ${client} | Catenate | SEPARATOR=. | robot.mqtt | ${time} |
28 | 27 | | | ${topic} | Set Variable | test/mqtt_test_sub |
|
39 | 38 | | | Subscribe to MQTT Broker and Validate | client.id=${client} | topic=${topic} | message=${message} |
40 | 39 |
|
41 | 40 | | Publish an empty message with QOS 1 and validate |
42 | | -| | Sleep | 1s |
43 | 41 | | | ${time} | Get Time | epoch |
44 | 42 | | | ${client} | Catenate | SEPARATOR=. | robot.mqtt | ${time} |
45 | 43 | | | ${topic} | Set Variable | test/mqtt_test_sub |
|
49 | 47 | | | Subscribe to MQTT Broker and Validate | client.id=${client} | topic=${topic} |
50 | 48 |
|
51 | 49 | | Publish and validate with regular expression |
52 | | -| | Sleep | 1s |
53 | 50 | | | ${time} | Get Time | epoch |
54 | 51 | | | ${client} | Catenate | SEPARATOR=. | robot.mqtt | ${time} |
55 | 52 | | | ${topic} | Set Variable | test/mqtt_test_sub |
|
61 | 58 | | | Subscribe to MQTT Broker and Validate | client.id=${client} | topic=${topic} | message=${regex} |
62 | 59 |
|
63 | 60 | | Subscribe for the first time and validate that no messages are received |
64 | | -| | Sleep | 1s |
65 | 61 | | | ${time} | Get Time | epoch |
66 | 62 | | | ${client} | Catenate | SEPARATOR=. | robot.mqtt | ${time} |
67 | 63 | | | ${topic} | Set Variable | test/mqtt_test_sub |
|
70 | 66 | | | Length Should Be | ${messages} | 0 |
71 | 67 |
|
72 | 68 | | Subscribe, publish 1 message and validate it is received |
73 | | -| | Sleep | 1s |
74 | 69 | | | ${time} | Get Time | epoch |
75 | 70 | | | ${client} | Catenate | SEPARATOR=. | robot.mqtt | ${time} |
76 | 71 | | | ${topic} | Set Variable | test/mqtt_test_sub |
|
82 | 77 | | | Should Be Equal As Strings | ${messages}[0] | test message |
83 | 78 |
|
84 | 79 | | Subscribe with no limit, publish multiple messages and validate they are received |
85 | | -| | Sleep | 1s |
86 | 80 | | | ${time} | Get Time | epoch |
87 | 81 | | | ${client} | Catenate | SEPARATOR=. | robot.mqtt | ${time} |
88 | 82 | | | ${topic} | Set Variable | test/mqtt_test_sub |
|
98 | 92 | | | Should Be Equal As Strings | ${messages}[2] | test message3 |
99 | 93 |
|
100 | 94 | | Subscribe with limit |
101 | | -| | Sleep | 1s |
102 | 95 | | | ${time} | Get Time | epoch |
103 | 96 | | | ${client} | Catenate | SEPARATOR=. | robot.mqtt | ${time} |
104 | 97 | | | ${topic} | Set Variable | test/mqtt_test_sub |
|
117 | 110 | | | Should Be Equal As Strings | ${messages}[1] | test message3 |
118 | 111 |
|
119 | 112 | | Unsubscribe and validate no messages are received |
120 | | -| | Sleep | 1s |
121 | 113 | | | ${time} | Get Time | epoch |
122 | 114 | | | ${client} | Catenate | SEPARATOR=. | robot.mqtt | ${time} |
123 | 115 | | | ${topic} | Set Variable | test/mqtt_test_sub |
|
137 | 129 | | | ${message} | Set Variable | subscription test message |
138 | 130 | | | Set username and password | authuser1 | password1 |
139 | 131 | | | Run Keyword And Expect Error | The expected payload didn't arrive in the topic |
140 | | -| | ... | Subscribe to MQTT Broker and Validate | broker.uri=127.0.0.1 | client.id=${client} |
| 132 | +| | ... | Subscribe to MQTT Broker and Validate | broker.uri=127.0.0.1 | port=11883 | client.id=${client} |
141 | 133 | | | ... | topic=${topic} | message=${message} |
142 | | -| | Connect | 127.0.0.1 |
| 134 | +| | Connect | 127.0.0.1 | 11883 |
143 | 135 | | | Publish | ${topic} | test message with username and password | qos=1 |
144 | 136 | | | Subscribe to MQTT Broker and Validate |
145 | | -| | ... | broker.uri=127.0.0.1 | client.id=${client} | topic=${topic} | message=test message with username and password |
| 137 | +| | ... | broker.uri=127.0.0.1 | port=11883 | client.id=${client} | topic=${topic} | message=test message with username and password |
146 | 138 | | | [Teardown] | Disconnect |
147 | 139 |
|
148 | 140 | | Publish to a broker that requires authentication with invalid password |
|
152 | 144 | | | ${topic} | Set Variable | test |
153 | 145 | | | Set username and password | authuser1 | invalidpwd |
154 | 146 | | | Run Keyword and expect error | The client disconnected unexpectedly |
155 | | -| | ... | Connect | 127.0.0.1 | 1883 | ${client} |
| 147 | +| | ... | Connect | 127.0.0.1 | 11883 | ${client} |
156 | 148 | | | [Teardown] | Disconnect |
157 | 149 |
|
158 | 150 | | Subscribe async, publish 1 message, listen for and validate it is received |
159 | | -| | Sleep | 1s |
160 | 151 | | | ${time} | Get Time | epoch |
161 | 152 | | | ${client} | Catenate | SEPARATOR=. | robot.mqtt | ${time} |
162 | 153 | | | ${topic} | Set Variable | test/mqtt_test_sub |
163 | 154 | | | Subscribe Async | client.id=${client} | topic=${topic} |
164 | 155 | | | Publish to MQTT Broker | topic=${topic} | message=test message | qos=1 |
165 | | -| | Sleep | 5s |
166 | 156 | | | @{messages} | Listen and Get Messages | topic=${topic} |
167 | 157 | | | LOG | ${messages} |
168 | 158 | | | Length Should Be | ${messages} | 1 |
169 | 159 | | | Should Be Equal As Strings | ${messages}[0] | test message |
170 | 160 | | | [Teardown] | Unsubscribe and Disconnect | ${topic} |
171 | 161 |
|
172 | 162 | | Subscribe async, publish several messages, listen for and validate they are received |
173 | | -| | Sleep | 1s |
174 | 163 | | | ${time} | Get Time | epoch |
175 | 164 | | | ${client} | Catenate | SEPARATOR=. | robot.mqtt | ${time} |
176 | 165 | | | ${topic} | Set Variable | test/mqtt_test_sub |
177 | 166 | | | Subscribe Async | client.id=${client} | topic=${topic} |
178 | 167 | | | Publish to MQTT Broker | topic=${topic} | message=test message1 | qos=1 |
179 | | -| | Sleep | 1s |
180 | 168 | | | Publish to MQTT Broker | topic=${topic} | message=test message2 | qos=1 |
181 | | -| | Sleep | 1s |
182 | 169 | | | Publish to MQTT Broker | topic=${topic} | message=test message3 | qos=1 |
183 | | -| | Sleep | 5s |
184 | 170 | | | @{messages} | Listen and Get Messages | topic=${topic} | limit=0 |
185 | 171 | | | LOG | ${messages} |
186 | 172 | | | Length Should Be | ${messages} | 3 |
|
190 | 176 | | | [Teardown] | Unsubscribe and Disconnect | ${topic} |
191 | 177 |
|
192 | 178 | | Subscribe async to multiple topics, publish several messages, listen for them and validate they are received |
193 | | -| | Sleep | 1s |
194 | 179 | | | ${time} | Get Time | epoch |
195 | 180 | | | ${client1} | Catenate | SEPARATOR=. | robot.mqtt | ${time} |
196 | 181 | | | ${client2} | Catenate | SEPARATOR=. | robot.mqtt | ${time+1} |
|
199 | 184 | | | Subscribe Async | client.id=${client1} | topic=${topic1} |
200 | 185 | | | Subscribe Async | client.id=${client2} | topic=${topic2} |
201 | 186 | | | Publish to MQTT Broker | topic=${topic2} | message=test message1 | qos=1 |
202 | | -| | Sleep | 1s |
203 | 187 | | | Publish to MQTT Broker | topic=${topic1} | message=test message2 | qos=1 |
204 | | -| | Sleep | 1s |
205 | 188 | | | Publish to MQTT Broker | topic=${topic2} | message=test message3 | qos=1 |
206 | | -| | Sleep | 5s |
207 | 189 | | | @{messages1} | Listen and Get Messages | topic=${topic1} | limit=0 |
208 | 190 | | | @{messages2} | Listen and Get Messages | topic=${topic2} | limit=0 |
209 | 191 | | | LOG | ${messages1} |
|
0 commit comments