CSIT-611: HC Test: Lisp suite updates + LispGPE 17/7917/5
authorselias <samelias@cisco.com>
Thu, 13 Jul 2017 11:15:41 +0000 (13:15 +0200)
committerTibor Frank <tifrank@cisco.com>
Wed, 9 Aug 2017 13:09:26 +0000 (13:09 +0000)
 - added LispGPE test suite
 - added IPv6 tests to Lisp suite
 - added traffic tests to Lisp suite

Change-Id: I3b699149cd73ebf5856072d3f26e98a370dbfc4b
Signed-off-by: selias <samelias@cisco.com>
14 files changed:
resources/libraries/python/honeycomb/Lisp.py
resources/libraries/robot/honeycomb/lisp.robot
resources/libraries/robot/honeycomb/lisp_gpe.robot [new file with mode: 0644]
resources/libraries/robot/overlay/l2lisp.robot
resources/libraries/robot/overlay/lisp_api.robot
resources/libraries/robot/overlay/lisp_static_adjacency.robot
resources/templates/honeycomb/config_lisp_gpe.url [new file with mode: 0644]
resources/templates/honeycomb/oper_lisp_gpe.url [new file with mode: 0644]
resources/test_data/honeycomb/lisp/lisp.py [moved from resources/test_data/honeycomb/lisp.py with 59% similarity]
resources/test_data/honeycomb/lisp/lisp_gpe.py [new file with mode: 0644]
resources/traffic_scripts/lisp/lisp_check.py [new file with mode: 0755]
resources/traffic_scripts/lisp/lispgpe_check.py [new file with mode: 0755]
tests/vpp/func/honeycomb/mgmt-cfg-lisp-apihc-apivat-func.robot
tests/vpp/func/honeycomb/mgmt-cfg-lispgpe-apihc-apivat-func.robot [new file with mode: 0644]

index f89ffed..f2fe24c 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2016 Cisco and/or its affiliates.
+# Copyright (c) 2017 Cisco and/or its affiliates.
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at:
@@ -11,7 +11,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-"""This module implements keywords to manipulate Lisp data structures using
+"""This module implements keywords to manipulate LISP data structures using
 Honeycomb REST API."""
 
 from resources.libraries.python.HTTPRequest import HTTPCodes
@@ -20,15 +20,16 @@ from resources.libraries.python.honeycomb.HoneycombUtil \
     import HoneycombUtil as HcUtil
 from resources.libraries.python.honeycomb.HoneycombUtil \
     import DataRepresentation
+from resources.libraries.python.topology import Topology
 
 
 class LispKeywords(object):
     """Implementation of keywords which make it possible to:
-    - enable/disable Lisp feature
-    - configure Lisp mappings
+    - enable/disable LISP feature
+    - configure LISP mappings
     - configure locator sets
     - configure map resolver
-    - configure Lisp PITR feature
+    - configure LISP PITR feature
     - read operational data for all of the above
     """
 
@@ -38,7 +39,7 @@ class LispKeywords(object):
 
     @staticmethod
     def _set_lisp_properties(node, path, data=None):
-        """Set Lisp properties and check the return code.
+        """Set LISP properties and check the return code.
 
         :param node: Honeycomb node.
         :param path: Path which is added to the base path to identify the data.
@@ -80,7 +81,7 @@ class LispKeywords(object):
         status_code, resp = HcUtil.get_honeycomb_data(node, "oper_lisp")
 
         if status_code != HTTPCodes.OK:
-            raise HoneycombError("Could not retrieve Lisp operational data."
+            raise HoneycombError("Could not retrieve LISP operational data."
                                  "Status code: {0}.".format(status_code))
         else:
             # get rid of empty vni-table entry
@@ -97,7 +98,7 @@ class LispKeywords(object):
     def verify_map_server_data_from_honeycomb(data, ip_addresses):
         """Verify whether MAP server data from Honeycomb is correct.
 
-        :param data: Lisp operational data containing map server IP addresses.
+        :param data: LISP operational data containing map server IP addresses.
         :param ip_addresses: IP addresses to verify map server data against.
         :type data: dict
         :type ip_addresses: list
@@ -117,7 +118,7 @@ class LispKeywords(object):
     def verify_map_server_data_from_vat(data, ip_addresses):
         """Verify whether MAP server data from VAT is correct.
 
-        :param data: Lisp operational data containing map server IP addresses.
+        :param data: LISP operational data containing map server IP addresses.
         :param ip_addresses: IP addresses to verify map server data against.
         :type data: dict
         :type ip_addresses: list
@@ -132,10 +133,10 @@ class LispKeywords(object):
 
     @staticmethod
     def set_lisp_state(node, state=True):
-        """Enable or disable the Lisp feature.
+        """Enable or disable the LISP feature.
 
         :param node: Honeycomb node.
-        :param state: Enable or disable Lisp.
+        :param state: Enable or disable LISP.
         :type node: dict
         :type state: bool
         :returns: Content of response.
@@ -151,7 +152,7 @@ class LispKeywords(object):
             data = {"lisp": {"enable": bool(state)}}
         else:
             raise HoneycombError("Unexpected return code when getting existing"
-                                 " Lisp configuration.")
+                                 " LISP configuration.")
 
         return LispKeywords._set_lisp_properties(node, '', data)
 
@@ -179,7 +180,7 @@ class LispKeywords(object):
 
     @staticmethod
     def add_locator(node, interface, locator_set, priority=1, weight=1):
-        """Configure a new Lisp locator set.
+        """Configure a new LISP locator set.
 
         :param node: Honeycomb node.
         :param interface: An interface on the node.
@@ -195,6 +196,9 @@ class LispKeywords(object):
         :rtype: bytearray
         """
 
+        interface = Topology.convert_interface_reference(
+            node, interface, "name")
+
         path = "/lisp-feature-data/locator-sets/locator-set" \
                "/{0}".format(locator_set)
 
@@ -216,7 +220,7 @@ class LispKeywords(object):
         """Modify eid-table configuration to the data provided.
 
         :param node: Honeycomb node.
-        :param data: Settings for the Lisp mappings.
+        :param data: Settings for the LISP mappings.
         :type node: dict
         :type data: dict
         :returns: Content of response.
@@ -228,10 +232,10 @@ class LispKeywords(object):
 
     @staticmethod
     def configure_lisp_map_request_mode(node, option):
-        """Modify Lisp Map Request Mode configuration to the data provided.
+        """Modify LISP Map Request Mode configuration to the data provided.
 
         :param node: Honeycomb node.
-        :param option: Settings for the Lisp map request mode.
+        :param option: Settings for the LISP map request mode.
         :type node: dict
         :type option: str
         :returns: Content of response.
@@ -249,7 +253,7 @@ class LispKeywords(object):
 
     @staticmethod
     def add_lisp_adjacency(node, vni_id, map_name, adjacency_name, data):
-        """Add an adjacency to an existing Lisp mapping.
+        """Add an adjacency to an existing LISP mapping.
 
         :param node: Honeycomb node.
         :param vni_id: vni_id of the mapping.
@@ -452,7 +456,7 @@ class LispKeywords(object):
 
     @staticmethod
     def disable_lisp(node):
-        """Remove all Lisp settings on the node.
+        """Remove all LISP settings on the node.
 
         :param node: Honeycomb node.
         :type node: dict
@@ -461,3 +465,207 @@ class LispKeywords(object):
         """
 
         return LispKeywords._set_lisp_properties(node, "")
+
+
+class LispGPEKeywords(object):
+    """Implementation of keywords which make it possible to:
+    - enable/disable LISP GPE feature
+    - configure LISP GPE forwarding entries
+    - read operational data for all of the above
+    """
+
+    def __init__(self):
+        """Initializer."""
+        pass
+
+    @staticmethod
+    def _set_lispgpe_properties(node, path, data=None):
+        """Set LISP GPE properties and check the return code.
+
+        :param node: Honeycomb node.
+        :param path: Path which is added to the base path to identify the data.
+        :param data: The new data to be set. If None, the item will be removed.
+        :type node: dict
+        :type path: str
+        :type data: dict
+        :returns: Content of response.
+        :rtype: bytearray
+        :raises HoneycombError: If the status code in response to PUT is not
+        200 = OK or 201 = ACCEPTED.
+        """
+
+        if data:
+            status_code, resp = HcUtil.\
+                put_honeycomb_data(node, "config_lisp_gpe", data, path,
+                                   data_representation=DataRepresentation.JSON)
+        else:
+            status_code, resp = HcUtil.\
+                delete_honeycomb_data(node, "config_lisp_gpe", path)
+
+        if status_code not in (HTTPCodes.OK, HTTPCodes.ACCEPTED):
+            raise HoneycombError(
+                "Lisp GPE configuration unsuccessful. "
+                "Status code: {0}.".format(status_code))
+        else:
+            return resp
+
+    @staticmethod
+    def get_lispgpe_operational_data(node):
+        """Retrieve LISP GPE properties from Honeycomb operational data.
+
+        :param node: Honeycomb node.
+        :type node: dict
+        :returns: LISP GPE operational data.
+        :rtype: bytearray
+        :raises HoneycombError: If the status code in response to GET is not
+        200 = OK.
+        """
+
+        status_code, resp = HcUtil.get_honeycomb_data(node, "oper_lisp_gpe")
+
+        if status_code != HTTPCodes.OK:
+            raise HoneycombError("Could not retrieve Lisp GPE operational data."
+                                 "Status code: {0}.".format(status_code))
+        else:
+            return resp
+
+    @staticmethod
+    def get_lispgpe_mapping(node, name):
+        """Retrieve LISP GPE operational data and parse for a specific mapping.
+
+        :param node: Honeycomb node.
+        :param name: Name of the mapping to look for.
+        :type node: dict
+        :type name: str
+        :returns: LISP GPE mapping.
+        :rtype: dict
+        :raises HoneycombError: If the mapping is not present in operational
+        data.
+        """
+
+        data = LispGPEKeywords.get_lispgpe_operational_data(node)
+        try:
+            data = data["gpe-state"]["gpe-feature-data"]["gpe-entry-table"] \
+                ["gpe-entry"]
+        except KeyError:
+            raise HoneycombError("No mappings present in operational data.")
+        for item in data:
+            if item["id"] == name:
+                mapping = item
+                break
+        else:
+            raise HoneycombError("Mapping with name {name} not found in "
+                                 "operational data.".format(name=name))
+
+        return mapping
+
+    @staticmethod
+    def get_lispgpe_config_data(node):
+        """Retrieve LISP GPE properties from Honeycomb config data.
+
+        :param node: Honeycomb node.
+        :type node: dict
+        :returns: LISP GPE config data.
+        :rtype: bytearray
+        :raises HoneycombError: If the status code in response to GET is not
+        200 = OK.
+        """
+
+        status_code, resp = HcUtil.get_honeycomb_data(node, "config_lisp_gpe")
+
+        if status_code != HTTPCodes.OK:
+            raise HoneycombError("Could not retrieve Lisp GPE config data."
+                                 "Status code: {0}.".format(status_code))
+        else:
+            return resp
+
+    @staticmethod
+    def set_lispgpe_state(node, state=True):
+        """Enable or disable the LISP GPE feature.
+
+        :param node: Honeycomb node.
+        :param state: Enable or disable LISP.
+        :type node: dict
+        :type state: bool
+        :returns: Content of response.
+        :rtype: bytearray
+        :raises HoneycombError: If the return code is not 200:OK
+        or 404:NOT FOUND.
+        """
+
+        ret_code, data = HcUtil.get_honeycomb_data(node, "config_lisp_gpe")
+        if ret_code == HTTPCodes.OK:
+            data["gpe"]["gpe-feature-data"]["enable"] = bool(state)
+        elif ret_code == HTTPCodes.NOT_FOUND:
+            data = {"gpe": {"gpe-feature-data": {"enable": bool(state)}}}
+        else:
+            raise HoneycombError("Unexpected return code when getting existing"
+                                 " Lisp GPE configuration.")
+
+        return LispGPEKeywords._set_lispgpe_properties(node, '', data)
+
+    @staticmethod
+    def configure_lispgpe_mapping(node, data=None):
+        """Modify LISP GPE mapping configuration to the data provided.
+
+        :param node: Honeycomb node.
+        :param data: Settings for the LISP GPE mappings.
+        :type node: dict
+        :type data: dict
+        :returns: Content of response.
+        :rtype: bytearray
+        """
+
+        path = "/gpe-feature-data/gpe-entry-table"
+        if data:
+            data = {"gpe-entry-table": {"gpe-entry": data}}
+            return LispGPEKeywords._set_lispgpe_properties(node, path, data)
+        else:
+            return LispGPEKeywords._set_lispgpe_properties(node, path)
+
+    @staticmethod
+    def add_lispgpe_mapping(node, name, data):
+        """Add the specified LISP GPE mapping.
+
+        :param node: Honeycomb node.
+        :param name: Name for the mapping.
+        :param data: Mapping details.
+        :type node: dict
+        :type name: str
+        :type data: dict
+        :returns: Content of response.
+        :rtype: bytearray
+        """
+
+        path = "/gpe-feature-data/gpe-entry-table/gpe-entry/{name}".format(
+            name=name)
+
+        data = {"gpe-entry": data}
+        return LispGPEKeywords._set_lispgpe_properties(node, path, data)
+
+    @staticmethod
+    def delete_lispgpe_mapping(node, mapping):
+        """Delete the specified LISP GPE mapping from configuration.
+
+        :param node: Honeycomb node.
+        :param mapping: Name of the mapping to remove.
+        :type node: dict
+        :type mapping: str
+        :returns: Content of response.
+        :rtype: bytearray
+        """
+
+        path = "/gpe-feature-data/gpe-entry-table/gpe-entry/{0}".format(mapping)
+        return LispGPEKeywords._set_lispgpe_properties(node, path)
+
+    @staticmethod
+    def disable_lispgpe(node):
+        """Remove all LISP GPE settings on the node.
+
+        :param node: Honeycomb node.
+        :type node: dict
+        :returns: Content of response.
+        :rtype: bytearray
+        """
+
+        return LispGPEKeywords._set_lispgpe_properties(node, "")
index cda8d82..5decf6b 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2016 Cisco and/or its affiliates.
+# Copyright (c) 2017 Cisco and/or its affiliates.
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at:
@@ -18,7 +18,7 @@
 
 *** Keywords ***
 | Honeycomb enables LISP
