aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_gbp.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_gbp.py')
-rw-r--r--test/test_gbp.py34
1 files changed, 17 insertions, 17 deletions
diff --git a/test/test_gbp.py b/test/test_gbp.py
index 44a9b396730..cc38bc9c1ce 100644
--- a/test/test_gbp.py
+++ b/test/test_gbp.py
@@ -575,6 +575,10 @@ class VppGbpAcl(VppObject):
class TestGBP(VppTestCase):
""" GBP Test Case """
+ @property
+ def config_flags(self):
+ return VppEnum.vl_api_nat_config_flags_t
+
@classmethod
def setUpClass(cls):
super(TestGBP, cls).setUpClass()
@@ -795,12 +799,11 @@ class TestGBP(VppTestCase):
self.router_mac.packed)
# The BVIs are NAT inside interfaces
+ flags = self.config_flags.NAT_IS_INSIDE
self.vapi.nat44_interface_add_del_feature(epg.bvi.sw_if_index,
- is_inside=1,
- is_add=1)
+ flags=flags)
self.vapi.nat66_add_del_interface(epg.bvi.sw_if_index,
- is_inside=1,
- is_add=1)
+ flags=flags)
if_ip4 = VppIpInterfaceAddress(self, epg.bvi, epg.bvi_ip4, 32)
if_ip6 = VppIpInterfaceAddress(self, epg.bvi, epg.bvi_ip6, 128)
@@ -832,13 +835,9 @@ class TestGBP(VppTestCase):
recirc.epg.rd.t6).add_vpp_config()
self.vapi.nat44_interface_add_del_feature(
- recirc.recirc.sw_if_index,
- is_inside=0,
- is_add=1)
+ recirc.recirc.sw_if_index)
self.vapi.nat66_add_del_interface(
- recirc.recirc.sw_if_index,
- is_inside=0,
- is_add=1)
+ recirc.recirc.sw_if_index)
recirc.add_vpp_config()
@@ -858,10 +857,11 @@ class TestGBP(VppTestCase):
for (ip, fip) in zip(ep.ips, ep.fips):
# Add static mappings for each EP from the 10/8 to 11/8 network
if ip.af == AF_INET:
+ flags = self.config_flags.NAT_IS_ADDR_ONLY
self.vapi.nat44_add_del_static_mapping(ip.bytes,
fip.bytes,
vrf_id=0,
- addr_only=1)
+ flags=flags)
else:
self.vapi.nat66_add_del_static_mapping(ip.bytes,
fip.bytes,
@@ -1404,11 +1404,12 @@ class TestGBP(VppTestCase):
#
for ep in eps:
# del static mappings for each EP from the 10/8 to 11/8 network
+ flags = self.config_flags.NAT_IS_ADDR_ONLY
self.vapi.nat44_add_del_static_mapping(ep.ip4.bytes,
ep.fip4.bytes,
vrf_id=0,
- addr_only=1,
- is_add=0)
+ is_add=0,
+ flags=flags)
self.vapi.nat66_add_del_static_mapping(ep.ip6.bytes,
ep.fip6.bytes,
vrf_id=0,
@@ -1417,21 +1418,20 @@ class TestGBP(VppTestCase):
for epg in epgs:
# IP config on the BVI interfaces
if epg != epgs[0] and epg != epgs[3]:
+ flags = self.config_flags.NAT_IS_INSIDE
self.vapi.nat44_interface_add_del_feature(epg.bvi.sw_if_index,
- is_inside=1,
+ flags=flags,
is_add=0)
self.vapi.nat66_add_del_interface(epg.bvi.sw_if_index,
- is_inside=1,
+ flags=flags,
is_add=0)
for recirc in recircs:
self.vapi.nat44_interface_add_del_feature(
recirc.recirc.sw_if_index,
- is_inside=0,
is_add=0)
self.vapi.nat66_add_del_interface(
recirc.recirc.sw_if_index,
- is_inside=0,
is_add=0)
def wait_for_ep_timeout(self, sw_if_index=None, ip=None, mac=None,