Skip to content

Commit

Permalink
Merge pull request #1475 from ZettaScaleLabs/fix_ephemeral_ports_in_t…
Browse files Browse the repository at this point in the history
…ests

do not use Linux Ephemeral ports in tests
  • Loading branch information
yellowhatter authored Sep 26, 2024
2 parents e9ef030 + 4f835a0 commit a6c6994
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 21 deletions.
30 changes: 15 additions & 15 deletions zenoh/tests/authentication.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand All @@ -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)]
Expand All @@ -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)]
Expand All @@ -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)]
Expand All @@ -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)]
Expand Down
4 changes: 2 additions & 2 deletions zenoh/tests/interceptors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ fn downsampling_test<F>(

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();
Expand Down Expand Up @@ -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();
Expand Down
8 changes: 4 additions & 4 deletions zenoh/tests/unicity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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::<EndPoint>()
.unwrap()]))
.unwrap();
Expand All @@ -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::<EndPoint>()
.unwrap()]))
.unwrap();
Expand All @@ -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::<EndPoint>()
.unwrap()]))
.unwrap();
Expand Down

0 comments on commit a6c6994

Please sign in to comment.