api: API trace improvements
[vpp.git] / test / vpp_papi_provider.py
index 4b58d6c..7e87b2c 100644 (file)
@@ -35,7 +35,6 @@ defaultmapping = {
     'bridge_domain_add_del': {'flood': 1, 'uu_flood': 1, 'forward': 1,
                               'learn': 1, 'is_add': 1, },
     'bvi_delete': {},
-    'gbp_subnet_add_del': {'sw_if_index': 4294967295, 'epg_id': 65535, },
     'geneve_add_del_tunnel': {'mcast_sw_if_index': 4294967295, 'is_add': 1,
                               'decap_next_index': 4294967295, },
     'input_acl_set_interface': {'ip4_table_index': 4294967295,
@@ -150,21 +149,25 @@ class VppPapiProvider(object):
         return self
 
     def assert_negative_api_retval(self):
-        """ Expect API failure - used with with, e.g.:
-            with self.vapi.assert_negative_api_retval():
-                self.vapi.<api call expected to fail>
+        """ Expect API failure - used with with, e.g.::
+
+                with self.vapi.assert_negative_api_retval():
+                    self.vapi.<api call expected to fail>
+
+            ..
         """
         self._expect_stack.append(self._expect_api_retval)
         self._expect_api_retval = self._negative
         return self
 
     def assert_zero_api_retval(self):
-        """ Expect API success - used with with, e.g.:
-            with self.vapi.assert_negative_api_retval():
-                self.vapi.<api call expected to succeed>
+        """ Expect API success - used with with, e.g.::
+
+                with self.vapi.assert_negative_api_retval():
+                    self.vapi.<api call expected to succeed>
 
-            note: this is useful only inside another with block
-                  as success is the default expected value
+            :note: this is useful only inside another with block
+                 as success is the default expected value
         """
         self._expect_stack.append(self._expect_api_retval)
         self._expect_api_retval = self._zero
@@ -844,7 +847,7 @@ class VppPapiProvider(object):
 
         :param spd_id - SPD ID to be created in the vpp . mandatory
         :param is_add - create (1) or delete(0) SPD (Default 1 - add) .
-              optional
+        optional
         :returns: reply from the API
         """
         return self.api(
@@ -895,11 +898,12 @@ class VppPapiProvider(object):
                                 is_ip_any=0):
         """ IPSEC policy SPD add/del   -
                     Wrapper to configure ipsec SPD policy entries in VPP
+
         :param spd_id: SPD ID for the policy
         :param local_address_start: local-ip-range start address
-        :param local_address_stop : local-ip-range stop address
+        :param local_address_stop: local-ip-range stop address
         :param remote_address_start: remote-ip-range start address
-        :param remote_address_stop : remote-ip-range stop address
+        :param remote_address_stop: remote-ip-range stop address
         :param local_port_start: (Default value = 0)
         :param local_port_stop: (Default value = 65535)
         :param remote_port_start: (Default value = 0)
@@ -907,10 +911,10 @@ class VppPapiProvider(object):
         :param protocol: Any(0), AH(51) & ESP(50) protocol (Default value = 0)
         :param sa_id: Security Association ID for mapping it to SPD
         :param policy: bypass(0), discard(1), resolve(2) or protect(3) action
-               (Default value = 0)
+            (Default value = 0)
         :param priority: value for the spd action (Default value = 100)
         :param is_outbound: flag for inbound(0) or outbound(1)
-               (Default value = 1)
+            (Default value = 1)
         :param is_add: (Default value = 1)
         """
         return self.api(
@@ -993,136 +997,18 @@ class VppPapiProvider(object):
         return self.api(self.papi.punt_socket_deregister,
                         {'punt': reg})
 
-    def gbp_endpoint_add(self, sw_if_index, ips, mac, sclass, flags,
-                         tun_src, tun_dst):
-        """ GBP endpoint Add """
-        return self.api(self.papi.gbp_endpoint_add,
-                        {'endpoint': {
-                            'sw_if_index': sw_if_index,
-                            'ips': ips,
-                            'n_ips': len(ips),
-                            'mac': mac,
-                            'sclass': sclass,
-                            'flags': flags,
-                            'tun': {
-                                'src': tun_src,
-                                'dst': tun_dst,
-                            }}})
-
-    def gbp_endpoint_del(self, handle):
-        """ GBP endpoint Del """
-        return self.api(self.papi.gbp_endpoint_del,
-                        {'handle': handle})
-
     def gbp_endpoint_dump(self):
         """ GBP endpoint Dump """
         return self.api(self.papi.gbp_endpoint_dump, {})
 
-    def gbp_endpoint_group_add(self, vnid, sclass, bd,
-                               rd, uplink_sw_if_index,
-                               retention):
-        """ GBP endpoint group Add """
-        return self.api(self.papi.gbp_endpoint_group_add,
-                        {'epg':
-                            {
-                                'uplink_sw_if_index': uplink_sw_if_index,
-                                'bd_id': bd,
-                                'rd_id': rd,
-                                'vnid': vnid,
-                                'sclass': sclass,
-                                'retention': retention
-                            }})
-
-    def gbp_endpoint_group_del(self, sclass):
-        """ GBP endpoint group Del """
-        return self.api(self.papi.gbp_endpoint_group_del,
-                        {'sclass': sclass})
-
-    def gbp_bridge_domain_add(self, bd_id, rd_id, flags,
-                              bvi_sw_if_index,
-                              uu_fwd_sw_if_index,
-                              bm_flood_sw_if_index):
-        """ GBP bridge-domain Add """
-        return self.api(self.papi.gbp_bridge_domain_add,
-                        {'bd':
-                            {
-                                'flags': flags,
-                                'bvi_sw_if_index': bvi_sw_if_index,
-                                'uu_fwd_sw_if_index': uu_fwd_sw_if_index,
-                                'bm_flood_sw_if_index': bm_flood_sw_if_index,
-                                'bd_id': bd_id,
-                                'rd_id': rd_id
-                            }})
-
-    def gbp_bridge_domain_del(self, bd_id):
-        """ GBP bridge-domain Del """
-        return self.api(self.papi.gbp_bridge_domain_del,
-                        {'bd_id': bd_id})
-
-    def gbp_route_domain_add(self, rd_id,
-                             scope,
-                             ip4_table_id,
-                             ip6_table_id,
-                             ip4_uu_sw_if_index,
-                             ip6_uu_sw_if_index):
-        """ GBP route-domain Add """
-        return self.api(self.papi.gbp_route_domain_add,
-                        {'rd':
-                            {
-                                'scope': scope,
-                                'ip4_table_id': ip4_table_id,
-                                'ip6_table_id': ip6_table_id,
-                                'ip4_uu_sw_if_index': ip4_uu_sw_if_index,
-                                'ip6_uu_sw_if_index': ip6_uu_sw_if_index,
-                                'rd_id': rd_id
-                            }})
-
-    def gbp_route_domain_del(self, rd_id):
-        """ GBP route-domain Del """
-        return self.api(self.papi.gbp_route_domain_del,
-                        {'rd_id': rd_id})
-
-    def gbp_recirc_add_del(self, is_add, sw_if_index, sclass, is_ext):
-        """ GBP recirc Add/Del """
-        return self.api(self.papi.gbp_recirc_add_del,
-                        {'is_add': is_add,
-                         'recirc': {
-                             'is_ext': is_ext,
-                             'sw_if_index': sw_if_index,
-                             'sclass': sclass}})
-
     def gbp_recirc_dump(self):
         """ GBP recirc Dump """
         return self.api(self.papi.gbp_recirc_dump, {})
 
-    def gbp_ext_itf_add_del(self, is_add, sw_if_index, bd_id, rd_id, flags):
-        """ GBP recirc Add/Del """
-        return self.api(self.papi.gbp_ext_itf_add_del,
-                        {'is_add': is_add,
-                         'ext_itf': {
-                             'sw_if_index': sw_if_index,
-                             'bd_id': bd_id,
-                             'rd_id': rd_id,
-                             'flags': flags}})
-
     def gbp_ext_itf_dump(self):
         """ GBP recirc Dump """
         return self.api(self.papi.gbp_ext_itf_dump, {})
 
-    def gbp_subnet_add_del(self, is_add, rd_id,
-                           prefix, type,
-                           sw_if_index=0xffffffff,
-                           sclass=0xffff):
-        """ GBP Subnet Add/Del """
-        return self.api(self.papi.gbp_subnet_add_del,
-                        {'is_add': is_add,
-                         'subnet': {
-                             'type': type,
-                             'sw_if_index': sw_if_index,
-                             'sclass': sclass,
-                             'prefix': prefix,
-                             'rd_id': rd_id}})
-
     def gbp_subnet_dump(self):
         """ GBP Subnet Dump """
         return self.api(self.papi.gbp_subnet_dump, {})
@@ -1131,25 +1017,6 @@ class VppPapiProvider(object):
         """ GBP contract Dump """
         return self.api(self.papi.gbp_contract_dump, {})
 
-    def gbp_vxlan_tunnel_add(self, vni, bd_rd_id, mode, src):
-        """ GBP VXLAN tunnel add """
-        return self.api(self.papi.gbp_vxlan_tunnel_add,
-                        {
-                            'tunnel': {
-                                'vni': vni,
-                                'mode': mode,
-                                'bd_rd_id': bd_rd_id,
-                                'src': src
-                            }
-                        })
-
-    def gbp_vxlan_tunnel_del(self, vni):
-        """ GBP VXLAN tunnel del """
-        return self.api(self.papi.gbp_vxlan_tunnel_del,
-                        {
-                            'vni': vni,
-                        })
-
     def gbp_vxlan_tunnel_dump(self):
         """ GBP VXLAN tunnel add/del """
         return self.api(self.papi.gbp_vxlan_tunnel_dump, {})
@@ -1176,7 +1043,7 @@ class VppPapiProvider(object):
     def igmp_listen(self, filter, sw_if_index, saddrs, gaddr):
         """ Listen for new (S,G) on specified interface
 
-        :param enable: add/del
+        :param enable: add/delas
         :param sw_if_index: interface sw index
         :param saddr: source ip4 addr
         :param gaddr: group ip4 addr