From 59621387db502ef412645892d35b288ce14543f7 Mon Sep 17 00:00:00 2001 From: yellowhatter Date: Thu, 26 Sep 2024 15:09:05 +0300 Subject: [PATCH 1/2] do not use Linux Ephemeral ports in tests --- zenoh/tests/interceptors.rs | 4 ++-- zenoh/tests/unicity.rs | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/zenoh/tests/interceptors.rs b/zenoh/tests/interceptors.rs index 76c0ccff41..25dac7ddb5 100644 --- a/zenoh/tests/interceptors.rs +++ b/zenoh/tests/interceptors.rs @@ -145,7 +145,7 @@ fn downsampling_test( fn downsampling_by_keyexpr_impl(flow: InterceptorFlow) { let ke_prefix = "test/downsamples_by_keyexp"; - let locator = "tcp/127.0.0.1:38446"; + let locator = "tcp/127.0.0.1:31446"; let ke_10hz: KeyExpr = format!("{ke_prefix}/10hz").try_into().unwrap(); let ke_20hz: KeyExpr = format!("{ke_prefix}/20hz").try_into().unwrap(); @@ -198,7 +198,7 @@ fn downsampling_by_keyexpr() { #[cfg(unix)] fn downsampling_by_interface_impl(flow: InterceptorFlow) { let ke_prefix = "test/downsamples_by_interface"; - let locator = "tcp/127.0.0.1:38447"; + let locator = "tcp/127.0.0.1:31447"; let ke_10hz: KeyExpr = format!("{ke_prefix}/10hz").try_into().unwrap(); let ke_no_effect: KeyExpr = format!("{ke_prefix}/no_effect").try_into().unwrap(); diff --git a/zenoh/tests/unicity.rs b/zenoh/tests/unicity.rs index d6a8c8f621..eefead014e 100644 --- a/zenoh/tests/unicity.rs +++ b/zenoh/tests/unicity.rs @@ -82,7 +82,7 @@ async fn open_router_session() -> Session { config .listen .endpoints - .set(vec!["tcp/127.0.0.1:37447".parse().unwrap()]) + .set(vec!["tcp/127.0.0.1:30447".parse().unwrap()]) .unwrap(); config.scouting.multicast.set_enabled(Some(false)).unwrap(); println!("[ ][00a] Opening router session"); @@ -100,7 +100,7 @@ async fn open_client_sessions() -> (Session, Session, Session) { config.set_mode(Some(WhatAmI::Client)).unwrap(); config .connect - .set_endpoints(ModeDependentValue::Unique(vec!["tcp/127.0.0.1:37447" + .set_endpoints(ModeDependentValue::Unique(vec!["tcp/127.0.0.1:30447" .parse::() .unwrap()])) .unwrap(); @@ -111,7 +111,7 @@ async fn open_client_sessions() -> (Session, Session, Session) { config.set_mode(Some(WhatAmI::Client)).unwrap(); config .connect - .set_endpoints(ModeDependentValue::Unique(vec!["tcp/127.0.0.1:37447" + .set_endpoints(ModeDependentValue::Unique(vec!["tcp/127.0.0.1:30447" .parse::() .unwrap()])) .unwrap(); @@ -122,7 +122,7 @@ async fn open_client_sessions() -> (Session, Session, Session) { config.set_mode(Some(WhatAmI::Client)).unwrap(); config .connect - .set_endpoints(ModeDependentValue::Unique(vec!["tcp/127.0.0.1:37447" + .set_endpoints(ModeDependentValue::Unique(vec!["tcp/127.0.0.1:30447" .parse::() .unwrap()])) .unwrap(); From 4f835a087283a582304206fd182dbc2b88191de9 Mon Sep 17 00:00:00 2001 From: yellowhatter Date: Thu, 26 Sep 2024 16:39:44 +0300 Subject: [PATCH 2/2] remove more ephemeral ports --- zenoh/tests/authentication.rs | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/zenoh/tests/authentication.rs b/zenoh/tests/authentication.rs index a49261c9d1..3d6579d6a4 100644 --- a/zenoh/tests/authentication.rs +++ b/zenoh/tests/authentication.rs @@ -41,10 +41,10 @@ mod test { create_new_files(TESTFILES_PATH.to_path_buf()) .await .unwrap(); - test_pub_sub_deny_then_allow_usrpswd(37447).await; - test_pub_sub_allow_then_deny_usrpswd(37447).await; - test_get_qbl_allow_then_deny_usrpswd(37447).await; - test_get_qbl_deny_then_allow_usrpswd(37447).await; + test_pub_sub_deny_then_allow_usrpswd(29447).await; + test_pub_sub_allow_then_deny_usrpswd(29447).await; + test_get_qbl_allow_then_deny_usrpswd(29447).await; + test_get_qbl_deny_then_allow_usrpswd(29447).await; } #[tokio::test(flavor = "multi_thread", worker_threads = 4)] @@ -53,10 +53,10 @@ mod test { create_new_files(TESTFILES_PATH.to_path_buf()) .await .unwrap(); - test_pub_sub_deny_then_allow_tls(37448, false).await; - test_pub_sub_allow_then_deny_tls(37449).await; - test_get_qbl_allow_then_deny_tls(37450).await; - test_get_qbl_deny_then_allow_tls(37451).await; + test_pub_sub_deny_then_allow_tls(29448, false).await; + test_pub_sub_allow_then_deny_tls(29449).await; + test_get_qbl_allow_then_deny_tls(29450).await; + test_get_qbl_deny_then_allow_tls(29451).await; } #[tokio::test(flavor = "multi_thread", worker_threads = 4)] @@ -65,10 +65,10 @@ mod test { create_new_files(TESTFILES_PATH.to_path_buf()) .await .unwrap(); - test_pub_sub_deny_then_allow_quic(37452).await; - test_pub_sub_allow_then_deny_quic(37453).await; - test_get_qbl_deny_then_allow_quic(37454).await; - test_get_qbl_allow_then_deny_quic(37455).await; + test_pub_sub_deny_then_allow_quic(29452).await; + test_pub_sub_allow_then_deny_quic(29453).await; + test_get_qbl_deny_then_allow_quic(29454).await; + test_get_qbl_allow_then_deny_quic(29455).await; } #[tokio::test(flavor = "multi_thread", worker_threads = 4)] @@ -78,7 +78,7 @@ mod test { create_new_files(TESTFILES_PATH.to_path_buf()) .await .unwrap(); - test_pub_sub_deny_then_allow_tls(37456, true).await; + test_pub_sub_deny_then_allow_tls(29456, true).await; } #[tokio::test(flavor = "multi_thread", worker_threads = 4)] @@ -87,8 +87,8 @@ mod test { create_new_files(TESTFILES_PATH.to_path_buf()) .await .unwrap(); - test_deny_allow_combination(37457).await; - test_allow_deny_combination(37458).await; + test_deny_allow_combination(29457).await; + test_allow_deny_combination(29458).await; } #[allow(clippy::all)]