X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=test%2Fvpp_papi_provider.py;h=8153e0316070fb79062a7e35ffb8d27d6c5a65aa;hb=91afaab068e4f3452eda35053959a9015ae1d0d0;hp=370758764dfafa4e941142101cb83ade9be840e2;hpb=b6a47953973f7c94239c394b649100e91bdb2152;p=vpp.git diff --git a/test/vpp_papi_provider.py b/test/vpp_papi_provider.py index 370758764df..8153e031607 100644 --- a/test/vpp_papi_provider.py +++ b/test/vpp_papi_provider.py @@ -6,22 +6,19 @@ from collections import deque from six import moves from hook import Hook +from vpp_l2 import L2_PORT_TYPE # Sphinx creates auto-generated documentation by importing the python source # files and collecting the docstrings from them. The NO_VPP_PAPI flag allows # the vpp_papi_provider.py file to be importable without having to build # the whole vpp api if the user only wishes to generate the test documentation. -do_import = True -try: - no_vpp_papi = os.getenv("NO_VPP_PAPI") - if no_vpp_papi == "1": - do_import = False -except: - pass -if do_import: +try: from vpp_papi import VPP - from vpp_l2 import L2_PORT_TYPE +except ImportError: + if not os.getenv("NO_VPP_PAPI") == 1: + raise + pass # from vnet/vnet/mpls/mpls_types.h MPLS_IETF_MAX_LABEL = 0xfffff @@ -3348,7 +3345,9 @@ class VppPapiProvider(object): is_tunnel=1, is_tunnel_ipv6=0, is_add=1, - udp_encap=0): + udp_encap=0, + use_anti_replay=0, + use_extended_sequence_number=0): """ IPSEC SA add/del :param sad_id: security association ID :param spi: security param index of the SA in decimal @@ -3381,7 +3380,9 @@ class VppPapiProvider(object): 'is_add': is_add, 'is_tunnel': is_tunnel, 'is_tunnel_ipv6': is_tunnel_ipv6, - 'udp_encap': udp_encap}) + 'udp_encap': udp_encap, + 'use_extended_sequence_number': use_extended_sequence_number, + 'use_anti_replay': use_anti_replay}) def ipsec_spd_add_del_entry(self, spd_id, @@ -3796,10 +3797,7 @@ class VppPapiProvider(object): 'sw_if_index': sw_if_index, 'n_srcs': len(saddrs), 'saddrs': saddrs, - 'gaddr': - { - 'address': gaddr - } + 'gaddr': gaddr } }) @@ -4067,10 +4065,8 @@ class VppPapiProvider(object): :param max_msg_size: maximum message length (Default value = 480) """ return self.api(self.papi.syslog_set_sender, - {'collector_address': { - 'address': collector}, - 'src_address': { - 'address': src}, + {'collector_address': collector, + 'src_address': src, 'collector_port': collector_port, 'vrf_id': vrf_id, 'max_msg_size': max_msg_size})