diff options
author | Chris West (Faux) <git@goeswhere.com> | 2019-10-07 19:34:50 +0100 |
---|---|---|
committer | Wez Furlong <wez@wezfurlong.org> | 2019-10-08 20:03:34 -0700 |
commit | 172e8f1b38b08777367146019776a4997489888d (patch) | |
tree | 03184c71475e05917205bcbb2c69acae8aa0b0b0 | |
parent | e16e691881afd9acf9a924ec3d7f35e9cf9b0861 (diff) | |
download | ssh2-rs-172e8f1b38b08777367146019776a4997489888d.zip |
tests explain why they are failing
-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 |