HC Test: update ODL startup in hc2vpp jobs 42/8542/4
authorselias <samelias@cisco.com>
Fri, 11 Aug 2017 07:33:56 +0000 (09:33 +0200)
committerTibor Frank <tifrank@cisco.com>
Wed, 27 Sep 2017 12:26:34 +0000 (12:26 +0000)
- mountpoint configuration through controller-config is deprecated. Use the
new method through odl-netconf-topology feature.

Change-Id: I1297622db7ab6a3853b3c97ab7f59c31b4269b6d
Signed-off-by: selias <samelias@cisco.com>
resources/libraries/python/honeycomb/HoneycombSetup.py
resources/libraries/robot/honeycomb/honeycomb.robot
resources/templates/honeycomb/odl_client/mount_honeycomb.json [new file with mode: 0644]
resources/templates/honeycomb/odl_client/mount_honeycomb.xml [deleted file]
resources/templates/honeycomb/odl_client/odl_netconf_connector.url

index 55eb64e..aa6f26d 100644 (file)
@@ -13,6 +13,8 @@
 
 """Implementation of keywords for Honeycomb setup."""
 
 
 """Implementation of keywords for Honeycomb setup."""
 
+from json import loads
+
 from ipaddress import IPv6Address, AddressValueError
 
 from robot.api import logger
 from ipaddress import IPv6Address, AddressValueError
 
 from robot.api import logger
@@ -461,8 +463,9 @@ class HoneycombSetup(object):
         ssh = SSH()
         ssh.connect(node)
 
         ssh = SSH()
         ssh.connect(node)
 
-        cmd = "cp -r {src}/*karaf_{odl_name}* {dst}".format(
-            src=src_path, odl_name=odl_name, dst=dst_path)
+        cmd = "sudo rm -rf {dst}/*karaf_{odl_name} && " \
+              "cp -r {src}/*karaf_{odl_name}* {dst}".format(
+                  src=src_path, odl_name=odl_name, dst=dst_path)
 
         ret_code, _, _ = ssh.exec_command_sudo(cmd, timeout=120)
         if int(ret_code) != 0:
 
         ret_code, _, _ = ssh.exec_command_sudo(cmd, timeout=120)
         if int(ret_code) != 0:
@@ -512,11 +515,13 @@ class HoneycombSetup(object):
         ssh.connect(node)
 
         cmd = "{path}/*karaf*/bin/client -u karaf feature:install " \
         ssh.connect(node)
 
         cmd = "{path}/*karaf*/bin/client -u karaf feature:install " \
-              "odl-restconf-all odl-netconf-connector-all".format(path=path)
+              "odl-restconf-all " \
+              "odl-netconf-connector-all " \
+              "odl-netconf-topology".format(path=path)
         for feature in features:
             cmd += " {0}".format(feature)
 
         for feature in features:
             cmd += " {0}".format(feature)
 
-        ret_code, _, _ = ssh.exec_command_sudo(cmd, timeout=180)
+        ret_code, _, _ = ssh.exec_command_sudo(cmd, timeout=250)
 
         if int(ret_code) != 0:
             raise HoneycombError("Feature install did not succeed.")
 
         if int(ret_code) != 0:
             raise HoneycombError("Feature install did not succeed.")
@@ -598,14 +603,21 @@ class HoneycombSetup(object):
             "odl_client/odl_netconf_connector")
 
         url_file = "{0}/{1}".format(Const.RESOURCES_TPL_HC,
             "odl_client/odl_netconf_connector")
 
         url_file = "{0}/{1}".format(Const.RESOURCES_TPL_HC,
-                                    "odl_client/mount_honeycomb.xml")
+                                    "odl_client/mount_honeycomb.json")
 
         with open(url_file) as template:
             data = template.read()
 
 
         with open(url_file) as template:
             data = template.read()
 
+        data = loads(data)
+
         status_code, _ = HTTPRequest.post(
         status_code, _ = HTTPRequest.post(
-            node, path, headers={"Content-Type": "application/xml"},
-            payload=data, timeout=10, enable_logging=False)
+            node,
+            path,
+            headers={"Content-Type": "application/json",
+                     "Accept": "text/plain"},
+            json=data,
+            timeout=10,
+            enable_logging=False)
 
         if status_code == HTTPCodes.OK:
             logger.info("ODL mount point configured successfully.")
 
         if status_code == HTTPCodes.OK:
             logger.info("ODL mount point configured successfully.")
@@ -659,6 +671,7 @@ class HoneycombSetup(object):
         if int(ret_code) != 0:
             logger.debug("VPP service refused to shut down.")
 
         if int(ret_code) != 0:
             logger.debug("VPP service refused to shut down.")
 
+
 class HoneycombStartupConfig(object):
     """Generator for Honeycomb startup configuration.
     """
 class HoneycombStartupConfig(object):
     """Generator for Honeycomb startup configuration.
     """
@@ -681,7 +694,7 @@ class HoneycombStartupConfig(object):
         done
         """
 
         done
         """
 
-        self.java_call = "{scheduler} {affinity} java {jit_mode} {params}"
+        self.java_call = "{scheduler} {affinity} java{jit_mode}{params}"
 
         self.scheduler = ""
         self.core_affinity = ""
 
         self.scheduler = ""
         self.core_affinity = ""
@@ -751,9 +764,9 @@ class HoneycombStartupConfig(object):
         :type jit_mode: str
         """
 
         :type jit_mode: str
         """
 
