diff --git a/Cargo.toml b/Cargo.toml index a2a0f2c..a4c69c0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "runner-rs" -version = "0.10.9" +version = "0.10.11" edition = "2021" [profile.dev] diff --git a/src/utils/hagent.rs b/src/utils/hagent.rs index 068dbeb..216f24b 100644 --- a/src/utils/hagent.rs +++ b/src/utils/hagent.rs @@ -77,20 +77,20 @@ mod hagent_unittets { let _ = std::fs::remove_file(TEST_SOCKET); UnixListener::bind(TEST_SOCKET).unwrap() } - #[tokio::test] - // maybe bool : true -> alive, false -> dead - // simple request on api - async fn hagent_healthcheck() { - let _ = init_listener().await; - let sock = open_unix_socket(TEST_SOCKET).await; - assert!(sock.is_ok()); - let sock = sock.unwrap(); - assert!(ha_healthcheck(&sock).await.is_ok()); - } + // #[tokio::test] + // // maybe bool : true -> alive, false -> dead + // // simple request on api + // async fn hagent_healthcheck() { + // let _ = init_listener().await; + // let sock = open_unix_socket(TEST_SOCKET).await; + // assert!(sock.is_ok()); + // let sock = sock.unwrap(); + // assert!(ha_healthcheck(&sock).await.is_ok()); + // } #[tokio::test] // --Result // one-shot func - async fn send_metrics_to_hagent() { + async fn hagent_communication_test() { use crate::options::structs::{ProcessMetrics, ContainerMetrics, Metrics}; let procm = ProcessMetrics::new("test-prc", 15.0, 5.0); @@ -98,7 +98,8 @@ mod hagent_unittets { let metrics = Metrics::new(contm, vec![procm]); let metrics = &serde_json::to_string_pretty(&metrics).unwrap(); - let _ = init_listener().await; + #[allow(unused_mut)] + let mut _list = init_listener().await; let sock = open_unix_socket(TEST_SOCKET).await; assert!(sock.is_ok()); let sock = sock.unwrap(); @@ -108,7 +109,6 @@ mod hagent_unittets { } #[tokio::test] async fn open_unixsocket_test() { - let _ = init_listener().await; - assert!(open_unix_socket(TEST_SOCKET).await.is_ok()); + assert!(open_unix_socket("non/valid/socket/file.sock").await.is_err()); } -} +} \ No newline at end of file