aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/python/LispUtil.py
diff options
context:
space:
mode:
authorAndrej Kozemcak <akozemca@cisco.com>2016-05-26 15:35:02 +0200
committerMatej Klotton <mklotton@cisco.com>2016-06-17 13:56:56 +0000
commit628d2d69244c571403981db5f4ded5ac5288e8b5 (patch)
treee15a749d8e0521d64182c31cab6e963c9ea082cd /resources/libraries/python/LispUtil.py
parentc85a2d27d7d08dde04c6d37b239f4ae17a2fee87 (diff)
Lisp enable/disable test
Test lisp enable/disable API. Test disable lisp, re-enable it and check if everthing is still working. Enable lisp before every lisp API test Reformat source data Change-Id: I7bace01535562814d85d7b5f6035436d583abf53 Signed-off-by: Andrej Kozemcak <akozemca@cisco.com>
Diffstat (limited to 'resources/libraries/python/LispUtil.py')
-rw-r--r--resources/libraries/python/LispUtil.py71
1 files changed, 15 insertions, 56 deletions
diff --git a/resources/libraries/python/LispUtil.py b/resources/libraries/python/LispUtil.py
index 17a46cd49c..219d2c7680 100644
--- a/resources/libraries/python/LispUtil.py
+++ b/resources/libraries/python/LispUtil.py
@@ -25,6 +25,21 @@ class LispUtil(object):
pass
@staticmethod
+ def vpp_show_lisp_state(node):
+ """Get lisp state from VPP node.
+
+ :param node: VPP node.
+ :type node: dict
+ :return: Lisp gpe state.
+ :rtype: list
+ """
+
+ vat = VatExecutor()
+ vat.execute_script_json_out('lisp/show_lisp_enable_disable.vat',
+ node)
+ return JsonParser().parse_data(vat.get_script_stdout())
+
+ @staticmethod
def vpp_show_lisp_locator_set(node):
"""Get lisp locator_set from VPP node.
@@ -191,62 +206,6 @@ class LispUtil(object):
loc_type = {'reset': locator_set_list}
return loc_type
- @staticmethod
- def generate_lisp_local_eid_data(ipv4_num, ipv6_num):
- """Generate a list of lisp local eid we want set to VPP and
- then check if is set correct.
-
- :param ipv4_num: Generate n ipv4 eid address.
- :param ipv6_num: Generate n ipv6 eid address.
- :type ipv4_num: str
- :type ipv6_num: str
- :return: list of lisp local eid.
- :rtype: list
- """
-
- eid_table = []
- for num in range(0, int(ipv4_num)):
- addrr = '192.168.{}.1'.format(num)
- eid = {'eid address': addrr,
- 'eid prefix len': 24,
- 'locator-set': 'ls1'}
- eid_table.append(eid)
-
- for num in range(0, int(ipv6_num)):
- addrr = '10:{}::1'.format(num + 1)
- eid = {'eid address': addrr,
- 'eid prefix len': 32,
- 'locator-set': 'ls1'}
- eid_table.append(eid)
-
- return eid_table
-
- @staticmethod
- def generate_lisp_map_resolver_data(ipv4_num, ipv6_num):
- """Generate a list of lisp map resolvers we want set to VPP and
- then check if is set correct.
-
- :param ipv4_num: Generate n ipv4 map resolver address.
- :param ipv6_num: Generate n ipv6 map resolver address.
- :type ipv4_num: str
- :type ipv6_num: str
- :return: list of lisp map resolver.
- :rtype: list
- """
-
- map_resolver = []
- for i in range(0, int(ipv4_num)):
- addr = '192.169.{}.1'.format(i)
- resolver = {'map resolver': addr}
- map_resolver.append(resolver)
-
- for i in range(0, int(ipv6_num)):
- addr = '12:{}::1'.format(i + 1)
- resolver = {'map resolver': addr}
- map_resolver.append(resolver)
-
- return map_resolver
-
def lisp_is_empty(self, lisp_params):
"""Check if the input param are empty.