diff options
author | Filip Tehlar <ftehlar@cisco.com> | 2017-01-31 10:39:16 +0100 |
---|---|---|
committer | Damjan Marion <dmarion.lists@gmail.com> | 2017-02-21 22:21:19 +0000 |
commit | 770e89e6b916319eedd91c6edf16f0d7e89f556c (patch) | |
tree | 5ccae7aaa4b00a862e2f52c9bb2fa0abe712530b /test/vpp_papi_provider.py | |
parent | 057bb8c3a4c509652457b3f679a64077a5aa8505 (diff) |
Add basic 4o4 LISP unit test
Change-Id: I2d812153d7afe7980346382b525af89b3c47e796
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Diffstat (limited to 'test/vpp_papi_provider.py')
-rw-r--r-- | test/vpp_papi_provider.py | 135 |
1 files changed, 135 insertions, 0 deletions
diff --git a/test/vpp_papi_provider.py b/test/vpp_papi_provider.py index 842c21b810b..3268042449b 100644 --- a/test/vpp_papi_provider.py +++ b/test/vpp_papi_provider.py @@ -1,4 +1,5 @@ import os +import socket import fnmatch import time from hook import Hook @@ -1301,3 +1302,137 @@ class VppPapiProvider(object): def ip_mfib_dump(self): return self.api(self.papi.ip_mfib_dump, {}) + + def lisp_enable_disable(self, is_enabled): + return self.api( + self.papi.lisp_enable_disable, + { + 'is_en': is_enabled, + }) + + def lisp_locator_set(self, + ls_name, + is_add=1): + return self.api( + self.papi.lisp_add_del_locator_set, + { + 'is_add': is_add, + 'locator_set_name': ls_name + }) + + def lisp_locator_set_dump(self): + return self.api(self.papi.lisp_locator_set_dump, {}) + + def lisp_locator(self, + ls_name, + sw_if_index, + priority=1, + weight=1, + is_add=1): + return self.api( + self.papi.lisp_add_del_locator, + { + 'is_add': is_add, + 'locator_set_name': ls_name, + 'sw_if_index': sw_if_index, + 'priority': priority, + 'weight': weight + }) + + def lisp_locator_dump(self, is_index_set, ls_name=None, ls_index=0): + return self.api( + self.papi.lisp_locator_dump, + { + 'is_index_set': is_index_set, + 'ls_name': ls_name, + 'ls_index': ls_index, + }) + + def lisp_local_mapping(self, + ls_name, + eid_type, + eid, + prefix_len, + vni=0, + key_id=0, + key="", + is_add=1): + return self.api( + self.papi.lisp_add_del_local_eid, + { + 'locator_set_name': ls_name, + 'is_add': is_add, + 'eid_type': eid_type, + 'eid': eid, + 'prefix_len': prefix_len, + 'vni': vni, + 'key_id': key_id, + 'key': key + }) + + def lisp_eid_table_dump(self, + eid_set=0, + prefix_length=0, + vni=0, + eid_type=0, + eid=None, + filter_opt=0): + return self.api( + self.papi.lisp_eid_table_dump, + { + 'eid_set': eid_set, + 'prefix_length': prefix_length, + 'vni': vni, + 'eid_type': eid_type, + 'eid': eid, + 'filter': filter_opt, + }) + + def lisp_remote_mapping(self, + eid_type, + eid, + eid_prefix_len=0, + vni=0, + rlocs=None, + rlocs_num=0, + is_src_dst=0, + is_add=1): + return self.api( + self.papi.lisp_add_del_remote_mapping, + { + 'is_add': is_add, + 'eid_type': eid_type, + 'eid': eid, + 'eid_len': eid_prefix_len, + 'rloc_num': rlocs_num, + 'rlocs': rlocs, + 'vni': vni, + 'is_src_dst': is_src_dst, + }) + + def lisp_adjacency(self, + leid, + reid, + leid_len, + reid_len, + eid_type, + is_add=1, + vni=0): + return self.api( + self.papi.lisp_add_del_adjacency, + { + 'is_add': is_add, + 'vni': vni, + 'eid_type': eid_type, + 'leid': leid, + 'reid': reid, + 'leid_len': leid_len, + 'reid_len': reid_len, + }) + + def lisp_adjacencies_get(self, vni=0): + return self.api( + self.papi.lisp_adjacencies_get, + { + 'vni': vni + }) |