diff options
author | Didier Wenzek <didier.wenzek@acidalie.com> | 2021-11-10 13:12:38 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-10 13:12:38 +0000 |
commit | a5659a86d004b43de5961e0917595f257bf36574 (patch) | |
tree | 821e0a5af44af2a71779b830715084dce8439b88 /tedge | |
parent | 1779ee14c41ac21ad0754153cae6a69923eebcf6 (diff) |
[CIT 515] Fix the tests of the MQTT component. (#561)
* Add a test helper to except a message on MQTT
* Fix doc string
Signed-off-by: Wenzek <diw@softwareag.com>
* Move the test_mqtt_server in a dev-dependency
* The tests of the agent are not dependent of MQTT
* Working around sub ack
* Refactor the test message logger
* Add test helper functions
* Make test clearer
* Use test helper functions to simplify the tests
* Rename module
* Launch the test MQTT broker just once
* Encapsulate the port of the MQTT test broker
* Display the first 30 bytes of the messages recieved by the test MQTT broker
* Make serial the agent tests
* Upgrade to rumqtt latest
* Fix mqtt test broker log
* Reproduce the issue with lost messages when the sm_mapper is down
* Cargo fmt
* Addressing comments
* Update test
* Remove test_serial attribute
* Ignore test `tedge_agent_check_no_multiple_instances_running`
* Run commit-workflow tests with no-fail-fast
* ignore test requesting sudo
* Make helper functions method of the test broker handler
* Cargo fmt
* Wait for the mapper under test to start
Co-authored-by: Wenzek <diw@softwareag.com>
Diffstat (limited to 'tedge')
-rw-r--r-- | tedge/Cargo.toml | 2 | ||||
-rw-r--r-- | tedge/src/cli/connect/command.rs | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/tedge/Cargo.toml b/tedge/Cargo.toml index 11598278..99e57d7b 100644 --- a/tedge/Cargo.toml +++ b/tedge/Cargo.toml @@ -19,7 +19,7 @@ futures = "0.3" hyper = { version = "0.14", default-features = false } reqwest = { version = "0.11", default-features = false, features = ["blocking", "json", "rustls-tls", "stream"] } rpassword = "5.0" -rumqttc = "0.8" +rumqttc = "0.10" rustls = "0.19" serde = { version = "1.0", features = ["derive"] } structopt = "0.3" diff --git a/tedge/src/cli/connect/command.rs b/tedge/src/cli/connect/command.rs index e68b2e54..6db7edd2 100644 --- a/tedge/src/cli/connect/command.rs +++ b/tedge/src/cli/connect/command.rs @@ -269,7 +269,7 @@ fn create_device(port: u16, device_id: &str) -> Result<DeviceStatus, ConnectErro let registration_payload = format!("100,{},{}", device_id, DEVICE_TYPE); let mut options = MqttOptions::new(CLIENT_ID, DEFAULT_HOST, port); - options.set_keep_alive(RESPONSE_TIMEOUT.as_secs() as u16); + options.set_keep_alive(RESPONSE_TIMEOUT); let (mut client, mut connection) = rumqttc::Client::new(options, 10); let mut acknowledged = false; @@ -338,7 +338,7 @@ fn check_device_status_azure(port: u16) -> Result<DeviceStatus, ConnectError> { const REGISTRATION_OK: &str = "200"; let mut options = MqttOptions::new(CLIENT_ID, DEFAULT_HOST, port); - options.set_keep_alive(RESPONSE_TIMEOUT.as_secs() as u16); + options.set_keep_alive(RESPONSE_TIMEOUT); let (mut client, mut connection) = rumqttc::Client::new(options, 10); let mut acknowledged = false; |