BUG-3335 Disable keepalives in netconf testtool 61/22061/2
authorMaros Marsalek <mmarsale@cisco.com>
Mon, 25 May 2015 10:37:34 +0000 (12:37 +0200)
committerGerrit Code Review <gerrit@opendaylight.org>
Mon, 8 Jun 2015 10:26:09 +0000 (10:26 +0000)
Change-Id: I607cd0b11555847a30ca57f339bb7d24fc79368e
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
(cherry picked from commit 1e15cd54715a29f17adb847664500a16470cd6a5)

opendaylight/netconf/netconf-connector-config/src/main/resources/initial/99-netconf-connector.xml
opendaylight/netconf/netconf-testtool/pom.xml
opendaylight/netconf/netconf-testtool/src/main/java/org/opendaylight/controller/netconf/test/tool/Main.java
opendaylight/netconf/netconf-testtool/src/main/resources/99-netconf-connector-simulated.xml [new file with mode: 0644]

index 28c61b9..75a591b 100644 (file)
@@ -20,7 +20,7 @@
           <username xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">admin</username>
           <password xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">admin</password>
           <tcp-only xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">false</tcp-only>
-          <reconnect-on-changed-schema>true</reconnect-on-changed-schema>
+          <reconnect-on-changed-schema xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">true</reconnect-on-changed-schema>
           <event-executor xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">
             <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty">prefix:netty-event-executor</type>
             <name>global-event-executor</name>
index 7c5f80d..bce0db0 100644 (file)
             <groupId>org.opendaylight.controller</groupId>
             <artifactId>config-netconf-connector</artifactId>
         </dependency>
-        <dependency>
-            <groupId>org.opendaylight.controller</groupId>
-            <artifactId>netconf-connector-config</artifactId>
-        </dependency>
         <dependency>
             <groupId>org.opendaylight.controller</groupId>
             <artifactId>sal-netconf-connector</artifactId>
index e4cc80f..e273254 100644 (file)
@@ -10,7 +10,6 @@ package org.opendaylight.controller.netconf.test.tool;
 
 import static com.google.common.base.Preconditions.checkArgument;
 import static com.google.common.base.Preconditions.checkNotNull;
-import static com.google.common.base.Preconditions.checkState;
 
 import ch.qos.logback.classic.Level;
 import com.google.common.base.Charsets;
@@ -215,11 +214,7 @@ public final class Main {
     }
 
     private static class ConfigGenerator {
-        public static final String NETCONF_CONNECTOR_XML = "/initial/99-netconf-connector.xml";
-        public static final String NETCONF_CONNECTOR_NAME = "controller-config";
-        public static final String NETCONF_CONNECTOR_PORT = "1830";
-        public static final String NETCONF_CONNECTOR_ADDRESS = "127.0.0.1";
-        public static final String NETCONF_USE_SSH = "false";
+        public static final String NETCONF_CONNECTOR_XML = "/99-netconf-connector-simulated.xml";
         public static final String SIM_DEVICE_SUFFIX = "-sim-device";
 
         private static final String SIM_DEVICE_CFG_PREFIX = "simulated-devices_";
@@ -261,15 +256,6 @@ public final class Main {
                 checkNotNull(stream, "Cannot load %s", NETCONF_CONNECTOR_XML);
                 String configBlueprint = CharStreams.toString(new InputStreamReader(stream, Charsets.UTF_8));
 
-                checkState(configBlueprint.contains(NETCONF_CONNECTOR_NAME));
-                checkState(configBlueprint.contains(NETCONF_CONNECTOR_PORT));
-                checkState(configBlueprint.contains(NETCONF_USE_SSH));
-                checkState(configBlueprint.contains(NETCONF_CONNECTOR_ADDRESS));
-                configBlueprint = configBlueprint.replace(NETCONF_CONNECTOR_NAME, "%s");
-                configBlueprint = configBlueprint.replace(NETCONF_CONNECTOR_ADDRESS, "%s");
-                configBlueprint = configBlueprint.replace(NETCONF_CONNECTOR_PORT, "%s");
-                configBlueprint = configBlueprint.replace(NETCONF_USE_SSH, "%s");
-
                 final String before = configBlueprint.substring(0, configBlueprint.indexOf("<module>"));
                 final String middleBlueprint = configBlueprint.substring(configBlueprint.indexOf("<module>"), configBlueprint.indexOf("</module>"));
                 final String after = configBlueprint.substring(configBlueprint.indexOf("</module>") + "</module>".length());
diff --git a/opendaylight/netconf/netconf-testtool/src/main/resources/99-netconf-connector-simulated.xml b/opendaylight/netconf/netconf-testtool/src/main/resources/99-netconf-connector-simulated.xml
new file mode 100644 (file)
index 0000000..3b016fc
--- /dev/null
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- vi: set et smarttab sw=4 tabstop=4: -->
+<!--
+ Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
+
+ This program and the accompanying materials are made available under the
+ terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ and is available at http://www.eclipse.org/legal/epl-v10.html
+-->
+<snapshot>
+  <configuration>
+    <data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+      <modules xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
+        <!-- Netconf connection to simulated netconf device -->
+        <module>
+          <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">prefix:sal-netconf-connector</type>
+          <name>%s</name>
+          <address xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">%s</address>
+          <port xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">%s</port>
+          <username xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">admin</username>
+          <password xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">admin</password>
+          <tcp-only xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">%s</tcp-only>
+          <reconnect-on-changed-schema xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">false</reconnect-on-changed-schema>
+          <keepalive-delay xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">-1</keepalive-delay>
+          <event-executor xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">
+            <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty">prefix:netty-event-executor</type>
+            <name>global-event-executor</name>
+          </event-executor>
+          <binding-registry xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">
+            <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">prefix:binding-broker-osgi-registry</type>
+            <name>binding-osgi-broker</name>
+          </binding-registry>
+          <dom-registry xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">
+            <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">prefix:dom-broker-osgi-registry</type>
+            <name>dom-broker</name>
+          </dom-registry>
+          <client-dispatcher xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">
+            <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:config:netconf">prefix:netconf-client-dispatcher</type>
+            <name>global-netconf-dispatcher</name>
+          </client-dispatcher>
+          <processing-executor xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">
+            <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:threadpool">prefix:threadpool</type>
+            <name>global-netconf-processing-executor</name>
+          </processing-executor>
+        </module>
+        </modules>
+    </data>
+  </configuration>
+  <required-capabilities>
+      <capability>urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf?module=odl-sal-netconf-connector-cfg&amp;revision=2013-10-28</capability>
+  </required-capabilities>
+</snapshot>

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.