diff --git a/itests/src/test/java/org/apache/karaf/itests/SshCommandTestBase.java b/itests/src/test/java/org/apache/karaf/itests/SshCommandTestBase.java index adc1cc0..b33f294 100644 --- a/itests/src/test/java/org/apache/karaf/itests/SshCommandTestBase.java +++ b/itests/src/test/java/org/apache/karaf/itests/SshCommandTestBase.java @@ -21,14 +21,13 @@ import java.util.Arrays; import java.util.HashSet; -import junit.framework.Assert; - import org.apache.karaf.features.Feature; import org.apache.sshd.ClientChannel; import org.apache.sshd.ClientSession; import org.apache.sshd.SshClient; import org.apache.sshd.client.future.ConnectFuture; import org.junit.After; +import org.junit.Assert; import org.junit.Before; import org.junit.runner.RunWith; import org.ops4j.pax.exam.junit.PaxExam; @@ -117,12 +116,13 @@ private OutputStream openSshChannel(String username, String password, OutputStream ... outputs) throws Exception { client = SshClient.setUpDefaultClient(); client.start(); - ConnectFuture future = client.connect("localhost", 8101).await(); + ConnectFuture future = client.connect(username, "localhost", 8101).await(); session = future.getSession(); int ret = ClientSession.WAIT_AUTH; while ((ret & ClientSession.WAIT_AUTH) != 0) { - session.authPassword(username, password); + session.addPasswordIdentity(password); + session.auth().verify(); ret = session.waitFor(ClientSession.WAIT_AUTH | ClientSession.CLOSED | ClientSession.AUTHED, 0); } if ((ret & ClientSession.CLOSED) != 0) {