-        modes = {"client": "-client",  # Default
-                 "server": "-server",  # Higher performance but longer warmup
-                 "classic": "-classic"  # Disables JIT compiler
+        modes = {"client": " -client",  # Default
+                 "server": " -server",  # Higher performance but longer warmup
+                 "classic": " -classic"  # Disables JIT compiler
                 }
 
         self.jit_mode = modes[jit_mode]
                 }
 
         self.jit_mode = modes[jit_mode]
@@ -790,3 +803,10 @@ class HoneycombStartupConfig(object):
         architectures."""
 
         self.params += " -XX:+UseNUMA -XX:+UseParallelGC"
         architectures."""
 
         self.params += " -XX:+UseNUMA -XX:+UseParallelGC"
+
+    def set_ssh_security_provider(self):
+        """Disables BouncyCastle for SSHD."""
+        # Workaround for issue described in:
+        # https://wiki.fd.io/view/Honeycomb/Releases/1609/Honeycomb_and_ODL
+
+        self.params += " -Dorg.apache.sshd.registerBouncyCastle=false"
index 1b08e39..087bde8 100644 (file)
 | | Configure Persistence | ${node} | disable
 | | Configure jVPP timeout | ${node} | ${14}
 | | Clear Persisted Honeycomb Configuration | ${node}
 | | Configure Persistence | ${node} | disable
 | | Configure jVPP timeout | ${node} | ${14}
 | | Clear Persisted Honeycomb Configuration | ${node}
+| | Generate Honeycomb startup configuration for ODL test | ${node}
 | | Configure Honeycomb service on DUTs | ${node}
 
 | Configure ODL Client for functional testing
 | | Configure Honeycomb service on DUTs | ${node}
 
 | Configure ODL Client for functional testing
 | | Run Keyword If | '${use_odl_client}' != '${NONE}'
 | | ... | Run Keywords
 | | ... | Stop ODL Client | ${node} | /tmp | AND
 | | Run Keyword If | '${use_odl_client}' != '${NONE}'
 | | ... | Run Keywords
 | | ... | Stop ODL Client | ${node} | /tmp | AND
-| | ... | Wait until keyword succeeds | 2min | 15sec
+| | ... | Wait until keyword succeeds | 3min | 15sec
 | | ... | Check ODL shutdown state | ${node} | AND
 | | ... | Set Global Variable | ${use_odl_client} | ${NONE}
 | | Stop Honeycomb service on DUTs | ${node}
 | | ... | Check ODL shutdown state | ${node} | AND
 | | ... | Set Global Variable | ${use_odl_client} | ${NONE}
 | | Stop Honeycomb service on DUTs | ${node}
 | | Log Honeycomb and VPP process distribution on cores | ${node}
 | | Stop Honeycomb service on DUTs | ${node}
 | | Stop VPP Service on DUT | ${node}
 | | Log Honeycomb and VPP process distribution on cores | ${node}
 | | Stop Honeycomb service on DUTs | ${node}
 | | Stop VPP Service on DUT | ${node}
+
+| Generate Honeycomb startup configuration for ODL test
+| | [Documentation] | Create HC startup configuration and apply to config
+| | ... | file on DUT. Requires Honeycomb restart to take effect.
+| | ...
+| | ... | *Arguments:*
+| | ... | - node - Honeycomb node. Type: dictionary
+| | ...
+| | ... | *Example:*
+| | ...
+| | ... | \| Generate Honeycomb startup configuration for ODL test \
+| | ... | \| ${nodes[DUT1]} \|
+| | ...
+| | [Arguments] | ${node}
+| | Import Library | resources.libraries.python.honeycomb.HoneycombSetup.HoneycombStartupConfig
+| | ... | WITH NAME | HC_config
+| | Run Keyword | HC_config.Set SSH Security provider
+| | Run Keyword | HC_config.Set Memory Size | ${32}
+| | Run Keyword | HC_config.Set Metaspace Size | ${32}
+| | Run Keyword | HC_config.Apply config | ${node}
diff --git a/resources/templates/honeycomb/odl_client/mount_honeycomb.json b/resources/templates/honeycomb/odl_client/mount_honeycomb.json
new file mode 100644 (file)
index 0000000..6041e53
--- /dev/null
@@ -0,0 +1,11 @@
+{
+  "node": {
+    "node-id": "vpp",
+    "netconf-node-topology:host": "127.0.0.1",
+    "netconf-node-topology:port": "2831",
+    "netconf-node-topology:username": "admin",
+    "netconf-node-topology:password": "admin",
+    "netconf-node-topology:tcp-only": "false",
+    "netconf-node-topology:keepalive-delay": "0"
+  }
+}
\ No newline at end of file
diff --git a/resources/templates/honeycomb/odl_client/mount_honeycomb.xml b/resources/templates/honeycomb/odl_client/mount_honeycomb.xml
deleted file mode 100644 (file)
index 97f43e1..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-<module xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
-  <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">prefix:sal-netconf-connector</type>
-  <name>vpp</name>
-  <address xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">127.0.0.1</address>
-  <port xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">2831</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">false</tcp-only>
-  <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>
-  <keepalive-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:scheduled-threadpool</type>
-    <name>global-netconf-ssh-scheduled-executor</name>
-  </keepalive-executor>
-</module>
\ No newline at end of file
index 4d7e7d0..e76f47c 100644 (file)
@@ -1 +1 @@
-/restconf/config/network-topology:network-topology/topology/topology-netconf/node/controller-config/yang-ext:mount/config:modules
\ No newline at end of file
+/restconf/config/network-topology:network-topology/topology/topology-netconf
\ No newline at end of file