You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mina.apache.org by gn...@apache.org on 2015/06/03 20:17:45 UTC

mina-sshd git commit: [SSHD-473] Provide a unit test showing failed password authentication

Repository: mina-sshd
Updated Branches:
  refs/heads/master 4ea340e71 -> 7252546a1


[SSHD-473] Provide a unit test showing failed password authentication

Project: http://git-wip-us.apache.org/repos/asf/mina-sshd/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-sshd/commit/7252546a
Tree: http://git-wip-us.apache.org/repos/asf/mina-sshd/tree/7252546a
Diff: http://git-wip-us.apache.org/repos/asf/mina-sshd/diff/7252546a

Branch: refs/heads/master
Commit: 7252546a10ca4df93315bede6769dd0d87537efb
Parents: 4ea340e
Author: Guillaume Nodet <gn...@apache.org>
Authored: Wed Jun 3 20:17:28 2015 +0200
Committer: Guillaume Nodet <gn...@apache.org>
Committed: Wed Jun 3 20:17:36 2015 +0200

----------------------------------------------------------------------
 .../test/java/org/apache/sshd/AuthenticationTest.java   | 12 ++++++++++++
 1 file changed, 12 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/7252546a/sshd-core/src/test/java/org/apache/sshd/AuthenticationTest.java
----------------------------------------------------------------------
diff --git a/sshd-core/src/test/java/org/apache/sshd/AuthenticationTest.java b/sshd-core/src/test/java/org/apache/sshd/AuthenticationTest.java
index f8ae660..d07b1c9 100644
--- a/sshd-core/src/test/java/org/apache/sshd/AuthenticationTest.java
+++ b/sshd-core/src/test/java/org/apache/sshd/AuthenticationTest.java
@@ -80,6 +80,18 @@ public class AuthenticationTest extends BaseTestSupport {
     }
 
     @Test
+    public void testWrongPassword() throws Exception {
+        try(SshClient client = SshClient.setUpDefaultClient()) {
+            client.start();
+            try(ClientSession s = client.connect("user", "localhost", port).await().getSession()) {
+                s.addPasswordIdentity("bad password");
+                assertTrue(s.auth().await().isFailure());
+
+            }
+        }
+    }
+
+    @Test
     public void testChangeUser() throws Exception {
         try(SshClient client = SshClient.setUpDefaultClient()) {
             client.setServiceFactories(Arrays.asList(