summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorSteven Luong <sluong@cisco.com>2024-07-08 11:21:23 -0700
committerFlorin Coras <florin.coras@gmail.com>2024-07-15 20:57:35 +0000
commit67bae20b05cb46e5f6d19afeaf1f7a52a5309d59 (patch)
tree2c05544136add3eeb35e29228a6ca30bc8d064e4 /test
parentca2f2e1ec9131c01b340381f2cbbac2bc5951566 (diff)
session: application namespace may reference a deleted vrf table
lock the vrf table when adding an application namespace and unlock the vrf table when deleting an application namespace. Free the session table when no more application namespace uses it anymore to avoid memory leaks. Type: fix Change-Id: I10422c9a3b549bd4403962c925e29dd61a058eb0 Signed-off-by: Steven Luong <sluong@cisco.com>
Diffstat (limited to 'test')
-rw-r--r--test/asf/test_quic.py12
-rw-r--r--test/asf/test_session.py8
-rw-r--r--test/asf/test_tcp.py6
-rw-r--r--test/asf/test_tls.py6
-rw-r--r--test/asf/test_vcl.py40
-rw-r--r--test/test_udp.py8
6 files changed, 80 insertions, 0 deletions
diff --git a/test/asf/test_quic.py b/test/asf/test_quic.py
index e453bd5b3e5..c4fa6912114 100644
--- a/test/asf/test_quic.py
+++ b/test/asf/test_quic.py
@@ -117,6 +117,18 @@ class QUICTestCase(VppAsfTestCase):
self.logger.debug(self.vapi.cli("show ip fib"))
def tearDown(self):
+ self.vapi.app_namespace_add_del_v4(
+ is_add=0,
+ namespace_id=self.server_appns,
+ secret=self.server_appns_secret,
+ sw_if_index=self.loop0.sw_if_index,
+ )
+ self.vapi.app_namespace_add_del_v4(
+ is_add=0,
+ namespace_id=self.client_appns,
+ secret=self.client_appns_secret,
+ sw_if_index=self.loop1.sw_if_index,
+ )
# Delete inter-table routes
self.ip_t01.remove_vpp_config()
self.ip_t10.remove_vpp_config()
diff --git a/test/asf/test_session.py b/test/asf/test_session.py
index 741773d6989..184ec4fba54 100644
--- a/test/asf/test_session.py
+++ b/test/asf/test_session.py
@@ -60,6 +60,14 @@ class TestSession(VppAsfTestCase):
i.set_table_ip4(0)
i.admin_down()
+ # Unconfigure namespaces - remove our locks to the vrf tables
+ self.vapi.app_namespace_add_del_v4(
+ is_add=0, namespace_id="0", sw_if_index=self.loop0.sw_if_index
+ )
+ self.vapi.app_namespace_add_del_v4(
+ is_add=0, namespace_id="1", sw_if_index=self.loop1.sw_if_index
+ )
+
super(TestSession, self).tearDown()
self.vapi.session_enable_disable(is_enable=1)
diff --git a/test/asf/test_tcp.py b/test/asf/test_tcp.py
index 3edcd718b00..23772d34c76 100644
--- a/test/asf/test_tcp.py
+++ b/test/asf/test_tcp.py
@@ -48,6 +48,12 @@ class TestTCP(VppAsfTestCase):
)
def tearDown(self):
+ self.vapi.app_namespace_add_del_v4(
+ is_add=0, namespace_id="0", sw_if_index=self.loop0.sw_if_index
+ )
+ self.vapi.app_namespace_add_del_v4(
+ is_add=0, namespace_id="1", sw_if_index=self.loop1.sw_if_index
+ )
for i in self.lo_interfaces:
i.unconfig_ip4()
i.set_table_ip4(0)
diff --git a/test/asf/test_tls.py b/test/asf/test_tls.py
index d2d1d9a4747..2ce87143339 100644
--- a/test/asf/test_tls.py
+++ b/test/asf/test_tls.py
@@ -91,6 +91,12 @@ class TestTLS(VppAsfTestCase):
)
def tearDown(self):
+ self.vapi.app_namespace_add_del_v4(
+ is_add=0, namespace_id="0", sw_if_index=self.loop0.sw_if_index
+ )
+ self.vapi.app_namespace_add_del_v4(
+ is_add=0, namespace_id="1", sw_if_index=self.loop1.sw_if_index
+ )
for i in self.lo_interfaces:
i.unconfig_ip4()
i.set_table_ip4(0)
diff --git a/test/asf/test_vcl.py b/test/asf/test_vcl.py
index a0141be80b2..a186c6fe8c5 100644
--- a/test/asf/test_vcl.py
+++ b/test/asf/test_vcl.py
@@ -189,6 +189,12 @@ class VCLTestCase(VppAsfTestCase):
self.logger.debug(self.vapi.cli("show ip fib"))
def thru_host_stack_tear_down(self):
+ self.vapi.app_namespace_add_del_v4(
+ is_add=0, namespace_id="1", secret=1234, sw_if_index=self.loop0.sw_if_index
+ )
+ self.vapi.app_namespace_add_del_v4(
+ is_add=0, namespace_id="2", secret=5678, sw_if_index=self.loop1.sw_if_index
+ )
for i in self.lo_interfaces:
i.unconfig_ip4()
i.set_table_ip4(0)
@@ -240,6 +246,12 @@ class VCLTestCase(VppAsfTestCase):
self.logger.debug(self.vapi.cli("show ip6 fib"))
def thru_host_stack_ipv6_tear_down(self):
+ self.vapi.app_namespace_add_del_v4(
+ is_add=0, namespace_id="1", secret=1234, sw_if_index=self.loop0.sw_if_index
+ )
+ self.vapi.app_namespace_add_del_v4(
+ is_add=0, namespace_id="2", secret=5678, sw_if_index=self.loop1.sw_if_index
+ )
for i in self.lo_interfaces:
i.unconfig_ip6()
i.set_table_ip6(0)
@@ -994,6 +1006,34 @@ class LDPThruHostStackIperf(VCLTestCase):
iperf3, self.server_iperf3_args, iperf3, self.client_iperf3_args
)
+
+class LDPThruHostStackIperfMss(VCLTestCase):
+ """LDP Thru Host Stack Iperf with MSS"""
+
+ @classmethod
+ def setUpClass(cls):
+ super(LDPThruHostStackIperfMss, cls).setUpClass()
+
+ @classmethod
+ def tearDownClass(cls):
+ super(LDPThruHostStackIperfMss, cls).tearDownClass()
+
+ def setUp(self):
+ super(LDPThruHostStackIperfMss, self).setUp()
+
+ self.thru_host_stack_setup()
+ self.client_iperf3_timeout = 20
+ self.client_iperf3_args = ["-4", "-t 2", "-c", self.loop0.local_ip4]
+ self.server_iperf3_args = ["-4", "-s"]
+
+ def tearDown(self):
+ self.thru_host_stack_tear_down()
+ super(LDPThruHostStackIperfMss, self).tearDown()
+
+ def show_commands_at_teardown(self):
+ self.logger.debug(self.vapi.cli("show session verbose 2"))
+ self.logger.debug(self.vapi.cli("show app mq"))
+
@unittest.skipUnless(_have_iperf3, "'%s' not found, Skipping.")
def test_ldp_thru_host_stack_iperf3_mss(self):
"""run LDP thru host stack iperf3 test with mss option"""
diff --git a/test/test_udp.py b/test/test_udp.py
index edcd293197f..2c0710ba2e2 100644
--- a/test/test_udp.py
+++ b/test/test_udp.py
@@ -725,6 +725,14 @@ class TestUDP(VppTestCase):
i.unconfig_ip4()
i.set_table_ip4(0)
i.admin_down()
+ # Unconfigure namespaces - remove our locks to the vrf tables
+ self.vapi.app_namespace_add_del_v4(
+ is_add=0, namespace_id="0", sw_if_index=self.loop0.sw_if_index
+ )
+ self.vapi.app_namespace_add_del_v4(
+ is_add=0, namespace_id="1", sw_if_index=self.loop1.sw_if_index
+ )
+
self.vapi.session_enable_disable(is_enable=0)
super(TestUDP, self).tearDown()