-| | [Documentation] | Uses Honeycomb API to enable Lisp.
+| | [Documentation] | Uses Honeycomb API to enable LISP.
 | | ...
 | | ... | *Arguments:*
 | | ... | - node - Information about a DUT node. Type: dictionary
 | | ...
 | | [Arguments] | ${node}
 | | ...
-| | Set Lisp state | ${node} | ${TRUE}
+| | Set LISP state | ${node} | ${TRUE}
 
 | Honeycomb disables LISP
-| | [Documentation] | Uses Honeycomb API to disable Lisp.
+| | [Documentation] | Uses Honeycomb API to disable LISP.
 | | ...
 | | ... | *Arguments:*
 | | ... | - node - Information about a DUT node. Type: dictionary
 | | ...
 | | [Arguments] | ${node}
 | | ...
-| | Set Lisp state | ${node} | ${FALSE}
+| | Set LISP state | ${node} | ${FALSE}
 
 | Honeycomb adds locator set
-| | [Documentation] | Uses Honeycomb API to enable Lisp.
+| | [Documentation] | Uses Honeycomb API to enable LISP.
 | | ...
 | | ... | *Arguments:*
 | | ... | - node - Information about a DUT node. Type: dictionary
 | | ...
 | | Add locator | ${node} | ${interface} | ${locator_set}
 
-| Honeycomb adds Lisp Mapping
-| | [Documentation] | Uses Honeycomb API to configure a Lisp mapping.
+| Honeycomb adds LISP Mapping
+| | [Documentation] | Uses Honeycomb API to configure a LISP mapping.
 | | ...
 | | ... | *Arguments:*
 | | ... | - node - Information about a DUT node. Type: dictionary
-| | ... | - data - Lisp settings to use. Type: dictionary
+| | ... | - data - LISP settings to use. Type: dictionary
 | | ...
 | | ... | *Example:*
 | | ...
-| | ... | \| Honeycomb adds Lisp Mapping \| ${nodes['DUT1']} \| ${data} \|
+| | ... | \| Honeycomb adds LISP Mapping \| ${nodes['DUT1']} \| ${data} \|
 | | ...
 | | [Arguments] | ${node} | ${data}
 | | ...
-| | Configure Lisp Mapping | ${node} | ${data}
+| | Configure LISP Mapping | ${node} | ${data}
 
 | Honeycomb removes all LISP mappings
 | | [Documentation] | Uses Honeycomb API to clear the eid-table.
 | | ...
 | | [Arguments] | ${node}
 | | ...
-| | Configure lisp mapping | ${node} | ${NONE}
+| | Configure LISP mapping | ${node} | ${NONE}
 
 | LISP should not be configured
-| | [Documentation] | Retrieves Lisp configuration from Honeycomb operational\
+| | [Documentation] | Retrieves LISP configuration from Honeycomb operational\
 | | ... | data, and expects an empty dictionary.
 | | ...
 | | ... | *Arguments:*
 | | [Arguments] | ${node}
 | | ...
 | | Run keyword and Expect Error | KeyError: 'lisp-feature-data'
-| | ... | Get Lisp operational data | ${node}
+| | ... | Get LISP operational data | ${node}
 
 | LISP state from Honeycomb should be
-| | [Documentation] | Retrieves Lisp state from Honeycomb operational\
-| | ... | data, and compares Lisp state with expected value.
+| | [Documentation] | Retrieves LISP state from Honeycomb operational\
+| | ... | data, and compares LISP state with expected value.
 | | ...
 | | ... | *Arguments:*
 | | ... | - node - Information about a DUT node. Type: dictionary
-| | ... | - state - Expected Lisp state. Type: string
+| | ... | - state - Expected LISP state. Type: string
 | | ...
 | | ... | *Example:*
 | | ...
 | | ... | \| enabled \|
 | | ...
 | | [Arguments] | ${node} | ${state}
-| | ${data}= | Get Lisp operational data | ${node}
+| | ${data}= | Get LISP operational data | ${node}
 | | ...
 | | Run keyword if | $state == 'enabled'
 | | ... | Should be equal as strings
 | | ... | ${data['lisp-state']['enable']} | ${False}
 
 | LISP state from VAT should be
-| | [Documentation] | Retrieves Lisp state from VAT,\
-| | ... | and compares Lisp state with expected value.
+| | [Documentation] | Retrieves LISP state from VAT,\
+| | ... | and compares LISP state with expected value.
 | | ...
 | | ... | *Arguments:*
 | | ... | - node - Information about a DUT node. Type: dictionary
-| | ... | - state - Expected Lisp state. Type: string
+| | ... | - state - Expected LISP state. Type: string
 | | ...
 | | ... | *Example:*
 | | ...
 | | ...
 | | [Arguments] | ${node} | ${state}
 | | ...
-| | ${status}= | VPP show Lisp State | ${node}
+| | ${status}= | VPP show LISP State | ${node}
 | | Should match | ${status['feature_status']} | ${state}
 
 | LISP mapping from Honeycomb should be
-| | [Documentation] | Retrieves Lisp mapping from Honeycomb operational\
+| | [Documentation] | Retrieves LISP mapping from Honeycomb operational\
 | | ... | data, and compares with expected data.
 | | ...
 | | ... | *Arguments:*
 | | ... | - node - Information about a DUT node. Type: dictionary
-| | ... | - settings - Expected Lisp mapping data. Type: dictionary
+| | ... | - settings - Expected LISP mapping data. Type: dictionary
 | | ...
 | | ... | *Example:*
 | | ...
 | | ...
 | | [Arguments] | ${node} | ${settings}
 | | ...
-| | ${data}= | Get Lisp operational data | ${node}
+| | ${data}= | Get LISP operational data | ${node}
 | | ${data}= | Set Variable | ${data['lisp-state']['lisp-feature-data']}
 | | ${data}= | Set Variable | ${data['eid-table']['vni-table'][0]}
 | | Compare data structures | ${data} | ${settings}
 
 | LISP mapping from VAT should be
-| | [Documentation] | Retrieves Lisp mapping from VAT,\
+| | [Documentation] | Retrieves LISP mapping from VAT,\
 | | ... | and compares with expected data.
 | | ...
 | | ... | *Arguments:*
 | | ... | - node - Information about a DUT node. Type: dictionary
-| | ... | - settings - Expected Lisp mapping data. Type: dictionary
+| | ... | - settings - Expected LISP mapping data. Type: dictionary
 | | ...
 | | ... | *Example:*
 | | ...
 | | ...
 | | [Arguments] | ${node} | ${settings}
 | | ...
-| | ${data}= | VPP show Lisp eid table | ${node}
+| | ${data}= | VPP show LISP eid table | ${node}
 | | Compare data structures | ${data[0]} | ${settings}
 
 | LISP mappings from Honeycomb should not exist
-| | [Documentation] | Retrieves Lisp mappings from operational\
+| | [Documentation] | Retrieves LISP mappings from operational\
 | | ... | data, and expects to find none.
 | | ...
 | | ... | *Arguments:*
 | | ...
 | | [Arguments] | ${node}
 | | ...
-| | ${data}= | Get Lisp operational data | ${node}
+| | ${data}= | Get LISP operational data | ${node}
 | | ${data}= | Set Variable | ${data['lisp-state']['lisp-feature-data']}
 | | Should be empty | ${data['eid-table']['vni-table']}
 
 | LISP mappings from VAT should not exist
-| | [Documentation] | Retrieves Lisp mappings from VAT,\
+| | [Documentation] | Retrieves LISP mappings from VAT,\
 | | ... | and expects to receive an empty list.
 | | ...
 | | ... | *Arguments:*
 | | ...
 | | [Arguments] | ${node}
 | | ...
-| | ${data}= | VPP show Lisp eid table | ${node}
+| | ${data}= | VPP show LISP eid table | ${node}
 | | Should be empty | ${data}
 
 | Locator set from Honeycomb should be
-| | [Documentation] | Retrieves Lisp locator set from Honeycomb operational\
+| | [Documentation] | Retrieves LISP locator set from Honeycomb operational\
 | | ... | data, and compares with expected data.
 | | ...
 | | ... | *Arguments:*
 | | ...
 | | [Arguments] | ${node} | ${interface} | ${locator_set}
 | | ...
-| | ${data}= | Get Lisp operational data | ${node}
+| | ${data}= | Get LISP operational data | ${node}
 | | ${loc_data}= | Set Variable
 | | ... | ${data['lisp-state']['lisp-feature-data']['locator-sets']}
 | | Should be equal
 | | ... | ${interface}
 
 | Honeycomb adds LISP adjacency
-| | [Documentation] | Uses Honeycomb API to configure Lisp adjacency.
+| | [Documentation] | Uses Honeycomb API to configure LISP adjacency.
 | | ...
 | | ... | *Arguments:*
 | | ... | - node - Information about a DUT node. Type: dictionary
 | | ... | - vni - Virtual network identifier number. Type: integer
 | | ... | - map - Name of an existing remote mapping. Type: string
 | | ... | - adjacency - Name for the new adjacency. Type: string
-| | ... | - data - Lisp adjacency settings to use. Type: dictionary
+| | ... | - data - LISP adjacency settings to use. Type: dictionary
 | | ...
 | | ... | *Example:*
 | | ...
 | | ...
 | | [Arguments] | ${node} | ${vni} | ${map} | ${adjacency} | ${data}
 | | ...
-| | Add Lisp adjacency
+| | Add LISP adjacency
 | | ... | ${node} | ${vni} | ${map} | ${adjacency} | ${data}
 
 | Honeycomb adds LISP map resolver
-| | [Documentation] | Uses Honeycomb API to configure Lisp map resolver.
+| | [Documentation] | Uses Honeycomb API to configure LISP map resolver.
 | | ...
 | | ... | *Arguments:*
 | | ... | - node - Information about a DUT node. Type: dictionary
 | | ...
 | | Add map resolver | ${node} | ${ip_address}
 
-| Honeycomb adds Lisp Map register
-| | [Documentation] | Uses Honeycomb API to configure Lisp map register.
+| Honeycomb adds LISP Map register
+| | [Documentation] | Uses Honeycomb API to configure LISP map register.
 | | ...
 | | ... | *Arguments:*
 | | ... | - node - Information about a DUT node. Type: dictionary
 | | ...
 | | ... | *Example:*
 | | ...
-| | ... | \| Honeycomb adds Lisp Map register \| ${nodes['DUT1']} \
+| | ... | \| Honeycomb adds LISP Map register \| ${nodes['DUT1']} \
 | | ... | \| ${True} \|
 | | ...
 | | [Arguments] | ${node} | ${add_map_register}
 | | ...
 | | Set Map Register | ${node} | ${add_map_register}
 
-| Honeycomb sets Lisp Map request Mode
-| | [Documentation] | Uses Honeycomb API to configure Lisp map request mode.
+| Honeycomb sets LISP Map request Mode
+| | [Documentation] | Uses Honeycomb API to configure LISP map request mode.
 | | ...
 | | ... | *Arguments:*
 | | ... | - node - Information about a DUT node. Type: dictionary
 | | ...
 | | ... | *Example:*
 | | ...
-| | ... | \| Honeycomb adds Lisp Map Request Mode \| ${nodes['DUT1']} \
+| | ... | \| Honeycomb adds LISP Map Request Mode \| ${nodes['DUT1']} \
 | | ... | \| ${True} \|
 | | ...
 | | [Arguments] | ${node} | ${set_map_request}
 | | Set Map Request Mode | ${node} | ${set_map_request}
 
 | Map resolver from Honeycomb should be
-| | [Documentation] | Retrieves Lisp map resolver from Honeycomb operational\
+| | [Documentation] | Retrieves LISP map resolver from Honeycomb operational\
 | | ... | data, and compares with expected data.
 | | ...
 | | ... | *Arguments:*
 | | ...
 | | [Arguments] | ${node} | ${ip_address}
 | | ...
-| | ${data}= | Get Lisp operational data | ${node}
+| | ${data}= | Get LISP operational data | ${node}
 | | ${data}= | Set Variable | ${data['lisp-state']['lisp-feature-data']}
 | | ${data}= | Set Variable | ${data['map-resolvers']['map-resolver'][0]}
 | | Should be equal | ${data['ip-address']} | ${ip_address}
 
 | Map resolver from VAT should be
-| | [Documentation] | Retrieves Lisp mapping from VAT,\
+| | [Documentation] | Retrieves LISP mapping from VAT,\
 | | ... | and compares with expected data.
 | | ...
 | | ... | *Arguments:*
 | | ...
 | | [Arguments] | ${node} | ${ip_address}
 | | ...
-| | ${data}= | Vpp show Lisp map resolver | ${node}
+| | ${data}= | Vpp show LISP map resolver | ${node}
 | | Should be equal | ${data[0]['map resolver']} | ${ip_address}
 
