aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/python
diff options
context:
space:
mode:
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):