File tree Expand file tree Collapse file tree 2 files changed +16
-6
lines changed Expand file tree Collapse file tree 2 files changed +16
-6
lines changed Original file line number Diff line number Diff line change 14
14
- ' run_ci_tests.sh'
15
15
- ' start_sshd.sh'
16
16
- ' stop_sshd.sh'
17
- name : cargo check
17
+ name : os check
18
18
jobs :
19
19
os-check :
20
20
runs-on : ${{ matrix.os }}
29
29
profile : minimal
30
30
toolchain : stable
31
31
- uses : actions/checkout@v2
32
- - name : cargo check
32
+ - name : Create Cargo.lock
33
33
uses : actions-rs/cargo@v1
34
34
with :
35
- command : check
35
+ command : update
36
+ - name : cargo test
37
+ uses : actions-rs/cargo@v1
38
+ with :
39
+ command : test
36
40
args : --all-features --all-targets
Original file line number Diff line number Diff line change @@ -76,8 +76,10 @@ async fn connects() -> Vec<Session> {
76
76
}
77
77
78
78
async fn connects_err ( host : & str ) -> Vec < Error > {
79
- let mut builder = SessionBuilder :: default ( ) ;
79
+ session_builder_connects_err ( host, SessionBuilder :: default ( ) ) . await
80
+ }
80
81
82
+ async fn session_builder_connects_err ( host : & str , mut builder : SessionBuilder ) -> Vec < Error > {
81
83
builder
82
84
. user_known_hosts_file ( get_known_hosts_path ( ) )
83
85
. known_hosts_check ( KnownHosts :: Accept ) ;
@@ -669,11 +671,15 @@ async fn cannot_resolve() {
669
671
670
672
#[ tokio:: test]
671
673
async fn no_route ( ) {
672
- for err in connects_err ( "255.255.255.255" ) . await {
674
+ let mut builder = SessionBuilder :: default ( ) ;
675
+
676
+ builder. connect_timeout ( Duration :: from_secs ( 1 ) ) ;
677
+
678
+ for err in session_builder_connects_err ( "192.0.2.1" , builder) . await {
673
679
match err {
674
680
Error :: Connect ( e) => {
675
681
eprintln ! ( "{:?}" , e) ;
676
- assert_eq ! ( e. kind( ) , io:: ErrorKind :: Other ) ;
682
+ assert_eq ! ( e. kind( ) , io:: ErrorKind :: TimedOut ) ;
677
683
}
678
684
e => unreachable ! ( "{:?}" , e) ,
679
685
}
You can’t perform that action at this time.
0 commit comments