@@ -34,6 +34,7 @@ mod consts {
3434
3535 pub const ERROR_EAGAIN : ErrorCode = ErrorCode :: Session ( -37 ) ;
3636 pub const ERROR_BAD_SOCKET : ErrorCode = ErrorCode :: Session ( -45 ) ;
37+ pub const ERROR_INVAL : ErrorCode = ErrorCode :: Session ( -34 ) ;
3738}
3839
3940/// Tests are adapted from the [`ssh2`] crate examples.
@@ -51,7 +52,7 @@ mod tests {
5152 type Result < T > = std:: result:: Result < T , Box < dyn std:: error:: Error > > ;
5253
5354 #[ tokio:: test]
54- async fn inspecting_ssh_agent ( ) -> Result < ( ) > {
55+ async fn inspect_agent ( ) -> Result < ( ) > {
5556 let _agent = testing:: agent ( ) . await ?;
5657
5758 testing:: with_server ( |server_addr| async move {
@@ -80,7 +81,7 @@ mod tests {
8081 }
8182
8283 #[ tokio:: test]
83- async fn authenticating_with_ssh_agent ( ) -> Result < ( ) > {
84+ async fn authenticate_agent ( ) -> Result < ( ) > {
8485 let _agent = testing:: agent ( ) . await ?;
8586
8687 testing:: with_server ( |server_addr| async move {
@@ -90,11 +91,7 @@ mod tests {
9091 sess. handshake ( ) . await ?;
9192
9293 // Try to authenticate with the first identity in the agent.
93- let mut agent = sess. agent ( ) ?;
94- agent. connect ( ) ?;
95- agent. list_identities ( ) ?;
96- let identity = agent. identities ( ) ?. remove ( 0 ) ;
97- agent. userauth ( "username" , & identity) . await ?;
94+ sess. userauth_agent ( "username" ) . await ?;
9895
9996 // Make sure we succeeded
10097 assert ! ( sess. authenticated( ) ) ;
@@ -105,7 +102,7 @@ mod tests {
105102 }
106103
107104 #[ tokio:: test]
108- async fn authenticate_with_password ( ) -> Result < ( ) > {
105+ async fn authenticate_password ( ) -> Result < ( ) > {
109106 testing:: with_server ( |server_addr| async move {
110107 // Connect to the SSH server
111108 let tcp = TcpStream :: connect ( server_addr) . await ?;
0 commit comments