-| Honeycomb adds Lisp Map Server
-| | [Documentation] | Uses Honeycomb API to configure Lisp Map Server.
+| Honeycomb adds LISP Map Server
+| | [Documentation] | Uses Honeycomb API to configure LISP Map Server.
 | | ...
 | | ... | *Arguments:*
 | | ... | - node - Information about a DUT node. Type: dictionary
 | | ...
 | | ... | *Example:*
 | | ...
-| | ... | \| Honeycomb adds Lisp Map Server \| ${nodes['DUT1']} \
+| | ... | \| Honeycomb adds LISP Map Server \| ${nodes['DUT1']} \
 | | ... | \| 192.168.0.2 \| 192.168.0.3 \|
 | | ...
 | | [Arguments] | ${node} | @{ip_addresses}
 | | Add Map Server | ${node} | @{ip_addresses}
 
 | Map Register from Honeycomb should be
-| | [Documentation] | Retrieves Lisp Map Register from Honeycomb operational\
+| | [Documentation] | Retrieves LISP Map Register from Honeycomb operational\
 | | ... | data, and compares with expected data.
 | | ...
 | | ... | *Arguments:*
 | | ...
 | | [Arguments] | ${node} | ${state}
 | | ...
-| | ${data}= | Get Lisp operational data | ${node}
+| | ${data}= | Get LISP operational data | ${node}
 | | ${data}= | Set Variable | ${data['lisp-state']['lisp-feature-data']}
 | | ${data}= | Set Variable | ${data['map-register']}
 | | Should be equal | ${data['enabled']} | ${state}
 
 | Map Server from Honeycomb should be
-| | [Documentation] | Retrieves Lisp Map Server from Honeycomb operational\
+| | [Documentation] | Retrieves LISP Map Server from Honeycomb operational\
 | | ... | data, and compares with expected data.
 | | ...
 | | ... | *Arguments:*
 | | ...
 | | [Arguments] | ${node} | @{ip_addresses}
 | | ...
-| | ${data}= | Get Lisp operational data | ${node}
+| | ${data}= | Get LISP operational data | ${node}
 | | Verify Map Server Data from Honeycomb | ${data} | ${ip_addresses}
 
 
 | Map Server from VAT should be
-| | [Documentation] | Retrieves Lisp mapping from VAT,\
+| | [Documentation] | Retrieves LISP mapping from VAT,\
 | | ... | and compares with expected data.
 | | ...
 | | ... | *Arguments:*
 | | ...
 | | [Arguments] | ${node} | @{ip_addresses}
 | | ...
-| | ${data}= | Vpp show Lisp Map Server | ${node}
+| | ${data}= | Vpp show LISP Map Server | ${node}
 | | Verify Map Server Data from VAT | ${data} | ${ip_addresses}
 
 | Map Register from VAT should be
-| | [Documentation] | Retrieves Lisp mapping from VAT,\
+| | [Documentation] | Retrieves LISP mapping from VAT,\
 | | ... | and compares with expected data.
 | | ...
 | | ... | *Arguments:*
 | | ...
 | | [Arguments] | ${node} | ${state}
 | | ...
-| | ${data}= | Vpp show Lisp Map Register | ${node}
+| | ${data}= | Vpp show LISP Map Register | ${node}
 | | Should be equal | ${data['state']} | ${state}
 
 | Map Request Mode from VAT should be
-| | [Documentation] | Retrieves Lisp Request Mode from VAT,\
+| | [Documentation] | Retrieves LISP Request Mode from VAT,\
 | | ... | and compares with expected data.
 | | ...
 | | ... | *Arguments:*
 | | ...
 | | [Arguments] | ${node} | ${destination}
 | | ...
-| | ${data}= | Vpp show Lisp Map Request Mode | ${node}
+| | ${data}= | Vpp show LISP Map Request Mode | ${node}
 | | Should be equal | ${data['map_request_mode']} | ${destination}
 
 | Honeycomb enables LISP PITR feature
-| | [Documentation] | Uses Honeycomb API to configure Lisp PITR feature.
+| | [Documentation] | Uses Honeycomb API to configure LISP PITR feature.
 | | ...
 | | ... | *Arguments:*
 | | ... | - node - Information about a DUT node. Type: dictionary
 | | Configure PITR | ${node} | ${locator_set}
 
 | Honeycomb enables LISP PETR feature
-| | [Documentation] | Uses Honeycomb API to configure Lisp PETR feature.
+| | [Documentation] | Uses Honeycomb API to configure LISP PETR feature.
 | | ...
 | | ... | *Arguments:*
 | | ... | - node - Information about a DUT node. Type: dictionary
 | | Configure PETR | ${node} | ${ip_address}
 
 | Honeycomb enables LISP RLOC feature
-| | [Documentation] | Uses Honeycomb API to enable the Lisp RLOC feature.
+| | [Documentation] | Uses Honeycomb API to enable the LISP RLOC feature.
 | | ...
 | | ... | *Arguments:*
 | | ... | - node - Information about a DUT node. Type: dictionary
 | | ...
 | | [Arguments] | ${node} | ${locator_set}
 | | ...
-| | ${data}= | Get Lisp operational data | ${node}
+| | ${data}= | Get LISP operational data | ${node}
 | | ${data}= | Set Variable | ${data['lisp-state']['lisp-feature-data']}
 | | ${data}= | Set Variable | ${data['pitr-cfg']}
 | | Should be equal | ${data['locator-set']} | ${locator_set}
 | | ...
 | | [Arguments] | ${node} | ${ip_address}
 | | ...
-| | ${data}= | Get Lisp operational data | ${node}
+| | ${data}= | Get LISP operational data | ${node}
 | | ${data}= | Set Variable | ${data['lisp-state']['lisp-feature-data']}
 | | ${data}= | Set Variable | ${data['petr-cfg']['petr-address']}
 | | Should be equal | ${data} | ${ip_address}
 | | ...
 | | [Arguments] | ${node} | ${destination}
 | | ...
-| | ${data}= | Get Lisp operational data | ${node}
+| | ${data}= | Get LISP operational data | ${node}
 | | ${data}= | Set Variable | ${data['lisp-state']['lisp-feature-data']}
 | | ${data}= | Set Variable | ${data['map-request-mode']['mode']}
 | | Should be equal | ${data} | ${destination}
 | | ...
 | | [Arguments] | ${node} | ${state}
 | | ...
-| | ${data}= | Get Lisp operational data | ${node}
+| | ${data}= | Get LISP operational data | ${node}
 | | ${data}= | Set Variable | ${data['lisp-state']['lisp-feature-data']}
 | | ${data}= | Set Variable | ${data['rloc-probe']['enabled']}
 | | Should be equal | ${data} | ${state}
 
 | PETR configuration from VAT should be
-| | [Documentation] | Retrieves Lisp mapping from VAT,\
+| | [Documentation] | Retrieves LISP mapping from VAT,\
 | | ... | and compares with expected data.
 | | ...
 | | ... | *Arguments:*
 | | ...
 | | [Arguments] | ${node} | ${state}
 | | ...
-| | ${data}= | Vpp show Lisp PETR config | ${node}
+| | ${data}= | Vpp show LISP PETR config | ${node}
 | | Should be equal | ${data['status']} | ${state}
 
 | RLOC probing from VAT should be
-| | [Documentation] | Retrieves Lisp mapping from VAT,\
+| | [Documentation] | Retrieves LISP mapping from VAT,\
 | | ... | and compares with expected data.
 | | ...
 | | ... | *Arguments:*
 | | ...
 | | [Arguments] | ${node} | ${state}
 | | ...
-| | ${data}= | Vpp show Lisp RLOC config | ${node}
+| | ${data}= | Vpp show LISP RLOC config | ${node}
 | | Should be equal | ${data['state']} | ${state}
 
 | PITR config from VAT should be
 | | ...
 | | [Arguments] | ${node} | ${locator_set}
 | | ...
-| | ${data}= | VPP show Lisp PITR | ${node}
+| | ${data}= | VPP show LISP PITR | ${node}
 | | Should be equal | ${data['status']} | enabled
 | | Should be equal | ${data['locator_set']} | ${locator_set}
 
 | Honeycomb disables all LISP features
-| | [Documentation] | Uses Honeycomb API to remove all Lisp configuration.
+| | [Documentation] | Uses Honeycomb API to remove all LISP configuration.
 | | ...
 | | ... | *Arguments:*
 | | ... | - node - Information about a DUT node. Type: dictionary
 | | ...
 | | [Arguments] | ${node}
 | | ...
