summaryrefslogtreecommitdiffstats
path: root/test/test_map.py
diff options
context:
space:
mode:
authorOle Troan <ot@cisco.com>2019-02-28 20:20:47 +0100
committerPaul Vinciguerra <pvinci@vinciconsulting.com>2019-03-04 14:31:08 +0000
commitf159f58dbfc85f616b029c36196961915d7e52d2 (patch)
tree979f191da4b816aa7cb1accc4a79bcdf9c563c46 /test/test_map.py
parent84b83776d3843b5eaf50dbd40007987d77ad2490 (diff)
test framework: add factory function and default parameters
This is the first step to be able to remove all the API message wrappers in vpp_papi_provider.py. This allows to remove all functions that do not override parameters (different from zero), and a separate dictionary for messages requiring different defaults. The general requirement is that all new tests should use named arguments directly. Not positional arguments through the wrapper. Note when removing functions, the calls in vpp_papi_provider wrappers do not necessarily follow message order. Change-Id: If64916c07f8622c138db3a9d7c4a98b93a058e68 Signed-off-by: Ole Troan <ot@cisco.com>
Diffstat (limited to 'test/test_map.py')
-rw-r--r--test/test_map.py22
1 files changed, 15 insertions, 7 deletions
diff --git a/test/test_map.py b/test/test_map.py
index 70d9fa08b28..952a737c1ac 100644
--- a/test/test_map.py
+++ b/test/test_map.py
@@ -77,10 +77,12 @@ class TestMAP(VppTestCase):
map_dst = '2001::/64'
map_src = '3000::1/128'
client_pfx = '192.168.0.0/16'
- self.vapi.map_add_domain(map_dst, map_src, client_pfx)
+ self.vapi.map_add_domain(map_dst, client_pfx, map_src)
# Enable MAP on interface.
- self.vapi.map_if_enable_disable(1, self.pg0.sw_if_index, 0)
+ self.vapi.map_if_enable_disable(is_enable=1,
+ sw_if_index=self.pg0.sw_if_index,
+ is_translation=0)
# Ensure MAP doesn't steal all packets!
v4 = (Ether(dst=self.pg0.local_mac, src=self.pg0.remote_mac) /
@@ -104,7 +106,9 @@ class TestMAP(VppTestCase):
self.send_and_assert_encapped(v4, "3000::1", "2001::c0a8:0:0")
# Enable MAP on interface.
- self.vapi.map_if_enable_disable(1, self.pg1.sw_if_index, 0)
+ self.vapi.map_if_enable_disable(is_enable=1,
+ sw_if_index=self.pg1.sw_if_index,
+ is_translation=0)
# Ensure MAP doesn't steal all packets
v6 = (Ether(dst=self.pg1.local_mac, src=self.pg1.remote_mac) /
@@ -198,12 +202,16 @@ class TestMAP(VppTestCase):
map_src = '1234:5678:90ab:cdef::/64'
ip4_pfx = '192.168.0.0/24'
- self.vapi.map_add_domain(map_dst, map_src, ip4_pfx,
- 16, 6, 4)
+ self.vapi.map_add_domain(map_dst, ip4_pfx, map_src,
+ 16, 6, 4, mtu=1500)
# Enable MAP-T on interfaces.
- self.vapi.map_if_enable_disable(1, self.pg0.sw_if_index, 1)
- self.vapi.map_if_enable_disable(1, self.pg1.sw_if_index, 1)
+ self.vapi.map_if_enable_disable(is_enable=1,
+ sw_if_index=self.pg0.sw_if_index,
+ is_translation=1)
+ self.vapi.map_if_enable_disable(is_enable=1,
+ sw_if_index=self.pg1.sw_if_index,
+ is_translation=1)
# Ensure MAP doesn't steal all packets!
v4 = (Ether(dst=self.pg0.local_mac, src=self.pg0.remote_mac) /