aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/vxlan
diff options
context:
space:
mode:
authorPaul Vinciguerra <pvinci@vinciconsulting.com>2021-04-25 21:50:38 -0400
committerOle Tr�an <otroan@employees.org>2021-04-26 06:05:52 +0000
commitdc22c839f09f45899b955484dc6488569b94862f (patch)
treeb2eb32d3223d77fae2f0ea917f7fecd769d4f898 /src/vnet/vxlan
parent9f299030fd1214eb1fc076cf0c7f44559a7c8f6b (diff)
tests: clean up gbp calls from vpp_papi_provider
Move info from vpp_papi_provider to .api/vpp_objects Change-Id: Iaf46483fda2840dfec8d37e0b9262e1c9912be59 Type: test Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
Diffstat (limited to 'src/vnet/vxlan')
-rw-r--r--src/vnet/vxlan/test/vpp_vxlan_gbp_tunnel.py40
1 files changed, 16 insertions, 24 deletions
diff --git a/src/vnet/vxlan/test/vpp_vxlan_gbp_tunnel.py b/src/vnet/vxlan/test/vpp_vxlan_gbp_tunnel.py
index 22555858d12..0898bd9f810 100644
--- a/src/vnet/vxlan/test/vpp_vxlan_gbp_tunnel.py
+++ b/src/vnet/vxlan/test/vpp_vxlan_gbp_tunnel.py
@@ -38,39 +38,31 @@ class VppVxlanGbpTunnel(VppInterface):
else:
self.mode = mode
+ def encode(self):
+ return {
+ 'src': self.src,
+ 'dst': self.dst,
+ 'mode': self.mode,
+ 'vni': self.vni,
+ 'mcast_sw_if_index': self.mcast_itf.sw_if_index
+ if self.mcast_itf else INDEX_INVALID,
+ 'encap_table_id': self.encap_table_id,
+ 'instance': self.instance,
+ }
+
def add_vpp_config(self):
- mcast_sw_if_index = INDEX_INVALID
- if (self.mcast_itf):
- mcast_sw_if_index = self.mcast_itf.sw_if_index
reply = self.test.vapi.vxlan_gbp_tunnel_add_del(
is_add=1,
- tunnel={
- 'src': self.src,
- 'dst': self.dst,
- 'mode': self.mode,
- 'vni': self.vni,
- 'mcast_sw_if_index': mcast_sw_if_index,
- 'encap_table_id': self.encap_table_id,
- 'instance': self.instance
- })
+ tunnel=self.encode(),
+ )
self.set_sw_if_index(reply.sw_if_index)
self._test.registry.register(self, self._test.logger)
def remove_vpp_config(self):
- mcast_sw_if_index = INDEX_INVALID
- if (self.mcast_itf):
- mcast_sw_if_index = self.mcast_itf.sw_if_index
self.test.vapi.vxlan_gbp_tunnel_add_del(
is_add=0,
- tunnel={
- 'src': self.src,
- 'dst': self.dst,
- 'mode': self.mode,
- 'vni': self.vni,
- 'mcast_sw_if_index': mcast_sw_if_index,
- 'encap_table_id': self.encap_table_id,
- 'instance': self.instance,
- })
+ tunnel=self.encode(),
+ )
def query_vpp_config(self):
return (INDEX_INVALID != find_vxlan_gbp_tunnel(self._test,