-| | Disable Lisp | ${node}
\ No newline at end of file
+| | Disable LISP | ${node}
+
+| Send packet and verify LISP encap
+| | [Documentation] | Send ICMP packet to DUT out one interface and receive\
+| | ... | a LISP encapsulated packet on the other interface.
+| | ...
+| | ... | *Arguments:*
+| | ...
+| | ... | _NOTE:_ Arguments are based on topology:
+| | ...             | TG(if1)->(if1)DUT(if2)->TG(if2)
+| | ...
+| | ... | - tg_node - Node to execute scripts on (TG). Type: dictionary
+| | ... | - src_ip - IP of source interface (TG-if1). Type: string
+| | ... | - dst_ip - IP of destination interface (TG-if2). Type: string
+| | ... | - tx_src_port - Interface of TG-if1. Type: string
+| | ... | - tx_src_mac - MAC address of TG-if1. Type: string
+| | ... | - tx_dst_mac - MAC address of DUT-if1. Type: string
+| | ... | - rx_port - Interface of TG-if1. Type: string
+| | ... | - rx_src_mac - MAC address of DUT1-if2. Type: string
+| | ... | - rx_dst_mac - MAC address of TG-if2. Type: string
+| | ... | - src_rloc - configured RLOC source address. Type: string
+| | ... | - dst_rloc - configured RLOC destination address. Type: string
+| | ...
+| | ... | *Return:*
+| | ... | - No value returned
+| | ...
+| | ... | *Example:*
+| | ...
+| | ... | \| Send packet and verify LISP encap \| ${nodes['TG']} \| 10.0.0.1 \
+| | ... | \| 32.0.0.1 \| eth2 \| 08:00:27:ee:fd:b3 \| 08:00:27:a2:52:5b \
+| | ... | \| eth3 \| 08:00:27:4d:ca:7a \| 08:00:27:7d:fd:10 \| 10.0.1.1 \
+| | ... | \| 10.0.1.2 \|
+| | ...
+| | [Arguments] | ${tg_node} | ${src_ip} | ${dst_ip} | ${tx_src_port}
+| | ... | ${tx_src_mac} | ${tx_dst_mac} | ${rx_port} | ${rx_src_mac}
+| | ... | ${rx_dst_mac} | ${src_rloc} | ${dst_rloc}
+| | ...
+| | ${tx_port_name}= | Get interface name | ${tg_node} | ${tx_src_port}
+| | ${rx_port_name}= | Get interface name | ${tg_node} | ${rx_port}
+| | ${args}= | Catenate | --tg_src_mac | ${tx_src_mac} | --tg_dst_mac
+| | ... | ${rx_dst_mac} | --dut_if1_mac | ${tx_dst_mac} | --dut_if2_mac
+| | ... | ${rx_src_mac} | --src_ip | ${src_ip} | --dst_ip | ${dst_ip}
+| | ... | --tx_if | ${tx_port_name} | --rx_if | ${rx_port_name}
+| | ... | --src_rloc | ${src_rloc} | --dst_rloc | ${dst_rloc}
+| | Run Traffic Script On Node | lisp/lisp_check.py | ${tg_node}
+| | ... | ${args}
+
+| LISP Functional Traffic Test Teardown
+| | [Documentation] | Teardown for LISP functional traffic test.
+| | Show Packet Trace on all DUTs | ${nodes}
+| | VPP Show LISP EID Table | ${node}
+| | Disable LISP | ${node}
diff --git a/resources/libraries/robot/honeycomb/lisp_gpe.robot b/resources/libraries/robot/honeycomb/lisp_gpe.robot
new file mode 100644 (file)
index 0000000..2b265c8
--- /dev/null
@@ -0,0 +1,252 @@
+# Copyright (c) 2017 Cisco and/or its affiliates.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at:
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+*** Settings ***
+| Library | resources.libraries.python.honeycomb.Lisp.LispGPEKeywords
+| Library | resources.libraries.python.LispUtil
+| Documentation | Keywords used to test Honeycomb Lisp GPE features.
+
+*** Keywords ***
+| Honeycomb enables LISP GPE
+| | [Documentation] | Uses Honeycomb API to enable LISP GPE.
+| | ...
+| | ... | *Arguments:*
+| | ... | - node - Information about a DUT node. Type: dictionary
+| | ...
+| | ... | *Example:*
+| | ...
+| | ... | \| Honeycomb enables LISP GPE \| ${nodes['DUT1']} \|
+| | ...
+| | [Arguments] | ${node}
+| | ...
+| | Set LISPGPE state | ${node} | ${TRUE}
+
+| Honeycomb disables LISP GPE
+| | [Documentation] | Uses Honeycomb API to disable LISP GPE.
+| | ...
+| | ... | *Arguments:*
+| | ... | - node - Information about a DUT node. Type: dictionary
+| | ...
+| | ... | *Example:*
+| | ...
+| | ... | \| Honeycomb disables LISP GPE \| ${nodes['DUT1']} \|
+| | ...
+| | [Arguments] | ${node}
+| | ...
+| | Set LISPGPE state | ${node} | ${FALSE}
+
+| Honeycomb adds first LISP GPE Mapping
+| | [Documentation] | Uses Honeycomb API to configure a LISP mapping. Removes
+| | ... | any existing mappings.
+| | ...
+| | ... | *Arguments:*
+| | ... | - node - Information about a DUT node. Type: dictionary
+| | ... | - data - LISP settings to use. Type: dictionary
+| | ...
+| | ... | *Example:*
+| | ...
+| | ... | \| Honeycomb adds first LISP GPE Mapping \| ${nodes['DUT1']} \
+| | ... | \| ${data} \|
+| | ...
+| | [Arguments] | ${node} | ${data}
+| | ...
+| | Configure LISPGPE Mapping | ${node} | ${data}
+
+| Honeycomb adds LISP GPE Mapping
+| | [Documentation] | Uses Honeycomb API to configure a LISP mapping.
+| | ...
+| | ... | *Arguments:*
+| | ... | - node - Information about a DUT node. Type: dictionary
+| | ... | - data - LISP settings to use. Type: dictionary
+| | ...
+| | ... | *Example:*
+| | ...
+| | ... | \| Honeycomb adds LISP GPE Mapping \| ${nodes['DUT1']} \| ${data} \|
+| | ...
+| | [Arguments] | ${node} | ${data}
+| | ...
+| | Add LISPGPE Mapping | ${node} | ${data['id']} | ${data}
+
+| Honeycomb removes LISP GPE mapping
+| | [Documentation] | Uses Honeycomb API to remove the specified mapping.
+| | ...
+| | ... | *Arguments:*
+| | ... | - node - Information about a DUT node. Type: dictionary
+| | ...
+| | ... | *Example:*
+| | ...
+| | ... | \| Honeycomb removes LISP GPE mapping \| ${nodes['DUT1']} \
+| | ... | \| map_name \|
+| | ...
+| | [Arguments] | ${node} | ${mapping}
+| | ...
+| | Delete LISPGPE mapping | ${node} | ${mapping}
+
+| LISP GPE should not be configured
+| | [Documentation] | Retrieves LISP GPE configuration from Honeycomb operational\
+| | ... | data, and expects an empty dictionary.
+| | ...
+| | ... | *Arguments:*
+| | ... | - node - Information about a DUT node. Type: dictionary
+| | ...
+| | ... | *Example:*
+| | ...
+| | ... | \| LISP GPE should not be configured \| ${nodes['DUT1']} \|
+| | ...
+| | [Arguments] | ${node}
+| | ...
+| | ${data}= | Get LISP GPE operational data | ${node}
+| | Should be Equal
+| | ... | ${data['gpe-state']['gpe-feature-data']['enable']} | ${FALSE}
+
+| LISP GPE state from Honeycomb should be
+| | [Documentation] | Retrieves LISP GPE state from Honeycomb operational\
+| | ... | data, and compares LISP state with expected value.
+| | ...
+| | ... | *Arguments:*
+| | ... | - node - Information about a DUT node. Type: dictionary
+| | ... | - state - Expected LISP state. Type: string
+| | ...
+| | ... | *Example:*
+| | ...
+| | ... | \| LISP GPE state from Honeycomb should be \| ${nodes['DUT1']} \
+| | ... | \| enabled \|
+| | ...
+| | [Arguments] | ${node} | ${state}
+| | ...
+| | ${data}= | Get LISPGPE operational data | ${node}
+| | Run keyword if | $state == 'enabled'
+| | ... | Should be equal as strings
+| | ... | ${data['gpe-state']['gpe-feature-data']['enable']} | ${True}
+| | Run keyword if | $state == 'disabled'
+| | ... | Should be equal as strings
+| | ... | ${data['gpe-state']['gpe-feature-data']['enable']} | ${False}
+
+| LISP GPE state from VAT should be
+| | [Documentation] | Retrieves LISP state from VAT,\
+| | ... | and compares LISP state with expected value.
+| | ...
+| | ... | *Arguments:*
+| | ... | - node - Information about a DUT node. Type: dictionary
+| | ... | - state - Expected LISP state. Type: string
+| | ...
+| | ... | *Example:*
+| | ...
+| | ... | \| LISP state from VAT should be \| ${nodes['DUT1']} \| enabled \|
+| | ...
+| | [Arguments] | ${node} | ${state}
+| | ...
+| | ${status}= | VPP show LISP State | ${node}
+| | Should match | ${status['gpe_status']} | ${state}
+
+| LISP GPE mapping from Honeycomb should be
+| | [Documentation] | Retrieves LISP GPE mapping from Honeycomb operational\
+| | ... | data, and compares with expected data.
+| | ...
+| | ... | *Arguments:*
+| | ... | - node - Information about a DUT node. Type: dictionary
+| | ... | - settings - Expected LISP mapping data. Type: dictionary
+| | ...
+| | ... | *Example:*
+| | ...
+| | ... | \| LISP GPE mapping from Honeycomb should be \| ${nodes['DUT1']} \
+| | ... | \| ${settings} \|
+| | ...
+| | [Arguments] | ${node} | ${settings}
+| | ...
+| | ${data}= | Get LISPGPE mapping | ${node} | ${settings['id']}
+| | Compare data structures | ${data} | ${settings}
+
+| LISP GPE mappings from Honeycomb should not exist
+| | [Documentation] | Retrieves LISP GPE mappings from operational\
+| | ... | data, and expects to find none.
+| | ...
+| | ... | *Arguments:*
+| | ... | - node - Information about a DUT node. Type: dictionary
+| | ...
+| | ... | *Example:*
+| | ...
+| | ... | \| LISP GPE mappings from Honeycomb should not exist \
+| | ... | \| ${nodes['DUT1']} \|
+| | ...
+| | [Arguments] | ${node}
+| | ...
+| | ${data}= | Get LISPGPE operational data | ${node}
+| | Variable Should Not Exist
+| | ... | ${data['gpe-state']['gpe-feature-data']['gpe-entry']}
+
+| Honeycomb disables all LISP GPE features
+| | [Documentation] | Uses Honeycomb API to remove all LISP GPE configuration.
+| | ...
+| | ... | *Arguments:*
+| | ... | - node - Information about a DUT node. Type: dictionary
+| | ...
+| | ... | *Example:*
+| | ...
+| | ... | \| Honeycomb disables all LISP GPE features \| ${nodes['DUT1']} \|
+| | ...
+| | [Arguments] | ${node}
+| | ...
+| | Disable LISPGPE | ${node}
+
+| Send packet and verify LISP GPE encap
+| | [Documentation] | Send ICMP packet to DUT out one interface and receive\
+| | ... | a LISP-GPE encapsulated packet on the other interface.
+| | ...
+| | ... | *Arguments:*
+| | ...
+| | ... | _NOTE:_ Arguments are based on topology:
+| | ...             | TG(if1)->(if1)DUT(if2)->TG(if2)
+| | ...
+| | ... | - tg_node - Node to execute scripts on (TG). Type: dictionary
+| | ... | - src_ip - IP of source interface (TG-if1). Type: string
+| | ... | - dst_ip - IP of destination interface (TG-if2). Type: string
+| | ... | - tx_src_port - Interface of TG-if1. Type: string
+| | ... | - tx_src_mac - MAC address of TG-if1. Type: string
+| | ... | - tx_dst_mac - MAC address of DUT-if1. Type: string
+| | ... | - rx_port - Interface of TG-if1. Type: string
+| | ... | - rx_src_mac - MAC address of DUT1-if2. Type: string
+| | ... | - rx_dst_mac - MAC address of TG-if2. Type: string
+| | ... | - src_rloc - configured RLOC source address. Type: string
+| | ... | - dst_rloc - configured RLOC destination address. Type: string
+| | ...
+| | ... | *Return:*
+| | ... | - No value returned
+| | ...
+| | ... | *Example:*
+| | ...
+| | ... | \| Send packet and verify LISP GPE encap \| ${nodes['TG']} \
+| | ... | \| 10.0.0.1 \| 32.0.0.1 \|
+| | ... | \| eth2 \| 08:00:27:ee:fd:b3 \| 08:00:27:a2:52:5b \
+| | ... | \| eth3 \| 08:00:27:4d:ca:7a \| 08:00:27:7d:fd:10 \
+| | ... | \| 10.0.1.1 \| 10.0.1.2 \|
+| | ...
+| | [Arguments] | ${tg_node} | ${src_ip} | ${dst_ip} | ${tx_src_port} |
+| | ... | ${tx_src_mac} | ${tx_dst_mac} | ${rx_port} | ${rx_src_mac}
+| | ... | ${rx_dst_mac} | ${src_rloc} | ${dst_rloc}
+| | ...
+| | ${tx_port_name}= | Get interface name | ${tg_node} | ${tx_src_port}
+| | ${rx_port_name}= | Get interface name | ${tg_node} | ${rx_port}
+| | ${args}= | Catenate | --tg_src_mac | ${tx_src_mac} | --tg_dst_mac
+| | ... | ${rx_dst_mac} | --dut_if1_mac | ${tx_dst_mac} | --dut_if2_mac
+| | ... | ${rx_src_mac} | --src_ip | ${src_ip} | --dst_ip | ${dst_ip}
+| | ... | --tx_if | ${tx_port_name} | --rx_if | ${rx_port_name}
+| | ... | --src_rloc | ${src_rloc} | --dst_rloc | ${dst_rloc}
+| | Run Traffic Script On Node | lisp/lispgpe_check.py | ${tg_node}
+| | ... | ${args}
+
+| LISPGPE Functional Traffic Test Teardown
+| | [Documentation] | Teardown for LISP GPE functional traffic test.
+| | Show Packet Trace on all DUTs | ${nodes}
+| | VPP Show LISP EID Table | ${node}
+| | Disable LISPGPE | ${node}
index 5dcfcc5..3a2eafa 100644 (file)
@@ -36,7 +36,7 @@
 | | ... | - No value returned
 | | ...
 | | ... | *Example:*
-| | ... | \| Configure LISP GPE topology in 3-node circular topology \| ${dut_node} \| ${adjacency} \
+| | ... | \| Configure L2 LISP on DUT \| ${dut_node} \| ${adjacency} \
 | | ... | \| ${settings} \|
 | | ...
 | | [Arguments]
index 1485a40..b858ef4 100644 (file)
@@ -82,7 +82,7 @@
 | | ... | KW locator_set data is prepared, which are expected from VPP via VAT.
 | | ...
 | | ... | *Example:*
-| | ... | \| Then LISP locator_set shpuld be configured correctly \
+| | ... | \| Then LISP locator_set should be configured correctly \
 | | ... | \| ${nodes['DUT1']} \|
 | | ...
 | | [Arguments] | ${dut_node}
index f20fd51..389b1bf 100644 (file)
@@ -42,8 +42,9 @@
 | | ... | - No value returned
 | | ...
 | | ... | *Example:*
-| | ... | \| Configure LISP topology in 3-node circular topology \| ${dut1_node} \| ${interface_name} \
-| | ... | \| None \| ${dut2_node} \| ${interface_name} \| None \
+| | ... | \| Configure LISP topology in 3-node circular topology \
+| | ... | \| ${dut1_node} \| ${interface_name} \| None \
+| | ... | \| ${dut2_node} \| ${interface_name} \| None \
 | | ... | \| ${locator_set} \| ${dut1_eid} \| ${dut2_eid} \
 | | ... | \| ${dut1_static_adjacency} \| ${dut2_static_adjacency} \|
 | | ...
diff --git a/resources/templates/honeycomb/config_lisp_gpe.url b/resources/templates/honeycomb/config_lisp_gpe.url
new file mode 100644 (file)
index 0000000..41b1ce9
--- /dev/null
@@ -0,0 +1 @@
+/restconf/config{odl_url_part}/gpe:gpe
\ No newline at end of file
diff --git a/resources/templates/honeycomb/oper_lisp_gpe.url b/resources/templates/honeycomb/oper_lisp_gpe.url
new file mode 100644 (file)
index 0000000..5af4dba
--- /dev/null
@@ -0,0 +1 @@
+/restconf/operational{odl_url_part}/gpe:gpe-state
\ No newline at end of file
similarity index 59%
rename from resources/test_data/honeycomb/lisp.py
rename to resources/test_data/honeycomb/lisp/lisp.py
index 12a6146..f5ebb16 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2016 Cisco and/or its affiliates.
+# Copyright (c) 2017 Cisco and/or its affiliates.
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at:
@@ -207,3 +207,135 @@ vat_local_vrf = {
     "eid": local_vrf_subtable["vrf-subtable"]["local-mappings"][
         "local-mapping"][0]["eid"]["ipv4"]+"/32"
 }
