X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fnetconf%2Fnetconf-it%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnetconf%2Fit%2FNetconfITSecureTest.java;h=fdc9a020065be13d5de4268abcfe65c35117a206;hb=ee0877c07ff700157dd9fc2e445df095c88f79bc;hp=6e265a44a50a55f18a3555c73ddd4afed91f13b5;hpb=edf5bfcee83c750853253ccfd991ba7000f5f65b;p=controller.git diff --git a/opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/NetconfITSecureTest.java b/opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/NetconfITSecureTest.java index 6e265a44a5..fdc9a02006 100644 --- a/opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/NetconfITSecureTest.java +++ b/opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/NetconfITSecureTest.java @@ -25,6 +25,7 @@ import io.netty.channel.EventLoopGroup; import io.netty.channel.local.LocalAddress; import io.netty.channel.nio.NioEventLoopGroup; import io.netty.util.concurrent.GlobalEventExecutor; +import java.io.File; import java.io.IOException; import java.net.InetSocketAddress; import java.nio.file.Files; @@ -77,6 +78,7 @@ public class NetconfITSecureTest extends AbstractNetconfConfigTest { public static final String USERNAME = "user"; public static final String PASSWORD = "pwd"; + private File sshKeyPair; private SshProxyServer sshProxyServer; private ExecutorService nioExec; @@ -85,6 +87,8 @@ public class NetconfITSecureTest extends AbstractNetconfConfigTest { @Before public void setUp() throws Exception { + sshKeyPair = Files.createTempFile("sshKeyPair", ".pem").toFile(); + sshKeyPair.deleteOnExit(); nioExec = Executors.newFixedThreadPool(1); clientGroup = new NioEventLoopGroup(); minaTimerEx = Executors.newScheduledThreadPool(1); @@ -99,7 +103,7 @@ public class NetconfITSecureTest extends AbstractNetconfConfigTest { return true; } }) - .setKeyPairProvider(new PEMGeneratorHostKeyProvider(Files.createTempFile("prefix", "suffix").toAbsolutePath().toString())) + .setKeyPairProvider(new PEMGeneratorHostKeyProvider(sshKeyPair.toPath().toAbsolutePath().toString())) .setIdleTimeout(Integer.MAX_VALUE) .createSshProxyServerConfiguration()); }