aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/python
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2016-07-07 23:00:04 +0200
committerFlorin Coras <fcoras@cisco.com>2016-07-25 18:18:27 +0200
commit721f39743c31003ccbdad3c27ffcc3145bfccf90 (patch)
tree19b8e2c18278f4356af2e16612683a774335a8f4 /resources/libraries/python
parentfc88af0ead3ca2a47cb47509383e5d21b438a77f (diff)
CSIT-199: Use static adjacencies in LISP dp tests
Switch to using static adjacencies and remote mappings instead of only the latter in LISP data plane tests. Change-Id: Ia2a05165425ac68fa7839f9c8f402033b8274fcf Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'resources/libraries/python')
-rw-r--r--resources/libraries/python/LispSetup.py59
-rw-r--r--resources/libraries/python/LispUtil.py2
2 files changed, 60 insertions, 1 deletions
diff --git a/resources/libraries/python/LispSetup.py b/resources/libraries/python/LispSetup.py
index 82e1a9787a..13d0501abb 100644
--- a/resources/libraries/python/LispSetup.py
+++ b/resources/libraries/python/LispSetup.py
@@ -103,6 +103,65 @@ class LispRemoteMapping(object):
seid=seid,
seid_prefix=seid_prefix,
rloc=rloc)
+class LispAdjacency(object):
+ """Class for lisp adjacency API."""
+
+ def __init__(self):
+ pass
+
+ @staticmethod
+ def vpp_add_lisp_adjacency(node, vni, deid, deid_prefix, seid,
+ seid_prefix):
+ """Add lisp adjacency 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.
+ :type node: dict
+ :type vni: int
+ :type deid: str
+ :type deid_prefix: int
+ :type seid: str
+ :type seid_prefix: int
+ """
+
+ VatExecutor.cmd_from_template(node,
+ 'lisp/add_lisp_adjacency.vat',
+ vni=vni,
+ deid=deid,
+ deid_prefix=deid_prefix,
+ seid=seid,
+ seid_prefix=seid_prefix)
+
+ @staticmethod
+ def vpp_del_lisp_adjacency(node, vni, deid, deid_prefix, seid,
+ seid_prefix):
+ """Delete lisp adjacency 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.
+ :type node: dict
+ :type vni: int
+ :type deid: str
+ :type deid_prefix: int
+ :type seid: str
+ :type seid_prefix: int
+ """
+
+ VatExecutor.cmd_from_template(node,
+ 'lisp/del_lisp_adjacency.vat',
+ vni=vni,
+ deid=deid,
+ deid_predix=deid_prefix,
+ seid=seid,
+ seid_prefix=seid_prefix)
class LispGpeIface(object):
diff --git a/resources/libraries/python/LispUtil.py b/resources/libraries/python/LispUtil.py
index b21e1ae511..157702ade0 100644
--- a/resources/libraries/python/LispUtil.py
+++ b/resources/libraries/python/LispUtil.py
@@ -101,7 +101,7 @@ class LispUtil(object):
for tmp in lisp_val1:
if tmp not in lisp_val2:
- raise RuntimeError('Value {} is not find in vpp:\n'
+ raise RuntimeError('Value {} not found in vpp:\n'
'{}'.format(tmp, lisp_val2))
def lisp_locator_s_should_be_equal(self, locator_set1, locator_set2):