+
+# variables for traffic test
+dut_to_tg_if1_ip4 = "192.168.0.1"
+dut_to_tg_if2_ip4 = "192.168.1.1"
+tg_to_dut_if2_ip4 = "192.168.1.2"
+src_ip4 = "192.168.0.2"
+dst_ip4 = "192.168.2.2"
+prefix_len4 = 24
+
+local_eid4 = "192.168.0.0/24"
+remote_eid4 = "192.168.2.0/24"
+src_rloc4 = dut_to_tg_if2_ip4
+dst_rloc4 = tg_to_dut_if2_ip4
+
+lisp_traffic_table_ip4 = {
+    "virtual-network-identifier": 0,
+    "vrf-subtable": {
+        "table-id": 1,
+        "local-mappings": {
+            "local-mapping": [{
+                "id": "local_map_vrf",
+                "eid": {
+                    "virtual-network-id": 0,
+                    "address-type": "ietf-lisp-address-types:ipv4-prefix-afi",
+                    "ipv4-prefix": local_eid4
+                },
+                "locator-set": locator_set
+            }]
+        },
+        "remote-mappings": {
+            "remote-mapping": [{
+                "id": "remote_map_vrf",
+                "eid": {
+                    "virtual-network-id": 0,
+                    "address-type": "ietf-lisp-address-types:ipv4-prefix-afi",
+                    "ipv4-prefix": remote_eid4
+                },
+                "rlocs": {
+                    "locator": [{
+                        "address": tg_to_dut_if2_ip4,
+                        "priority": 1,
+                        "weight": 1
+                    }]
+                },
+                "adjacencies": {
+                    "adjacency": [{
+                        "id": "adj01",
+                        "local-eid": {
+                            "virtual-network-id": 0,
+                            "address-type":
+                                "ietf-lisp-address-types:ipv4-prefix-afi",
+                            "ipv4-prefix": local_eid4
+                        },
+                        "remote-eid": {
+                            "virtual-network-id": 0,
+                            "address-type":
+                                "ietf-lisp-address-types:ipv4-prefix-afi",
+                            "ipv4-prefix": remote_eid4
+                        },
+                    }]
+                }
+            }]
+        },
+    }
+}
+
+dut_to_tg_if1_ip6 = "10::1"
+dut_to_tg_if2_ip6 = "11::1"
+tg_to_dut_if2_ip6 = "11::2"
+src_ip6 = "10::2"
+dst_ip6 = "12::2"
+prefix_len6 = 64
+
+local_eid6 = "10::/64"
+remote_eid6 = "12::/64"
+src_rloc6 = dut_to_tg_if2_ip6
+dst_rloc6 = tg_to_dut_if2_ip6
+
+lisp_traffic_table_ip6 = {
+    "virtual-network-identifier": 0,
+    "vrf-subtable": {
+        "table-id": 1,
+        "local-mappings": {
+            "local-mapping": [{
+                "id": "local_map_vrf",
+                "eid": {
+                    "virtual-network-id": 0,
+                    "address-type": "ietf-lisp-address-types:ipv6-prefix-afi",
+                    "ipv6-prefix": local_eid6
+                },
+                "locator-set": locator_set
+            }]
+        },
+        "remote-mappings": {
+            "remote-mapping": [{
+                "id": "remote_map_vrf",
+                "eid": {
+                    "virtual-network-id": 0,
+                    "address-type": "ietf-lisp-address-types:ipv6-prefix-afi",
+                    "ipv6-prefix": remote_eid6
+                },
+                "rlocs": {
+                    "locator": [{
+                        "address": tg_to_dut_if2_ip6,
+                        "priority": 1,
+                        "weight": 1
+                    }]
+                },
+                "adjacencies": {
+                    "adjacency": [{
+                        "id": "adj01",
+                        "local-eid": {
+                            "virtual-network-id": 0,
+                            "address-type":
+                                "ietf-lisp-address-types:ipv6-prefix-afi",
+                            "ipv6-prefix": local_eid6
+                        },
+                        "remote-eid": {
+                            "virtual-network-id": 0,
+                            "address-type":
+                                "ietf-lisp-address-types:ipv6-prefix-afi",
+                            "ipv6-prefix": remote_eid6
+                        },
+                    }]
+                }
+            }]
+        },
+    }
+}
+
+lisp_traffic_ip4 = create_settings_dict(lisp_traffic_table_ip4)
+lisp_traffic_ip6 = create_settings_dict(lisp_traffic_table_ip6)
diff --git a/resources/test_data/honeycomb/lisp/lisp_gpe.py b/resources/test_data/honeycomb/lisp/lisp_gpe.py
new file mode 100644 (file)
index 0000000..45a8f1f
--- /dev/null
@@ -0,0 +1,229 @@
+# Copyright (c) 2017 Cisco and/or its affiliates.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at:
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""Test variables for LISP GPE test suite."""
+
+negative_mapping_ip4 = {
+    "id": "lispgpe_negative",
+    "dp-table": 1,
+    "vni": 0,
+    "local-eid": {
+        "address-type": "ietf-lisp-address-types:ipv4-prefix-afi",
+        "virtual-network-id": 0,
+        "ipv4-prefix": "192.168.0.0/24"
+    },
+    "remote-eid": {
+        "address-type": "ietf-lisp-address-types:ipv4-prefix-afi",
+        "virtual-network-id": 0,
+        "ipv4-prefix": "192.168.1.0/24"
+    },
+    "action": "send-map-request"
+}
+
+# used for update operation
+negative_mapping_ip4_edit = {
+    "id": "lispgpe_negative",
+    "dp-table": 1,
+    "vni": 0,
+    "local-eid": {
+        "address-type": "ietf-lisp-address-types:ipv4-prefix-afi",
+        "virtual-network-id": 0,
+        "ipv4-prefix": "192.168.2.0/24"
+    },
+    "remote-eid": {
+        "address-type": "ietf-lisp-address-types:ipv4-prefix-afi",
+        "virtual-network-id": 0,
+        "ipv4-prefix": "192.168.3.0/24"
+    },
+    "action": "send-map-request"
+}
+
+# used for multiple entries
+negative_mapping_ip4_2 = {
+    "id": "lispgpe_negative_2",
+    "dp-table": 1,
+    "vni": 0,
+    "local-eid": {
+        "address-type": "ietf-lisp-address-types:ipv4-prefix-afi",
+        "virtual-network-id": 0,
+        "ipv4-prefix": "192.168.2.0/24"
+    },
+    "remote-eid": {
+        "address-type": "ietf-lisp-address-types:ipv4-prefix-afi",
+        "virtual-network-id": 0,
+        "ipv4-prefix": "192.168.3.0/24"
+    },
+    "action": "send-map-request"
+}
+
+positive_mapping_ip4 = {
+    "id": "lispgpe_positive",
+    "dp-table": 1,
+    "vni": 0,
+    "local-eid": {
+        "address-type": "ietf-lisp-address-types:ipv4-prefix-afi",
+        "virtual-network-id": 0,
+        "ipv4-prefix": "192.168.4.0/24"
+    },
+    "remote-eid": {
+        "address-type": "ietf-lisp-address-types:ipv4-prefix-afi",
+        "virtual-network-id": 0,
+        "ipv4-prefix": "192.168.5.0/24"
+    },
+    "locator-pairs": [
+      {
+        "id": "gpe-entry-locator-1",
+        "locator-pair": {
+            "local-locator": "192.168.6.2",
+            "remote-locator": "192.168.7.3",
+            "weight": 0
+        }
+      },
+      {
+        "id": "gpe-entry-locator-2",
+        "locator-pair": {
+            "local-locator": "192.168.5.2",
+            "remote-locator": "192.168.5.3",
+            "weight": 1
+        }
+      }
+    ]
+}
+
+negative_mapping_ip6 = {
+    "id": "lispgpe_negative6",
+    "dp-table": 1,
+    "vni": 0,
+    "local-eid": {
+        "address-type": "ietf-lisp-address-types:ipv6-prefix-afi",
+        "virtual-network-id": 0,
+        "ipv6-prefix": "10::/64"
+    },
+    "remote-eid": {
+        "address-type": "ietf-lisp-address-types:ipv6-prefix-afi",
+        "virtual-network-id": 0,
+        "ipv6-prefix": "11::/64"
+    },
+    "action": "send-map-request"
+}
+
+positive_mapping_ip6 = {
+    "id": "lispgpe_positive6",
+    "dp-table": 1,
+    "vni": 0,
+    "local-eid": {
+        "address-type": "ietf-lisp-address-types:ipv6-prefix-afi",
+        "virtual-network-id": 0,
+        "ipv6-prefix": "12::/64"
+    },
+    "remote-eid": {
+        "address-type": "ietf-lisp-address-types:ipv6-prefix-afi",
+        "virtual-network-id": 0,
+        "ipv6-prefix": "13::/64"
+    },
+    "locator-pairs": [
+      {
+        "id": "gpe-entry-locator-1",
+        "locator-pair": {
+            "local-locator": "13::10",
+            "remote-locator": "13::11",
+            "weight": 0
+        }
+      },
+      {
+        "id": "gpe-entry-locator-2",
+        "locator-pair": {
+            "local-locator": "14::10",
+            "remote-locator": "14::11",
+            "weight": 1
+        }
+      }
+    ]
+}
+
+# variables for traffic test
+dut_to_tg_if1_ip4 = "192.168.0.1"
+dut_to_tg_if2_ip4 = "192.168.1.1"
+tg_to_dut_if2_ip4 = "192.168.1.2"
+src_ip4 = "192.168.0.2"
+dst_ip4 = "192.168.2.2"
+prefix_len4 = 24
+
+local_eid4 = "192.168.0.0/24"
+remote_eid4 = "192.168.2.0/24"
+src_rloc4 = dut_to_tg_if2_ip4
+dst_rloc4 = tg_to_dut_if2_ip4
+
+lisp_traffic_ip4 = {
+    "id": "lispgpe_traffic_ip4",
+    "dp-table": 0,
+    "vni": 0,
+    "local-eid": {
+        "address-type": "ietf-lisp-address-types:ipv4-prefix-afi",
+        "virtual-network-id": 0,
+        "ipv4-prefix": local_eid4
+    },
+    "remote-eid": {
+        "address-type": "ietf-lisp-address-types:ipv4-prefix-afi",
+        "virtual-network-id": 0,
+        "ipv4-prefix": remote_eid4
+    },
+    "locator-pairs": [
+      {
+        "id": "gpe-entry-locator-1",
+        "locator-pair": {
+            "local-locator": src_rloc4,
+            "remote-locator": dst_rloc4,
+            "weight": 0
+        }
+      }
+    ]
+}
+
+dut_to_tg_if1_ip6 = "10::1"
+dut_to_tg_if2_ip6 = "11::1"
+tg_to_dut_if2_ip6 = "11::2"
+src_ip6 = "10::2"
+dst_ip6 = "12::2"
+prefix_len6 = 64
+
+local_eid6 = "10::/64"
+remote_eid6 = "12::/64"
+src_rloc6 = dut_to_tg_if2_ip6
+dst_rloc6 = tg_to_dut_if2_ip6
+
+lisp_traffic_ip6 = {
+    "id": "lispgpe_traffic_ip6",
+    "dp-table": 0,
+    "vni": 0,
+    "local-eid": {
+        "address-type": "ietf-lisp-address-types:ipv6-prefix-afi",
+        "virtual-network-id": 0,
+        "ipv6-prefix": local_eid6
+    },
+    "remote-eid": {
+        "address-type": "ietf-lisp-address-types:ipv6-prefix-afi",
+        "virtual-network-id": 0,
+        "ipv6-prefix": remote_eid6
+    },
+    "locator-pairs": [
+      {
+        "id": "gpe-entry-locator-1",
+        "locator-pair": {
+            "local-locator": src_rloc6,
+            "remote-locator": dst_rloc6,
+            "weight": 0
+        }
+      }
+    ]
+}
diff --git a/resources/traffic_scripts/lisp/lisp_check.py b/resources/traffic_scripts/lisp/lisp_check.py
new file mode 100755 (executable)
index 0000000..5e1a835
--- /dev/null
@@ -0,0 +1,164 @@
+#!/usr/bin/env python
+# Copyright (c) 2017 Cisco and/or its affiliates.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at:
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""Traffic script that sends an ICMP/ICMPv6 packet out one interface, receives
+a LISP-encapsulated packet on the other interface and verifies received packet.
+"""
+
+import sys
+import ipaddress
+
+from scapy.layers.inet import ICMP, IP, UDP
+from scapy.layers.inet6 import ICMPv6EchoRequest
+from scapy.layers.inet6 import IPv6
+from scapy.layers.l2 import Ether
+from scapy.all import bind_layers, Packet
+from scapy.fields import FlagsField, BitField, IntField
+
+from resources.libraries.python.PacketVerifier import RxQueue, TxQueue
+from resources.libraries.python.TrafficScriptArg import TrafficScriptArg
+
+
+class LispHeader(Packet):
+    """Scapy header for the LISP Layer."""
+    name = "Lisp Header"
+    fields_desc = [
+        FlagsField("flags", None, 8, ["N", "L", "E", "V", "I", "", "", ""]),
+        BitField("nonce/map_version", 0, size=24),
+        IntField("instance_id/locator_status_bits", 0)]
+
+
+class LispInnerIP(IP):
+    """Scapy inner LISP layer for IPv4-in-IPv4."""
+    name = "Lisp Inner Layer - IPv4"
+
+
+class LispInnerIPv6(IPv6):
+    """Scapy inner LISP layer for IPv6-in-IPv6."""
+    name = "Lisp Inner Layer - IPv6"
+
+
+def valid_ipv4(ip):
+    try:
+        ipaddress.IPv4Address(unicode(ip))
+        return True
+    except (AttributeError, ipaddress.AddressValueError):
+        return False
+
+
+def valid_ipv6(ip):
+    try:
+        ipaddress.IPv6Address(unicode(ip))
+        return True
+    except (AttributeError, ipaddress.AddressValueError):
+        return False
+
+
+def main():
+    """Send IP ICMP packet from one traffic generator interface to the other.
+
+    :raises RuntimeError: If the received packet is not correct."""
+
+    args = TrafficScriptArg(
+        ['tg_src_mac', 'tg_dst_mac', 'src_ip', 'dst_ip', 'dut_if1_mac',
+         'dut_if2_mac', 'src_rloc', 'dst_rloc'])
+
+    tx_src_mac = args.get_arg('tg_src_mac')
+    tx_dst_mac = args.get_arg('dut_if1_mac')
+    rx_dst_mac = args.get_arg('tg_dst_mac')
+    rx_src_mac = args.get_arg('dut_if2_mac')
+    src_ip = args.get_arg('src_ip')
+    dst_ip = args.get_arg('dst_ip')
+    src_rloc = args.get_arg("src_rloc")
+    dst_rloc = args.get_arg("dst_rloc")
+    tx_if = args.get_arg('tx_if')
+    rx_if = args.get_arg('rx_if')
+
+    rxq = RxQueue(rx_if)
+    txq = TxQueue(tx_if)
+    sent_packets = []
+    pkt_raw = Ether(src=tx_src_mac, dst=tx_dst_mac)
+
+    if valid_ipv4(src_ip) and valid_ipv4(dst_ip):
+        pkt_raw /= IP(src=src_ip, dst=dst_ip)
+        pkt_raw /= ICMP()
+        ip_format = IP
+        lisp_layer = LispInnerIP
+    elif valid_ipv6(src_ip) and valid_ipv6(dst_ip):
+        pkt_raw /= IPv6(src=src_ip, dst=dst_ip)
+        pkt_raw /= ICMPv6EchoRequest()
+        ip_format = IPv6
+        lisp_layer = LispInnerIPv6
+    else:
+        raise ValueError("IP not in correct format")
+
+    bind_layers(UDP, LispHeader, dport=4341)
+    bind_layers(LispHeader, lisp_layer)
+    sent_packets.append(pkt_raw)
+    txq.send(pkt_raw)
+
+    if tx_if == rx_if:
+        ether = rxq.recv(2, ignore=sent_packets)
+    else:
+        ether = rxq.recv(2)
+
+    if ether is None:
+        raise RuntimeError("ICMP echo Rx timeout")
+
+    if rx_dst_mac == ether[Ether].dst and rx_src_mac == ether[Ether].src:
+        print("MAC addresses match.")
+    else:
+        raise RuntimeError(
+            "Matching packet unsuccessful: {0}".format(ether.__repr__()))
+
+    ip = ether.payload
+
+    if not isinstance(ip, ip_format):
+        raise RuntimeError(
+            "Not an IP packet received {0}".format(ip.__repr__()))
+
+    lisp = ether.getlayer(lisp_layer)
+    if not lisp:
+        raise RuntimeError("Lisp layer not present or parsing failed.")
+
+    # Compare data from packets
+    if src_ip == lisp.src:
+        print("Source IP matches source EID.")
+    else:
+        raise RuntimeError("Matching Src IP unsuccessful: {} != {}"
+                           .format(src_ip, lisp.src))
+
+    if dst_ip == lisp.dst:
+        print("Destination IP matches destination EID.")
+    else:
+        raise RuntimeError("Matching Dst IP unsuccessful: {} != {}"
+                           .format(dst_ip, lisp.dst))
+
+    if src_rloc == ip.src:
+        print("Source RLOC matches configuration.")
+    else:
+        raise RuntimeError("Matching Src RLOC unsuccessful: {} != {}"
+                           .format(src_rloc, ip.src))
+
+    if dst_rloc == ip.dst:
+        print("Destination RLOC matches configuration.")
+    else:
+        raise RuntimeError("Matching dst RLOC unsuccessful: {} != {}"
+                           .format(dst_rloc, ip.dst))
+
+    sys.exit(0)
+
+
+if __name__ == "__main__":
+    main()
diff --git a/resources/traffic_scripts/lisp/lispgpe_check.py b/resources/traffic_scripts/lisp/lispgpe_check.py
new file mode 100755 (executable)
index 0000000..7979b6c
--- /dev/null
@@ -0,0 +1,186 @@
+#!/usr/bin/env python
+# Copyright (c) 2017 Cisco and/or its affiliates.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at:
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""Traffic script that sends an ICMP/ICMPv6 packet out one interface, receives
+a LISPGPE-encapsulated packet on the other interface and verifies received
+packet.
+"""
+
+import sys
+import ipaddress
+
+from scapy.layers.inet import ICMP, IP, UDP
+from scapy.layers.inet6 import ICMPv6EchoRequest
+from scapy.layers.inet6 import IPv6
+from scapy.layers.l2 import Ether
+from scapy.all import bind_layers, Packet
+from scapy.fields import FlagsField, BitField, XBitField, IntField
+
+from resources.libraries.python.PacketVerifier import RxQueue, TxQueue
+from resources.libraries.python.TrafficScriptArg import TrafficScriptArg
+
+
+class LispGPEHeader(Packet):
+    """Scapy header for the Lisp GPE Layer."""
+    name = "Lisp GPE Header"
+    fields_desc = [
+        FlagsField("flags", None, 8, ["N", "L", "E", "V", "I", "P", "R", "O"]),
+        BitField("version", 0, size=2),
+        BitField("reserved", 0, size=14),
+        XBitField("next_protocol", 0, size=8),
+        IntField("instance_id/locator_status_bits", 0)]
+
+    def guess_payload_class(self, payload):
+        protocol = {
+            0x1: LispGPEInnerIP,
+            0x2: LispGPEInnerIPv6,
+            0x3: LispGPEInnerEther,
+            0x4: LispGPEInnerNSH
+        }
+        return protocol[self.next_protocol]
+
+
+class LispGPEInnerIP(IP):
+    """Scapy inner LISP GPE layer for IPv4-in-IPv4."""
+    name = "Lisp GPE Inner Layer - IPv4"
+
+
+class LispGPEInnerIPv6(IPv6):
+    """Scapy inner LISP GPE layer for IPv6-in-IPv6."""
+    name = "Lisp GPE Inner Layer - IPv6"
+
+
+class LispGPEInnerEther(Ether):
+    """Scapy inner LISP GPE layer for Lisp-L2."""
+    name = "Lisp GPE Inner Layer - Ethernet"
+
+
+class LispGPEInnerNSH(Packet):
+    """Scapy inner LISP GPE layer for Lisp-NSH.
+
+    Parsing not implemented.
+    """
+
+
+def valid_ipv4(ip):
+    try:
+        ipaddress.IPv4Address(unicode(ip))
+        return True
+    except (AttributeError, ipaddress.AddressValueError):
+        return False
+
+
+def valid_ipv6(ip):
+    try:
+        ipaddress.IPv6Address(unicode(ip))
+        return True
+    except (AttributeError, ipaddress.AddressValueError):
+        return False
+
+
+def main():
+    """Send IP ICMP packet from one traffic generator interface to the other.
+
+    :raises RuntimeError: If the received packet is not correct."""
+
+    args = TrafficScriptArg(
+        ['tg_src_mac', 'tg_dst_mac', 'src_ip', 'dst_ip', 'dut_if1_mac',
+         'dut_if2_mac', 'src_rloc', 'dst_rloc'])
+
+    tx_src_mac = args.get_arg('tg_src_mac')
+    tx_dst_mac = args.get_arg('dut_if1_mac')
+    rx_dst_mac = args.get_arg('tg_dst_mac')
+    rx_src_mac = args.get_arg('dut_if2_mac')
+    src_ip = args.get_arg('src_ip')
+    dst_ip = args.get_arg('dst_ip')
+    src_rloc = args.get_arg("src_rloc")
+    dst_rloc = args.get_arg("dst_rloc")
+    tx_if = args.get_arg('tx_if')
+    rx_if = args.get_arg('rx_if')
+
+    rxq = RxQueue(rx_if)
+    txq = TxQueue(tx_if)
+    sent_packets = []
+    pkt_raw = Ether(src=tx_src_mac, dst=tx_dst_mac)
+
+    if valid_ipv4(src_ip) and valid_ipv4(dst_ip):
+        pkt_raw /= IP(src=src_ip, dst=dst_ip)
+        pkt_raw /= ICMP()
+        ip_format = IP
+    elif valid_ipv6(src_ip) and valid_ipv6(dst_ip):
+        pkt_raw /= IPv6(src=src_ip, dst=dst_ip)
+        pkt_raw /= ICMPv6EchoRequest()
+        ip_format = IPv6
+    else:
+        raise ValueError("IP not in correct format")
+
+    bind_layers(UDP, LispGPEHeader, dport=4341)
+
+    sent_packets.append(pkt_raw)
+    txq.send(pkt_raw)
+
+    if tx_if == rx_if:
+        ether = rxq.recv(2, ignore=sent_packets)
+    else:
+        ether = rxq.recv(2)
+
+    if ether is None:
+        raise RuntimeError("ICMP echo Rx timeout")
+
+    if rx_dst_mac == ether[Ether].dst and rx_src_mac == ether[Ether].src:
+        print("MAC addresses match.")
+    else:
+        raise RuntimeError(
+            "Matching packet unsuccessful: {0}".format(ether.__repr__()))
+
+    ip = ether.payload
+
+    if not isinstance(ip, ip_format):
+        raise RuntimeError(
+            "Not an IP packet received {0}".format(ip.__repr__()))
+
+    lisp = ether.getlayer(LispGPEHeader).underlayer
+    if not lisp:
+        raise RuntimeError("Lisp layer not present or parsing failed.")
+
+    # Compare data from packets
+    if src_ip == lisp.src:
+        print("Source IP matches source EID.")
+    else:
+        raise RuntimeError("Matching Src IP unsuccessful: {} != {}"
+                           .format(src_ip, lisp.src))
+
+    if dst_ip == lisp.dst:
+        print("Destination IP matches destination EID.")
+    else:
+        raise RuntimeError("Matching Dst IP unsuccessful: {} != {}"
+                           .format(dst_ip, lisp.dst))
+
+    if src_rloc == ip.src:
+        print("Source RLOC matches configuration.")
+    else:
+        raise RuntimeError("Matching Src RLOC unsuccessful: {} != {}"
+                           .format(src_rloc, ip.src))
+
+    if dst_rloc == ip.dst:
+        print("Destination RLOC matches configuration.")
+    else:
+        raise RuntimeError("Matching dst RLOC unsuccessful: {} != {}"
+                           .format(dst_rloc, ip.dst))
+
+    sys.exit(0)
+
+
+if __name__ == "__main__":
+    main()
index ac5af9a..fa2506c 100644 (file)
 | ... | unknown-unicast-flood=${True} | arp-termination=${True}
 
 *** Settings ***
+| Library | resources.libraries.python.Trace.Trace
 | Resource | resources/libraries/robot/shared/default.robot
+| Resource | resources/libraries/robot/shared/testing_path.robot
+| Resource | resources/libraries/robot/shared/traffic.robot
 | Resource | resources/libraries/robot/honeycomb/honeycomb.robot
+| Resource | resources/libraries/robot/honeycomb/interfaces.robot
 | Resource | resources/libraries/robot/honeycomb/lisp.robot
 | Resource | resources/libraries/robot/honeycomb/bridge_domain.robot
-| Variables | resources/test_data/honeycomb/lisp.py
+| Variables | resources/test_data/honeycomb/lisp/lisp.py
 | ...
 | Documentation | *Honeycomb Lisp test suite.*
 | ...
@@ -38,9 +42,9 @@
 
 *** Test Cases ***
 | TC01: Honeycomb enables LISP feature
-| | [Documentation] | Check if Honeycomb can enable the Lisp feature.
+| | [Documentation] | Check if Honeycomb can enable the LISP feature.
 | | ...
-| | Given Lisp Should Not Be Configured | ${node}
+| | Given LISP Should Not Be Configured | ${node}
 | | When Honeycomb enables LISP | ${node}
 | | Then LISP state from Honeycomb should be | ${node} | ${state}
 | | And LISP state from VAT should be | ${node} | ${state}
@@ -53,8 +57,8 @@
 | | Then Locator Set From Honeycomb Should Be
 | | ... | ${node} | ${interface} | ${locator_set}
 
-| TC03: Honeycomb configures Lisp - remote mapping - Bridge Domain
-| | [Documentation] | Check if Honeycomb can configure a remote Lisp mapping\
+| TC03: Honeycomb configures LISP - remote mapping - Bridge Domain
+| | [Documentation] | Check if Honeycomb can configure a remote LISP mapping\
 | | ... | with a bridge domain.
 | | ...
 | | Given LISP state from Honeycomb should be | ${node} | ${state}
 | | And LISP mapping from VAT should be
 | | ... | ${node} | ${vat_remote_bd}
 
-| TC04: Honeycomb can remove Lisp mapping
-| | [Documentation] | Check if Honeycomb can remove a configured Lisp mapping.
+| TC04: Honeycomb can remove LISP mapping
+| | [Documentation] | Check if Honeycomb can remove a configured LISP mapping.
 | | ...
 | | Given LISP mapping from Honeycomb should be
 | | ... | ${node} | ${remote_bd_subtable}
 | | And LISP mapping from VAT should be
 | | ... | ${node} | ${vat_remote_bd}
-| | When Honeycomb removes all lisp mappings | ${node}
+| | When Honeycomb removes all LISP mappings | ${node}
 | | Then LISP mappings from Honeycomb should not exist
 | | ... | ${node}
 | | And LISP mappings from VAT should not exist
 | | ... | ${node}
 
-| TC05: Honeycomb configures Lisp - remote mapping - VRF
-| | [Documentation] | Check if Honeycomb can configure a remote Lisp mapping\
+| TC05: Honeycomb configures LISP - remote mapping - VRF
+| | [Documentation] | Check if Honeycomb can configure a remote LISP mapping\
 | | ... | with VRF.
 | | ...
-| | [Teardown] | Honeycomb removes all lisp mappings | ${node}
+| | [Teardown] | Honeycomb removes all LISP mappings | ${node}
 | | ...
 | | Given LISP mappings from Honeycomb should not exist
 | | ... | ${node}
 | | ... | ${node} | ${remote_vrf_subtable}
 | | And LISP mapping from VAT should be | ${node} | ${vat_remote_vrf}
 
-| TC06: Honeycomb configures Lisp - local mapping - Bridge Domain
-| | [Documentation] | Check if Honeycomb can configure a local Lisp mapping\
+| TC06: Honeycomb configures LISP - local mapping - Bridge Domain
+| | [Documentation] | Check if Honeycomb can configure a local LISP mapping\
 | | ... | with a bridge domain.
 | | ...
-| | [Teardown] | Honeycomb removes all lisp mappings | ${node}
+| | [Teardown] | Honeycomb removes all LISP mappings | ${node}
 | | ...
 | | Given Locator Set From Honeycomb Should Be
 | | ... | ${node} | ${interface} | ${locator_set}
 | | Then LISP mapping from Honeycomb should be | ${node} | ${local_bd_subtable}
 | | And LISP mapping from VAT should be | ${node} | ${vat_local_bd}
 
-| TC07: Honeycomb configures Lisp - local mapping - VRF
-| | [Documentation] | Check if Honeycomb can configure a local Lisp mapping\
+| TC07: Honeycomb configures LISP - local mapping - VRF
+| | [Documentation] | Check if Honeycomb can configure a local LISP mapping\
 | | ... | with VRF.
 | | ...
-| | [Teardown] | Honeycomb removes all lisp mappings | ${node}
+| | [Teardown] | Honeycomb removes all LISP mappings | ${node}
 | | ...
 | | Given Locator Set From Honeycomb Should Be
 | | ... | ${node} | ${interface} | ${locator_set}
 | | Then LISP mapping from Honeycomb should be | ${node} | ${local_vrf_subtable}
 | | And LISP mapping from VAT should be | ${node} | ${vat_local_vrf}
 
-| TC08: Honeycomb configures Lisp mapping with adjacency
-| | [Documentation] | Check if Honeycomb can configure local and remote Lisp\
+| TC08: Honeycomb configures LISP mapping with adjacency
+| | [Documentation] | Check if Honeycomb can configure local and remote LISP\
 | | ... | mappings with VRF, and configure adjacency.
 | | ...
-| | [Teardown] | Honeycomb removes all lisp mappings | ${node}
+| | [Teardown] | Honeycomb removes all LISP mappings | ${node}
 | | ...
 | | Given Locator Set From Honeycomb Should Be
 | | ... | ${node} | ${interface} | ${locator_set}
-| | And Honeycomb creates first l2 bridge domain
-| | ... | ${node} | ${bd2_name} | ${bd_settings}
 | | And LISP mappings from Honeycomb should not exist
 | | ... | ${node}
 | | And LISP mappings from VAT should not exist
 | | And Honeycomb adds LISP mapping | ${node} | ${lisp_settings_both_vrf}
 | | When Honeycomb adds LISP adjacency | ${node} | ${7} | remote_map_vrf
 | | ... | adj01 | ${vrf_adjacency}
-| | Then Lisp mapping from Honeycomb should be
+| | Then LISP mapping from Honeycomb should be
 | | ... | ${node} | ${adj_subtable}
 
-| TC09: Honeycomb configures Lisp Map Resolver
-| | [Documentation] | Check if Honeycomb can configure a Lisp Map Resolver.
+| TC09: Honeycomb configures LISP Map Resolver
+| | [Documentation] | Check if Honeycomb can configure a LISP Map Resolver.
 | | ...
 | | Given LISP state from Honeycomb should be | ${node} | ${state}
 | | And LISP state from VAT should be | ${node} | ${state}
-| | When Honeycomb adds Lisp Map Resolver | ${node} | ${ip_address}
+| | When Honeycomb adds LISP Map Resolver | ${node} | ${ip_address}
 | | Then Map Resolver from Honeycomb should be | ${node} | ${ip_address}
 | | And Map Resolver from VAT should be | ${node} | ${ip_address}
 
-| TC10: Honeycomb configures Lisp Map Server
-| | [Documentation] | Check if Honeycomb can configure a Lisp Map Server.
+| TC10: Honeycomb configures LISP Map Server
+| | [Documentation] | Check if Honeycomb can configure a LISP Map Server.
 | | ...
 | | Given LISP state from Honeycomb should be | ${node} | ${state}
 | | And LISP state from VAT should be | ${node} | ${state}
-| | When Honeycomb adds Lisp Map Server | ${node} | @{ip_addresses}
+| | When Honeycomb adds LISP Map Server | ${node} | @{ip_addresses}
 | | Then Map Server from Honeycomb should be | ${node} | @{ip_addresses}
 | | And Map Server from VAT should be | ${node} | @{ip_addresses}
 
-| TC11: Honeycomb configures Lisp PETR configuration
-| | [Documentation] | Check if Honeycomb can configure Lisp
+| TC11: Honeycomb configures LISP PETR configuration
+| | [Documentation] | Check if Honeycomb can configure LISP
 | | ... | PETR configuration.
 | | ...
 | | Given LISP state from Honeycomb should be | ${node} | ${state}
 | | Then PETR configuration from Honeycomb should be | ${node} | ${ip_address}
 | | And PETR configuration from VAT should be | ${node} | enabled
 
-| TC12: Honeycomb configures Lisp RLOC Probing
-| | [Documentation] | Check if Honeycomb can configure Lisp RLOC Probing.
+| TC12: Honeycomb configures LISP RLOC Probing
+| | [Documentation] | Check if Honeycomb can configure LISP RLOC Probing.
 | | ...
 | | Given LISP state from Honeycomb should be | ${node} | ${state}
 | | And LISP state from VAT should be | ${node} | ${state}
 | | Then RLOC Probing from Honeycomb should be | ${node} | ${True}
 | | And RLOC Probing from VAT should be | ${node} | enabled
 
-| TC13: Honeycomb configures Lisp Map Register
-| | [Documentation] | Check if Honeycomb can configure a Lisp Map Register.
+| TC13: Honeycomb configures LISP Map Register
+| | [Documentation] | Check if Honeycomb can configure a LISP Map Register.
 | | ...
 | | Given LISP state from Honeycomb should be | ${node} | ${state}
 | | And LISP state from VAT should be | ${node} | ${state}
-| | When Honeycomb adds Lisp Map Register | ${node} | ${True}
+| | When Honeycomb adds LISP Map Register | ${node} | ${True}
 | | Then Map Register from Honeycomb should be | ${node} | ${True}
 | | And Map Register from VAT should be | ${node} | enabled
 
-| TC14: Honeycomb enabled Lisp PITR feature
-| | [Documentation] | Check if Honeycomb can configure the Lisp PITR feature.
+| TC14: Honeycomb enabled LISP PITR feature
+| | [Documentation] | Check if Honeycomb can configure the LISP PITR feature.
 | | ...
 | | Given Locator Set From Honeycomb Should Be
 | | ... | ${node} | ${interface} | ${locator_set}
 | | Then PITR config from Honeycomb should be | ${node} | ${locator_set}
 | | And PITR config from VAT should be | ${node} | ${locator_set}
 
-| TC15: Honeycomb can remove configuration of Lisp features
-| | [Documentation] | Check if Honeycomb can disable all Lisp features.
+| TC15: Honeycomb can remove configuration of LISP features
+| | [Documentation] | Check if Honeycomb can disable all LISP features.
 | | ...
-| | Given Map resolver from Honeycomb should be | ${node} | ${ip_address}
+| | Given Map Resolver from Honeycomb should be | ${node} | ${ip_address}
 | | And PITR config from Honeycomb should be | ${node} | ${locator_set}
+| | And Map Register from Honeycomb should be | ${node} | ${True}
 | | When Honeycomb disables all LISP features | ${node}
-| | Then Lisp Should Not Be Configured | ${node}
+| | Then LISP Should Not Be Configured | ${node}
+
+| TC16: Honeycomb can configure LISP for traffic test - IPv4
+| | [Documentation]
+| | ... | [Top] TG-DUT1-TG.
+| | ... | [Enc] Eth-IPv4-LISP.
+| | ... | [Cfg] On DUT1 configure IPv4 LISP static adjacencies with TG.
+| | ... | [Ver] Make TG send ICMPv4 Echo Req between its interfaces through\
+| | ... | DUT1 and verify LISP encapsulation of received packet.
+| | ... | [Ref] RFC6830.
+| | ...
+| | [Teardown] | LISP Functional Traffic Test Teardown
+| | Given Configure path in 2-node circular topology
+| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
+| | And Honeycomb configures interface state
+| | ... | ${dut_node} | ${dut_to_tg_if1} | up
+| | And Honeycomb configures interface state
+| | ... | ${dut_node} | ${dut_to_tg_if2} | up
+| | And Honeycomb sets interface IPv4 address with prefix | ${dut_node}
+| | ... | ${dut_to_tg_if1} | ${dut_to_tg_if1_ip4} | ${prefix_len4}
+| | And Honeycomb sets interface IPv4 address with prefix | ${dut_node}
+| | ... | ${dut_to_tg_if2} | ${dut_to_tg_if2_ip4} | ${prefix_len4}
+| | And Honeycomb adds interface IPv4 neighbor | ${dut_node} | ${dut_to_tg_if1}
+| | ... | ${src_ip4} | ${tg_to_dut_if1_mac}
+| | And Honeycomb adds interface IPv4 neighbor | ${dut_node} | ${dut_to_tg_if2}
+| | ... | ${tg_to_dut_if2_ip4} | ${tg_to_dut_if2_mac}
+| | When Honeycomb enables LISP | ${node}
+| | And Honeycomb adds locator set | ${node} | ${dut_to_tg_if2} | ${locator_set}
+| | And Honeycomb adds LISP mapping | ${node} | ${lisp_traffic_ip4}
+| | Then send packet and verify LISP encap
+| | ... | ${tg_node} | ${src_ip4} | ${dst_ip4}
+| | ... | ${tg_to_dut_if1} | ${tg_to_dut_if1_mac} | ${dut_to_tg_if1_mac}
+| | ... | ${tg_to_dut_if2} | ${dut_to_tg_if2_mac} | ${tg_to_dut_if2_mac}
+| | ... | ${src_rloc4} | ${dst_rloc4}
+
+| TC17: Honeycomb can configure LISP for traffic test - IPv6
+| | [Documentation]
+| | ... | [Top] TG-DUT1-TG.
+| | ... | [Enc] Eth-IPv6-LISP.
+| | ... | [Cfg] On DUT1 configure IPv6 LISP static adjacencies with TG.
+| | ... | [Ver] Make TG send ICMPv6 Echo Req between its interfaces through\
+| | ... | DUT1 and verify LISP encapsulation of received packet.
+| | ... | [Ref] RFC6830.
+| | ...
+| | [Teardown] | LISP Functional Traffic Test Teardown
+| | Given Configure path in 2-node circular topology
+| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
+| | And Honeycomb configures interface state
+| | ... | ${dut_node} | ${dut_to_tg_if1} | up
+| | And Honeycomb configures interface state
+| | ... | ${dut_node} | ${dut_to_tg_if2} | up
+| | And Honeycomb sets interface IPv6 address | ${dut_node}
+| | ... | ${dut_to_tg_if1} | ${dut_to_tg_if1_ip6} | ${prefix_len6}
+| | And Honeycomb sets interface IPv6 address | ${dut_node}
+| | ... | ${dut_to_tg_if2} | ${dut_to_tg_if2_ip6} | ${prefix_len6}
+| | And Honeycomb adds interface IPv6 neighbor | ${dut_node} | ${dut_to_tg_if1}
+| | ... | ${src_ip6} | ${tg_to_dut_if1_mac}
+| | And Honeycomb adds interface IPv6 neighbor | ${dut_node} | ${dut_to_tg_if2}
+| | ... | ${tg_to_dut_if2_ip6} | ${tg_to_dut_if2_mac}
+| | When Honeycomb enables LISP | ${node}
+| | And Honeycomb adds locator set | ${node} | ${dut_to_tg_if2} | ${locator_set}
+| | And Honeycomb adds LISP mapping | ${node} | ${lisp_traffic_ip6}
+| | Then send packet and verify LISP encap
+| | ... | ${tg_node} | ${src_ip6} | ${dst_ip6}
+| | ... | ${tg_to_dut_if1} | ${tg_to_dut_if1_mac} | ${dut_to_tg_if1_mac}
+| | ... | ${tg_to_dut_if2} | ${dut_to_tg_if2_mac} | ${tg_to_dut_if2_mac}
+| | ... | ${src_rloc6} | ${dst_rloc6}
 
-| TC16: Honeycomb configures Lisp Map Request Mode
-| | [Documentation] | Check if Honeycomb can configure Lisp Map Request mode.
+| TC18: Honeycomb configures LISP Map Request Mode
+| | [Documentation] | Check if Honeycomb can configure LISP Map Request mode.
 | | ... | Note: Map Request Mode cannot be removed once configured.
 | | ...
 | | [Teardown] | Honeycomb disables LISP | ${node}
 | | ...
-| | Given Honeycomb enables LISP | ${node}
-| | When Honeycomb sets Lisp Map Request Mode | ${node} | ${True}
+| | Given Honeycomb Enables LISP | ${node}
+| | When Honeycomb sets LISP Map Request Mode | ${node} | ${True}
 | | Then Map Request Mode from Honeycomb should be
 | | ... | ${node} | source-destination
 | | And Map Request Mode from VAT should be | ${node} | src-dst
diff --git a/tests/vpp/func/honeycomb/mgmt-cfg-lispgpe-apihc-apivat-func.robot b/tests/vpp/func/honeycomb/mgmt-cfg-lispgpe-apihc-apivat-func.robot
new file mode 100644 (file)
index 0000000..072d475
--- /dev/null
@@ -0,0 +1,240 @@
+# Copyright (c) 2017 Cisco and/or its affiliates.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at:
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+*** Variables***
+| ${interface}= | ${node['interfaces']['port1']['name']}
+
+*** Settings ***
+| Library | resources.libraries.python.Trace.Trace
+| Resource | resources/libraries/robot/shared/default.robot
+| Resource | resources/libraries/robot/shared/testing_path.robot
+| Resource | resources/libraries/robot/shared/traffic.robot
+| Resource | resources/libraries/robot/honeycomb/honeycomb.robot
+| Resource | resources/libraries/robot/honeycomb/interfaces.robot
+| Resource | resources/libraries/robot/honeycomb/lisp_gpe.robot
+| Variables | resources/test_data/honeycomb/lisp/lisp_gpe.py
+| ...
+| Documentation | *Honeycomb LISP GPE test suite.*
+| ...
+| Suite Setup | Set Up Honeycomb Functional Test Suite | ${node}
+| ...
+| Suite Teardown | Tear Down Honeycomb Functional Test Suite | ${node}
+| ...
+| Force Tags | HC_FUNC
+
+*** Test Cases ***
+| TC01: Honeycomb enables LISP GPE feature
+| | [Documentation] | Check if Honeycomb can enable the LISP GPE feature.
+| | ...
+| | [Tags] | HC_FUNC | test
+| | Given LISP GPE Should Not Be Configured | ${node}
+| | When Honeycomb enables LISP GPE | ${node}
+| | Then LISP GPE state from Honeycomb should be | ${node} | enabled
+| | And LISP GPE state from VAT should be | ${node} | enabled
+
+| TC02: Honeycomb disable LISP GPE feature
+| | [Documentation] | Check if Honeycomb can enable the LISP GPE feature.
+| | ...
+| | [Tags] | HC_FUNC
+| | [Teardown] | Honeycomb enables LISP GPE | ${node}
+| | Given LISP GPE state from Honeycomb should be | ${node} | enabled
+| | And LISP GPE state from VAT should be | ${node} | enabled
+| | When Honeycomb disables LISP GPE | ${node}
+| | Then LISP GPE state from Honeycomb should be | ${node} | disabled
+| | And LISP GPE state from VAT should be | ${node} | disabled
+
+| TC03: Honeycomb configures LISP GPE mapping - negative, IPv4
+| | [Documentation] | Check if Honeycomb can configure a LISP mapping\
+| | ... | with VRF.
+| | ...
+| | [Tags] | HC_FUNC
+| | Given LISP GPE mappings from Honeycomb should not exist
+| | ... | ${node}
+| | When Honeycomb adds first LISP GPE mapping
+| | ... | ${node} | ${negative_mapping_ip4}
+| | Then LISP GPE mapping from Honeycomb should be
+| | ... | ${node} | ${negative_mapping_ip4}
+
+| TC04: Honeycomb can remove LISP GPE mapping
+| | [Documentation] | Check if Honeycomb can remove a configured LISP GPE\
+| | ... | mapping.
+| | ...
+| | [Tags] | HC_FUNC
+| | Given LISP GPE mapping from Honeycomb should be
+| | ... | ${node} | ${negative_mapping_ip4}
+| | When Honeycomb removes LISP GPE mapping
+| | ... | ${node} | ${negative_mapping_ip4['id']}
+| | Then LISP GPE mappings from Honeycomb should not exist
+| | ... | ${node}
+
+| TC05: Honeycomb configures LISP GPE mapping - positive, IPv4
+| | [Documentation] | Check if Honeycomb can configure a LISP mapping\
+| | ... | with VRF.
+| | ...
+# | | [Tags] | HC_FUNC
+# Disabled due to VPP-915 - configuring positive entry crashes VPP
+| | [Teardown] | Honeycomb removes LISP GPE mapping
+| | ... | ${node} | ${positive_mapping_ip4['id']}
+| | Given LISP GPE mappings from Honeycomb should not exist
+| | ... | ${node}
+| | When Honeycomb adds first LISP GPE mapping
+| | ... | ${node} | ${positive_mapping_ip4}
+| | Then LISP GPE mapping from Honeycomb should be
+| | ... | ${node} | ${positive_mapping_ip4}
+
+| TC06: Honeycomb configures LISP GPE mapping - negative, IPv6
+| | [Documentation] | Check if Honeycomb can configure a LISP mapping\
+| | ... | with VRF.
+| | ...
+| | [Tags] | HC_FUNC
+| | [Teardown] | Honeycomb removes LISP GPE mapping
+| | ... | ${node} | ${negative_mapping_ip6['id']}
+| | Given LISP GPE mappings from Honeycomb should not exist
+| | ... | ${node}
+| | When Honeycomb adds first LISP GPE mapping
+| | ... | ${node} | ${negative_mapping_ip6}
+| | Then LISP GPE mapping from Honeycomb should be
+| | ... | ${node} | ${negative_mapping_ip6}
+
+| TC07: Honeycomb configures LISP GPE mapping - positive, IPv6
+| | [Documentation] | Check if Honeycomb can configure a LISP mapping\
+| | ... | with VRF.
+| | ...
+# | | [Tags] | HC_FUNC
+# Disabled due to VPP-915 - configuring positive entry crashes VPP
+| | [Teardown] | Honeycomb removes LISP GPE mapping
+| | ... | ${node} | ${positive_mapping_ip6['id']}
+| | Given LISP GPE mappings from Honeycomb should not exist
+| | ... | ${node}
+| | When Honeycomb adds first LISP GPE mapping
+| | ... | ${node} | ${positive_mapping_ip6}
+| | Then LISP GPE mapping from Honeycomb should be
+| | ... | ${node} | ${positive_mapping_ip6}
+
+| TC08: Honeycomb can modify existing LISP GPE mappping
+| | [Documentation] | Check if Honeycomb can modify and existing LISP GPE\
+| | ... | mapping.
+| | ...
+| | [Tags] | HC_FUNC
+| | [Teardown] | Honeycomb removes LISP GPE mapping
+| | ... | ${node} | ${negative_mapping_ip4_edit['id']}
+| | Given LISP GPE mappings from Honeycomb should not exist
+| | ... | ${node}
+| | When Honeycomb adds first LISP GPE mapping
+| | ... | ${node} | ${negative_mapping_ip4}
+| | Then LISP GPE mapping from Honeycomb should be
+| | ... | ${node} | ${negative_mapping_ip4}
+| | When Honeycomb adds first LISP GPE mapping | ${node}
+| | ... | ${negative_mapping_ip4_edit}
+| | Then LISP GPE mapping from Honeycomb should be
+| | ... | ${node} | ${negative_mapping_ip4_edit}
+
+| TC09: Honeycomb can configure multiple LISP GPE mapppings
+| | [Documentation] | Check if Honeycomb can configure multiple LISP GPE\
+| | ... | mappings at the same time.
+| | ...
+| | [Tags] | HC_FUNC
+| | [Teardown] | Run Keywords
+| | ... | Honeycomb removes LISP GPE mapping
+| | ... | ${node} | ${negative_mapping_ip4['id']}
+| | ... | AND | Honeycomb removes LISP GPE mapping
+| | ... | ${node} | ${negative_mapping_ip4_2['id']}
+| | Given LISP GPE mappings from Honeycomb should not exist
+| | ... | ${node}
+| | When Honeycomb adds first LISP GPE mapping
+| | ... | ${node} | ${negative_mapping_ip4}
+| | And Honeycomb adds LISP GPE mapping | ${node} | ${negative_mapping_ip4_2}
+| | Then LISP GPE mapping from Honeycomb should be
+| | ... | ${node} | ${negative_mapping_ip4}
+| | And LISP GPE mapping from Honeycomb should be
+| | ... | ${node} | ${negative_mapping_ip4_2}
+
+| TC10: Honeycomb can disable all LISP GPE features
+| | [Documentation] | Check if Honeycomb can disable all LISP GPE features.
+| | ...
+| | [Tags] | HC_FUNC
+| | Given Honeycomb adds first LISP GPE mapping
+| | ... | ${node} | ${negative_mapping_ip4}
+| | When Honeycomb disables all LISP GPE features | ${node}
+| | Then LISP GPE mappings from Honeycomb should not exist
+| | ... | ${node}
+| | And LISP GPE state from Honeycomb should be | ${node} | disabled
+| | And LISP GPE state from VAT should be | ${node} | disabled
+
+| TC11: Honeycomb can configure LISP GPE for traffic test - IPv4
+| | [Documentation]
+| | ... | [Top] TG-DUT1-TG.
+| | ... | [Enc] Eth-IPv4-LISPGPE-IPv4-ICMPv4
+| | ... | [Cfg] Configure IPv4 LISP static adjacencies on DUT1.
+| | ... | [Ver] Case: ip4-lispgpe-ip4 - phy2lisp
+| | ... | Make TG send ICMPv4 Echo Req between its interfaces through DUT1\
+| | ... | LISP GPE tunnel verify LISP encapsulation of received packet.
+| | ... | [Ref] RFC6830.
+| | ...
+| | [Tags] | test
+| | [Teardown] | LISPGPE functional traffic test teardown
+| | Given Configure path in 2-node circular topology
+| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
+| | And Honeycomb configures interface state
+| | ... | ${dut_node} | ${dut_to_tg_if1} | up
+| | And Honeycomb configures interface state
+| | ... | ${dut_node} | ${dut_to_tg_if2} | up
+| | And Honeycomb sets interface IPv4 address with prefix | ${dut_node}
+| | ... | ${dut_to_tg_if1} | ${dut_to_tg_if1_ip4} | ${prefix_len4}
+| | And Honeycomb sets interface IPv4 address with prefix | ${dut_node}
+| | ... | ${dut_to_tg_if2} | ${dut_to_tg_if2_ip4} | ${prefix_len4}
+| | And Honeycomb adds interface IPv4 neighbor | ${dut_node} | ${dut_to_tg_if1}
+| | ... | ${src_ip4} | ${tg_to_dut_if1_mac}
+| | And Honeycomb adds interface IPv4 neighbor | ${dut_node} | ${dut_to_tg_if2}
+| | ... | ${tg_to_dut_if2_ip4} | ${tg_to_dut_if2_mac}
+| | When Honeycomb enables LISP GPE | ${node}
+| | And Honeycomb adds LISP GPE mapping | ${node} | ${lisp_traffic_ip4}
+| | Then send packet and verify LISP GPE encap
+| | ... | ${tg_node} | ${src_ip4} | ${dst_ip4}
+| | ... | ${tg_to_dut_if1} | ${tg_to_dut_if1_mac} | ${dut_to_tg_if1_mac}
+| | ... | ${tg_to_dut_if2} | ${dut_to_tg_if2_mac} | ${tg_to_dut_if2_mac}
+| | ... | ${src_rloc4} | ${dst_rloc4}
+
+| TC12: Honeycomb can configure LISP GPE for traffic test - IPv6
+| | [Documentation]
+| | ... | [Top] TG-DUT1-TG.
+| | ... | [Enc] Eth-IPv6-LISPGPE-IPv6-ICMPv6
+| | ... | [Cfg] Configure IPv6 LISP static adjacencies on DUT1.
+| | ... | [Ver] Case: ip6-lispgpe-ip6 - phy2lisp
+| | ... | Make TG send ICMPv6 Echo Req between its interfaces through DUT1\
+| | ... | LISP GPE tunnel verify LISP encapsulation of received packet.
+| | ... | [Ref] RFC6830.
+| | ...
+| | [Tags] | test
+| | [Teardown] | LISPGPE functional traffic test teardown
+| | Given Configure path in 2-node circular topology
+| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
+| | And Honeycomb configures interface state
+| | ... | ${dut_node} | ${dut_to_tg_if1} | up
+| | And Honeycomb configures interface state
+| | ... | ${dut_node} | ${dut_to_tg_if2} | up
+| | And Honeycomb sets interface IPv6 address | ${dut_node}
+| | ... | ${dut_to_tg_if1} | ${dut_to_tg_if1_ip6} | ${prefix_len6}
+| | And Honeycomb sets interface IPv6 address | ${dut_node}
+| | ... | ${dut_to_tg_if2} | ${dut_to_tg_if2_ip6} | ${prefix_len6}
+| | And Honeycomb adds interface IPv6 neighbor | ${dut_node} | ${dut_to_tg_if1}
+| | ... | ${src_ip6} | ${tg_to_dut_if1_mac}
+| | And Honeycomb adds interface IPv6 neighbor | ${dut_node} | ${dut_to_tg_if2}
+| | ... | ${tg_to_dut_if2_ip6} | ${tg_to_dut_if2_mac}
+| | When Honeycomb enables LISP GPE | ${node}
+| | And Honeycomb adds LISP GPE mapping | ${node} | ${lisp_traffic_ip6}
+| | Then send packet and verify LISP GPE encap
+| | ... | ${tg_node} | ${src_ip6} | ${dst_ip6}
+| | ... | ${tg_to_dut_if1} | ${tg_to_dut_if1_mac} | ${dut_to_tg_if1_mac}
+| | ... | ${tg_to_dut_if2} | ${dut_to_tg_if2_mac} | ${tg_to_dut_if2_mac}
+| | ... | ${src_rloc6} | ${dst_rloc6}