diff options
author | Alex Crichton <alex@alexcrichton.com> | 2018-07-13 13:31:08 -0700 |
---|---|---|
committer | Alex Crichton <alex@alexcrichton.com> | 2018-07-13 13:31:08 -0700 |
commit | a3167de350ebb489a21c9b09e76de4ed74fee8bc (patch) | |
tree | 64b500fa413ecd83ad4e9e2d51a4175d2647b377 /tests/all.rs | |
parent | 16bfe7fbab0d9ee4ed421f7e302d9fc531efaf53 (diff) | |
download | ssh2-rs-a3167de350ebb489a21c9b09e76de4ed74fee8bc.zip |
Use modern Cargo conventions for tests
Diffstat (limited to 'tests/all.rs')
-rw-r--r-- | tests/all.rs | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/tests/all.rs b/tests/all.rs deleted file mode 100644 index 777c899..0000000 --- a/tests/all.rs +++ /dev/null @@ -1,35 +0,0 @@ -#![deny(warnings)] - -extern crate ssh2; -extern crate tempdir; - -use std::env; -use std::net::TcpStream; - -mod agent; -mod session; -mod channel; -mod knownhosts; -mod sftp; - -pub fn socket() -> TcpStream { - TcpStream::connect("127.0.0.1:22").unwrap() -} - -pub fn authed_session() -> (TcpStream, ssh2::Session) { - let user = env::var("USER").unwrap(); - let socket = socket(); - let mut sess = ssh2::Session::new().unwrap(); - sess.handshake(&socket).unwrap(); - assert!(!sess.authenticated()); - - { - let mut agent = sess.agent().unwrap(); - agent.connect().unwrap(); - agent.list_identities().unwrap(); - let identity = agent.identities().next().unwrap().unwrap(); - agent.userauth(&user, &identity).unwrap(); - } - assert!(sess.authenticated()); - (socket, sess) -} |