Add AuthHandler to stresstool
[controller.git] / opendaylight / netconf / netconf-testtool / src / main / java / org / opendaylight / controller / netconf / test / tool / client / stress / StressClient.java
index 2916ec52f7bed25d4d0065579db166b73c94b4c8..e03de59f2c71ea6694683b17c70ad27aa6e42900 100644 (file)
@@ -16,6 +16,8 @@ import io.netty.channel.nio.NioEventLoopGroup;
 import io.netty.util.HashedWheelTimer;
 import io.netty.util.Timer;
 import java.io.IOException;
+import java.security.Provider;
+import java.security.Security;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.concurrent.ExecutionException;
@@ -26,8 +28,10 @@ import java.util.concurrent.TimeUnit;
 import java.util.concurrent.TimeoutException;
 import net.sourceforge.argparse4j.inf.ArgumentParser;
 import net.sourceforge.argparse4j.inf.ArgumentParserException;
+import org.bouncycastle.jce.provider.BouncyCastleProvider;
 import org.opendaylight.controller.netconf.api.NetconfMessage;
 import org.opendaylight.controller.netconf.client.NetconfClientDispatcherImpl;
+import org.opendaylight.controller.netconf.nettyutil.handler.ssh.client.AsyncSshHandler;
 import org.opendaylight.controller.netconf.util.xml.XmlUtil;
 import org.opendaylight.controller.sal.connect.api.RemoteDevice;
 import org.opendaylight.controller.sal.connect.netconf.listener.NetconfDeviceCommunicator;
@@ -85,6 +89,7 @@ public final class StressClient {
     private static long macStart = 0xAABBCCDD0000L;
 
     public static void main(final String[] args) {
+
         final Parameters params = parseArgs(args, Parameters.getParser());
         params.validate();
 
@@ -169,6 +174,10 @@ public final class StressClient {
         } catch (InterruptedException | ExecutionException | TimeoutException e) {
             LOG.warn("Unable to close executor properly", e);
         }
+        //stop the underlying ssh thread that gets spawned if we use ssh
+        if (params.ssh) {
+            AsyncSshHandler.DEFAULT_CLIENT.stop();
+        }
     }
 
     static NetconfMessage prepareMessage(final int id, final String editContentString) {