summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorFilip Varga <fivarga@cisco.com>2022-02-15 11:56:07 -0800
committerOle Tr�an <otroan@employees.org>2022-04-01 13:26:04 +0000
commitb68108203a59e12f4b4435caba164072e234f0aa (patch)
treeebac2dec7f66f76c3de2f37b5d65aebb949ed124 /test
parent9a485d01fae0d17da5dbdba264f5f7fd104e3a1a (diff)
nat: nat44-ed cleanup & fixes
Set deprecated option on unsupported API calls. Cleaned up API calls with deprecated option. Removed in progress option from long term used API calls. Removed obsolete/unused nodes, functions, variables. Fixed set frame queue nelts function. Calling API would incorrectly not fail even though frame queue nelts can only be set before first call nat44_plugin_enable. Moved all formatting functions to _format.c file. Type: refactor Change-Id: I3ca16e0568f8d7eee3a27c3620ca36164833a7e4 Signed-off-by: Filip Varga <fivarga@cisco.com>
Diffstat (limited to 'test')
-rw-r--r--test/test_dslite.py8
-rw-r--r--test/test_nat44_ed.py25
-rw-r--r--test/test_nat44_ed_output.py9
3 files changed, 19 insertions, 23 deletions
diff --git a/test/test_dslite.py b/test/test_dslite.py
index 8f5995e61fa..912ae17da58 100644
--- a/test/test_dslite.py
+++ b/test/test_dslite.py
@@ -90,9 +90,6 @@ class TestDSlite(VppTestCase):
def test_dslite(self):
""" Test DS-Lite """
- nat_config = self.vapi.nat_show_config()
- self.assertEqual(0, nat_config.dslite_ce)
-
self.vapi.dslite_add_del_pool_addr_range(start_addr=self.nat_addr,
end_addr=self.nat_addr,
is_add=1)
@@ -265,11 +262,6 @@ class TestDSliteCE(VppTestCase):
def test_dslite_ce(self):
""" Test DS-Lite CE """
-
- # TODO: add message to retrieve dslite config
- # nat_config = self.vapi.nat_show_config()
- # self.assertEqual(1, nat_config.dslite_ce)
-
b4_ip4 = '192.0.0.2'
b4_ip6 = '2001:db8:62aa::375e:f4c1:1'
self.vapi.dslite_set_b4_addr(ip4_addr=b4_ip4, ip6_addr=b4_ip6)
diff --git a/test/test_nat44_ed.py b/test/test_nat44_ed.py
index b761213d52b..f172dabe98b 100644
--- a/test/test_nat44_ed.py
+++ b/test/test_nat44_ed.py
@@ -1201,8 +1201,9 @@ class TestNAT44ED(VppTestCase):
self.vapi.nat44_forwarding_enable_disable(enable=1)
self.nat_add_address(self.nat_addr)
- self.vapi.nat44_interface_add_del_output_feature(
- sw_if_index=self.pg1.sw_if_index, is_add=1,)
+ self.vapi.nat44_ed_add_del_output_interface(
+ sw_if_index=self.pg1.sw_if_index,
+ is_add=1)
# session initiated from service host - translate
pkts = self.create_stream_in(self.pg0, self.pg1)
@@ -1274,8 +1275,9 @@ class TestNAT44ED(VppTestCase):
self.nat_add_address(self.nat_addr)
self.nat_add_outside_interface(self.pg0)
- self.vapi.nat44_interface_add_del_output_feature(
- sw_if_index=self.pg1.sw_if_index, is_add=1)
+ self.vapi.nat44_ed_add_del_output_interface(
+ sw_if_index=self.pg1.sw_if_index,
+ is_add=1)
# in2out
pkts = self.create_stream_in(self.pg0, self.pg1)
@@ -1790,7 +1792,7 @@ class TestNAT44ED(VppTestCase):
self.nat_add_address(self.nat_addr)
flags = self.config_flags.NAT_IS_INSIDE
- self.vapi.nat44_interface_add_del_output_feature(
+ self.vapi.nat44_ed_add_del_output_interface(
sw_if_index=self.pg1.sw_if_index,
is_add=1)
self.vapi.nat44_interface_add_del_feature(
@@ -2519,9 +2521,9 @@ class TestNAT44EDMW(TestNAT44ED):
def test_show_max_translations(self):
""" NAT44ED API test - max translations per thread """
- nat_config = self.vapi.nat_show_config_2()
+ config = self.vapi.nat44_show_running_config()
self.assertEqual(self.max_sessions,
- nat_config.max_translations_per_thread)
+ config.sessions)
def test_lru_cleanup(self):
""" NAT44ED LRU cleanup algorithm """
@@ -3252,7 +3254,8 @@ class TestNAT44EDMW(TestNAT44ED):
def test_tcp_close(self):
""" NAT44ED Close TCP session from inside network - output feature """
- old_timeouts = self.vapi.nat_get_timeouts()
+ config = self.vapi.nat44_show_running_config()
+ old_timeouts = config.timeouts
new_transitory = 2
self.vapi.nat_set_timeouts(
udp=old_timeouts.udp,
@@ -3802,9 +3805,9 @@ class TestNAT44EDMW(TestNAT44ED):
new_vrf_id = 22
self.nat_add_address(self.nat_addr)
- self.vapi.nat44_interface_add_del_output_feature(
- sw_if_index=self.pg8.sw_if_index, is_add=1)
-
+ self.vapi.nat44_ed_add_del_output_interface(
+ sw_if_index=self.pg8.sw_if_index,
+ is_add=1)
try:
self.configure_ip4_interface(self.pg7, table_id=new_vrf_id)
self.configure_ip4_interface(self.pg8, table_id=new_vrf_id)
diff --git a/test/test_nat44_ed_output.py b/test/test_nat44_ed_output.py
index ea5c14e7064..4ea8a5b5eda 100644
--- a/test/test_nat44_ed_output.py
+++ b/test/test_nat44_ed_output.py
@@ -56,7 +56,8 @@ class TestNAT44EDOutput(VppTestCase):
def test_static_dynamic(self):
""" Create static mapping which matches existing dynamic mapping """
- old_timeouts = self.vapi.nat_get_timeouts()
+ config = self.vapi.nat44_show_running_config()
+ old_timeouts = config.timeouts
new_transitory = 2
self.vapi.nat_set_timeouts(
udp=old_timeouts.udp,
@@ -80,9 +81,9 @@ class TestNAT44EDOutput(VppTestCase):
self.vapi.nat44_interface_add_del_feature(
sw_if_index=self.pg0.sw_if_index,
flags=VppEnum.vl_api_nat_config_flags_t.NAT_IS_INSIDE, is_add=1)
- self.vapi.nat44_interface_add_del_output_feature(
- is_add=1,
- sw_if_index=self.pg1.sw_if_index)
+ self.vapi.nat44_ed_add_del_output_interface(
+ sw_if_index=self.pg1.sw_if_index,
+ is_add=1)
thread_index = get_nat44_ed_in2out_worker_index(
local_host, self.vpp_worker_count)