diff options
author | Andrej Kozemcak <akozemca@cisco.com> | 2016-05-04 15:39:38 +0200 |
---|---|---|
committer | Andrej Kozemcak <akozemca@cisco.com> | 2016-06-01 10:18:36 +0200 |
commit | deb6fdb6a59f5c02b8cacaa9c0e6043562e53646 (patch) | |
tree | 3d926de02f37f00cc100c46b4b277115cc2becb2 /resources/libraries/python/LispSetup.py | |
parent | 38b0e2f738a81decc9d32e4d6cac678506fd090b (diff) |
CSIT-125: Add test for lisp remote static mapping
Test Lisp functionality and rename lisp file
Testing this topology:
- IPv4 lisp topology
- IPv6 lisp topology
- IPv4 over IPv6
- IPv6 over IPv4
Change-Id: Ie3439ca802f1c8ae82a1dfcfdebe579f9dc47089
Signed-off-by: Andrej Kozemcak <akozemca@cisco.com>
Diffstat (limited to 'resources/libraries/python/LispSetup.py')
-rw-r--r-- | resources/libraries/python/LispSetup.py | 103 |
1 files changed, 102 insertions, 1 deletions
diff --git a/resources/libraries/python/LispSetup.py b/resources/libraries/python/LispSetup.py index e0c86aae51..88fcfacda6 100644 --- a/resources/libraries/python/LispSetup.py +++ b/resources/libraries/python/LispSetup.py @@ -17,6 +17,94 @@ from resources.libraries.python.topology import NodeType from resources.libraries.python.VatExecutor import VatExecutor +class Lisp(object): + """Class for lisp API.""" + + def __init__(self): + pass + + @staticmethod + def vpp_lisp_enable_disable(node, state): + """Enable/Disable lisp in the VPP node in topology. + + :param node: Node of the test topology. + :param state: State of the lisp, enable or disable. + :type node: dict + :type state: str + """ + + VatExecutor.cmd_from_template(node, + 'lisp/lisp.vat', + state=state) + + +class LispRemoteMapping(object): + """Class for lisp remote mapping API.""" + + def __init__(self): + pass + + @staticmethod + def vpp_add_lisp_remote_mapping(node, vni, deid, deid_prefix, seid, + seid_prefix, rloc): + """Add lisp remote mapping on the VPP node in topology. + + :param node: VPP node. + :param vni: Vni. + :param deid: Destination eid address. + :param deid_predix: Destination eid address prefix_len. + :param seid: Source eid address. + :param seid_prefix: Source eid address prefix_len. + :param rloc: Receiver locator. + :type node: dict + :type vni: int + :type deid: str + :type deid_prefix: int + :type seid: str + :type seid_prefix: int + :type rloc: str + """ + + VatExecutor.cmd_from_template(node, + 'lisp/add_lisp_remote_mapping.vat', + vni=vni, + deid=deid, + deid_prefix=deid_prefix, + seid=seid, + seid_prefix=seid_prefix, + rloc=rloc) + + @staticmethod + def vpp_del_lisp_remote_mapping(node, vni, deid, deid_prefix, seid, + seid_prefix, rloc): + """Delete lisp remote mapping on the VPP node in topology. + + :param node: VPP node. + :param vni: Vni. + :param deid: Destination eid address. + :param deid_predix: Destination eid address prefix_len. + :param seid: Source eid address. + :param seid_prefix: Source eid address prefix_len. + :param rloc: Receiver locator. + :type node: dict + :type vni: int + :type deid: str + :type deid_prefix: int + :type seid: str + :type seid_prefix: int + :type rloc: str + """ + + VatExecutor.cmd_from_template(node, + 'lisp/del_lisp_remote_mapping.vat', + vni=vni, + deid=deid, + deid_predix=deid_prefix, + seid=seid, + seid_prefix=seid_prefix, + rloc=rloc) + + class LispGpeIface(object): """Class for Lisp gpe interface API.""" @@ -28,7 +116,7 @@ class LispGpeIface(object): """Set lisp gpe interface up or down on the VPP node in topology. :param node: VPP node. - :param state: State of the gpe iface, up or down + :param state: State of the gpe iface, up or down. :type node: dict :type state: str """ @@ -406,3 +494,16 @@ class LispSetup(object): lgi = LispGpeIface() lgi.vpp_lisp_gpe_iface(node, state) + + @staticmethod + def vpp_lisp_state(node, state): + """Enable/Disable lisp on VPP node in topology. + + :param node: VPP node. + :param state: State of the lisp, enable or disable + :type node: dict + :type state: str + """ + + lgi = Lisp() + lgi.vpp_lisp_enable_disable(node, state) |