diff options
-rw-r--r-- | tests/all/main.rs | 9 | ||||
-rw-r--r-- | tests/all/session.rs | 7 |
2 files changed, 13 insertions, 3 deletions
diff --git a/tests/all/main.rs b/tests/all/main.rs index a021b4c..f74684a 100644 --- a/tests/all/main.rs +++ b/tests/all/main.rs @@ -12,11 +12,16 @@ mod knownhosts; mod session; mod sftp; -pub fn socket() -> TcpStream { +pub fn test_addr() -> String { let port = env::var("RUST_SSH2_FIXTURE_PORT") .map(|s| s.parse().unwrap()) .unwrap_or(22); - TcpStream::connect(&format!("127.0.0.1:{}", port)).unwrap() + let addr = format!("127.0.0.1:{}", port); + addr +} + +pub fn socket() -> TcpStream { + TcpStream::connect(&test_addr()).unwrap() } pub fn authed_session() -> ssh2::Session { diff --git a/tests/all/session.rs b/tests/all/session.rs index cf64f1d..93b0a2e 100644 --- a/tests/all/session.rs +++ b/tests/all/session.rs @@ -57,7 +57,12 @@ fn keyboard_interactive() { sess.handshake().unwrap(); sess.host_key().unwrap(); let methods = sess.auth_methods(&user).unwrap(); - assert!(methods.contains("keyboard-interactive"), "{}", methods); + assert!( + methods.contains("keyboard-interactive"), + "test server ({}) must support `ChallengeResponseAuthentication yes`, not just {}", + ::test_addr(), + methods + ); assert!(!sess.authenticated()); // We don't know the correct response for whatever challenges |