From 721f39743c31003ccbdad3c27ffcc3145bfccf90 Mon Sep 17 00:00:00 2001 From: Florin Coras Date: Thu, 7 Jul 2016 23:00:04 +0200 Subject: 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 --- resources/libraries/python/LispSetup.py | 59 +++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) (limited to 'resources/libraries/python/LispSetup.py') 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): -- cgit 1.2.3-korg