HC Test: revert to using restconf over http 85/5985/2
authorselias <samelias@cisco.com>
Fri, 31 Mar 2017 09:47:53 +0000 (11:47 +0200)
committerTibor Frank <tifrank@cisco.com>
Mon, 3 Apr 2017 07:33:36 +0000 (07:33 +0000)
 - use http instead of https for restconf connection
 - add missing import to proxyARP robot library
 - use VAT interface dump to identify interfaces in VAT ip address dump

Change-Id: Ic381ff3f9b56a6c633382450559134f5389956c2
Signed-off-by: selias <samelias@cisco.com>
resources/libraries/python/HTTPRequest.py
resources/libraries/python/InterfaceUtil.py
resources/libraries/python/honeycomb/HoneycombSetup.py
resources/libraries/robot/honeycomb/proxyarp.robot
tests/func/honeycomb/mgmt-cfg-proxynd6-apihc-func.robot

index 5f87484..d553c66 100644 (file)
@@ -27,8 +27,6 @@ from robot.libraries.BuiltIn import BuiltIn
 
 from requests import request, RequestException, Timeout, TooManyRedirects, \
     HTTPError, ConnectionError
 
 from requests import request, RequestException, Timeout, TooManyRedirects, \
     HTTPError, ConnectionError
-from requests.packages.urllib3 import disable_warnings
-from requests.packages.urllib3.exceptions import InsecureRequestWarning
 from requests.auth import HTTPBasicAuth
 
 
 from requests.auth import HTTPBasicAuth
 
 
@@ -78,9 +76,6 @@ class HTTPRequestError(Exception):
             logger.error(self._msg)
             logger.debug(self._details)
 
             logger.error(self._msg)
             logger.debug(self._details)
 
-        # suppress warnings about disabled SSL verification
-        disable_warnings(InsecureRequestWarning)
-
     def __repr__(self):
         return repr(self._msg)
 
     def __repr__(self):
         return repr(self._msg)
 
@@ -129,8 +124,8 @@ class HTTPRequest(object):
         except (AttributeError, AddressValueError):
             pass
 
         except (AttributeError, AddressValueError):
             pass
 
-        return "https://{ip}:{port}{path}".format(ip=ip_addr, port=port,
-                                                  path=path)
+        return "http://{ip}:{port}{path}".format(ip=ip_addr, port=port,
+                                                 path=path)
 
     @staticmethod
     def _http_request(method, node, path, enable_logging=True, **kwargs):
 
     @staticmethod
     def _http_request(method, node, path, enable_logging=True, **kwargs):
index 793f908..ff9ecde 100644 (file)
@@ -261,8 +261,14 @@ class InterfaceUtil(object):
          :rtype: list
         """
 
          :rtype: list
         """
 
-        sw_if_index = Topology.convert_interface_reference(
-            node, interface, "sw_if_index")
+        try:
+            sw_if_index = Topology.convert_interface_reference(
+                node, interface, "sw_if_index")
+        except RuntimeError:
+            if isinstance(interface, basestring):
+                sw_if_index = InterfaceUtil.get_sw_if_index(node, interface)
+            else:
+                raise
 
         with VatTerminal(node) as vat:
             response = vat.vat_terminal_exec_cmd_from_template(
 
         with VatTerminal(node) as vat:
             response = vat.vat_terminal_exec_cmd_from_template(
index 858aa21..52257bf 100644 (file)
@@ -239,13 +239,13 @@ class HoneycombSetup(object):
          :raises HoneycombError: If the configuration could not be changed.
          """
 
          :raises HoneycombError: If the configuration could not be changed.
          """
 
-        find = "restconf-https-binding-address"
+        find = "restconf-http-binding-address"
         try:
             IPv6Address(unicode(node["host"]))
             # if management IP of the node is in IPv6 format
         try:
             IPv6Address(unicode(node["host"]))
             # if management IP of the node is in IPv6 format
-            replace = '\\"restconf-https-binding-address\\": \\"0::0\\",'
+            replace = '\\"restconf-binding-address\\": \\"0::0\\",'
         except (AttributeError, AddressValueError):
         except (AttributeError, AddressValueError):
-            replace = '\\"restconf-https-binding-address\\": \\"0.0.0.0\\",'
+            replace = '\\"restconf-binding-address\\": \\"0.0.0.0\\",'
 
         argument = '"/{0}/c\\ {1}"'.format(find, replace)
         path = "{0}/config/honeycomb.json".format(Const.REMOTE_HC_DIR)
 
         argument = '"/{0}/c\\ {1}"'.format(find, replace)
         path = "{0}/config/honeycomb.json".format(Const.REMOTE_HC_DIR)
index b9e9b81..745507a 100644 (file)
@@ -12,6 +12,7 @@
 # limitations under the License.
 
 *** Settings ***
 # limitations under the License.
 
 *** Settings ***
+| Library | resources.libraries.python.honeycomb.proxyARP.ProxyARPKeywords
 | Library | resources.libraries.python.honeycomb.proxyARP.IPv6NDProxyKeywords
 | Documentation | Keywords used to test Honeycomb ARP proxy and IPv6ND proxy.
 
 | Library | resources.libraries.python.honeycomb.proxyARP.IPv6NDProxyKeywords
 | Documentation | Keywords used to test Honeycomb ARP proxy and IPv6ND proxy.
 
index 2e2f062..423c788 100644 (file)
@@ -36,7 +36,7 @@
 | Library | resources.libraries.python.Trace
 | Test Setup | Clear Packet Trace on All DUTs | ${nodes}
 | Suite Teardown | Restart Honeycomb And VPP | ${node}
 | Library | resources.libraries.python.Trace
 | Test Setup | Clear Packet Trace on All DUTs | ${nodes}
 | Suite Teardown | Restart Honeycomb And VPP | ${node}
-| Force Tags | honeycomb_sanity | honeycomb_test
+| Force Tags | honeycomb_sanity | honeycomb_odl
 | Documentation | *Honeycomb IPv6 neighbor discovery proxy test suite.*
 
 *** Test Cases ***
 | Documentation | *Honeycomb IPv6 neighbor discovery proxy test suite.*
 
 *** Test Cases ***