Skip to content

Commit b8cadb0

Browse files
committed
Tweak
1 parent e63122f commit b8cadb0

File tree

2 files changed

+17
-8
lines changed

2 files changed

+17
-8
lines changed

async-ssh2-lite/tests/integration_tests/remote_port_forwarding.rs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#![cfg(feature = "tokio")]
22

3-
use std::{error, net::SocketAddr};
3+
use std::{env, error, net::SocketAddr};
44

55
use async_ssh2_lite::{util::ConnectInfo, AsyncSession};
66
use futures_util::future::join_all;
@@ -98,7 +98,12 @@ async fn simple_with_tokio() -> Result<(), Box<dyn error::Error>> {
9898
if is_internal_test_openssh_server() {
9999
500
100100
} else {
101-
4000
101+
env::var("REMOTE_PORT_FORWARDING_WAIT_SECS")
102+
.as_deref()
103+
.unwrap_or("4")
104+
.parse::<u64>()
105+
.unwrap_or(4)
106+
* 1000
102107
},
103108
))
104109
.await;
@@ -127,17 +132,17 @@ async fn simple_with_tokio() -> Result<(), Box<dyn error::Error>> {
127132
.await?;
128133
let mut s = String::new();
129134
channel.read_to_string(&mut s).await?;
130-
println!("exec curl output:{} i:{}", s, i);
135+
println!("remote_port_forwarding exec curl output:{} i:{}", s, i);
131136
assert_eq!(s, "200");
132137
channel.close().await?;
133-
println!("exec curl exit_status:{} i:{}", channel.exit_status()?, i);
138+
println!("remote_port_forwarding exec curl exit_status:{} i:{}", channel.exit_status()?, i);
134139
Result::<_, Box<dyn error::Error>>::Ok(())
135140
}
136141
})
137142
.collect::<Vec<_>>();
138143

139144
let rets = join_all(futures).await;
140-
println!("exec curl rets:{:?}", rets);
145+
println!("remote_port_forwarding exec curl rets:{:?}", rets);
141146
assert!(rets.iter().all(|x| x.is_ok()));
142147

143148
//

async-ssh2-lite/tests/integration_tests/session__channel_forward_listen.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,17 +154,21 @@ async fn __run__session__channel_forward_listen__with_tokio_spawn<
154154
.await?;
155155
let mut s = String::new();
156156
channel.read_to_string(&mut s).await?;
157-
println!("exec curl output:{} i:{}", s, i);
157+
println!("channel_forward_listen exec curl output:{} i:{}", s, i);
158158
assert_eq!(s, "200");
159159
channel.close().await?;
160-
println!("exec curl exit_status:{} i:{}", channel.exit_status()?, i);
160+
println!(
161+
"channel_forward_listen exec curl exit_status:{} i:{}",
162+
channel.exit_status()?,
163+
i
164+
);
161165
Result::<_, Box<dyn error::Error>>::Ok(())
162166
}
163167
})
164168
.collect::<Vec<_>>();
165169

166170
let rets = join_all(futures).await;
167-
println!("exec curl rets:{:?}", rets);
171+
println!("channel_forward_listen exec curl rets:{:?}", rets);
168172
assert!(rets.iter().all(|x| x.is_ok()));
169173

170174
//

0 commit comments

Comments
 (0)