X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fnetconf%2Fnetconf-ssh%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnetconf%2FSSHServerTest.java;h=663a0b4a82c6ac3d480b7d1d498aa0339344d220;hp=62396ed87ac1f4db3dcaa7942f676012ab35ade8;hb=c0e4638d5f1f29249b3fe74b64e7d85dd388c489;hpb=d2aed692dab458282c37d42b13a16cff743d598e diff --git a/opendaylight/netconf/netconf-ssh/src/test/java/org/opendaylight/controller/netconf/SSHServerTest.java b/opendaylight/netconf/netconf-ssh/src/test/java/org/opendaylight/controller/netconf/SSHServerTest.java index 62396ed87a..663a0b4a82 100644 --- a/opendaylight/netconf/netconf-ssh/src/test/java/org/opendaylight/controller/netconf/SSHServerTest.java +++ b/opendaylight/netconf/netconf-ssh/src/test/java/org/opendaylight/controller/netconf/SSHServerTest.java @@ -8,14 +8,17 @@ package org.opendaylight.controller.netconf; import ch.ethz.ssh2.Connection; -import java.net.InetSocketAddress; import junit.framework.Assert; +import org.apache.commons.io.IOUtils; import org.junit.Test; import org.opendaylight.controller.netconf.ssh.NetconfSSHServer; import org.opendaylight.controller.netconf.ssh.authentication.AuthProvider; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.InputStream; +import java.net.InetSocketAddress; + public class SSHServerTest { @@ -33,7 +36,11 @@ public class SSHServerTest { public void startSSHServer() throws Exception{ logger.info("Creating SSH server"); StubUserManager um = new StubUserManager(USER,PASSWORD); - AuthProvider ap = new AuthProvider(um); + String pem; + try(InputStream is = getClass().getResourceAsStream("/RSA.pk")) { + pem = IOUtils.toString(is); + } + AuthProvider ap = new AuthProvider(um, pem); NetconfSSHServer server = NetconfSSHServer.start(PORT,tcpAddress,ap); sshServerThread = new Thread(server); sshServerThread.setDaemon(true);