mirror of
https://mirror.suhoan.cn/https://github.com/EasyTier/EasyTier.git
synced 2025-12-14 13:47:24 +08:00
fix tests (#588)
fix proxy_three_node_disconnect_test and hole_punching_symmetric_only_random
This commit is contained in:
@@ -167,7 +167,7 @@ async fn wait_proxy_route_appear(
|
||||
}
|
||||
|
||||
fn set_link_status(net_ns: &str, up: bool) {
|
||||
let _ = std::process::Command::new("ip")
|
||||
let ret = std::process::Command::new("ip")
|
||||
.args([
|
||||
"netns",
|
||||
"exec",
|
||||
@@ -180,4 +180,5 @@ fn set_link_status(net_ns: &str, up: bool) {
|
||||
])
|
||||
.output()
|
||||
.unwrap();
|
||||
tracing::info!("set link status: {:?}, net_ns: {}, up: {}", ret, net_ns, up);
|
||||
}
|
||||
|
||||
@@ -490,6 +490,11 @@ pub async fn proxy_three_node_disconnect_test(#[values("tcp", "wg")] proto: &str
|
||||
}
|
||||
inst4.run().await.unwrap();
|
||||
|
||||
tracing::info!("inst1 peer id: {:?}", insts[0].peer_id());
|
||||
tracing::info!("inst2 peer id: {:?}", insts[1].peer_id());
|
||||
tracing::info!("inst3 peer id: {:?}", insts[2].peer_id());
|
||||
tracing::info!("inst4 peer id: {:?}", inst4.peer_id());
|
||||
|
||||
let task = tokio::spawn(async move {
|
||||
for _ in 1..=2 {
|
||||
tokio::time::sleep(tokio::time::Duration::from_secs(8)).await;
|
||||
@@ -521,7 +526,10 @@ pub async fn proxy_three_node_disconnect_test(#[values("tcp", "wg")] proto: &str
|
||||
.find(|r| r.peer_id == inst4.peer_id())
|
||||
.is_none()
|
||||
},
|
||||
Duration::from_secs(15),
|
||||
// 0 down
|
||||
// [1, 6) send ping
|
||||
// [3, 8) ping fail and close connection
|
||||
Duration::from_millis(8300),
|
||||
)
|
||||
.await;
|
||||
set_link_status("net_d", true);
|
||||
|
||||
Reference in New Issue
Block a user