summaryrefslogtreecommitdiffstats
path: root/test/test_gbp.py
diff options
context:
space:
mode:
authorFilip Varga <fivarga@cisco.com>2019-04-15 18:52:43 +0200
committerOle Trøan <otroan@employees.org>2019-04-23 11:25:29 +0000
commitbed1421b9f1b3643d93384084972337b596aec73 (patch)
tree6eb17ac0099cedfe32d7ce35953042401a8e8bf4 /test/test_gbp.py
parente8e950a1c207339e215a29bff777b7e03f0b6765 (diff)
NAT: VPP-1531 api cleanup & update
Change-Id: I519d7efc8ee3c86381d96be2e2a46017cd948895 Signed-off-by: Filip Varga <fivarga@cisco.com>
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,