Skip to content

Commit

Permalink
Fixes skupperproject#1409: port StuckDelivery and NoDelayedDelivery t…
Browse files Browse the repository at this point in the history
…ests to TCP-lite
  • Loading branch information
kgiusti committed Feb 9, 2024
1 parent cb9bd3d commit 5f791f1
Showing 1 changed file with 32 additions and 7 deletions.
39 changes: 32 additions & 7 deletions tests/system_tests_tcp_adaptor.py
Original file line number Diff line number Diff line change
Expand Up @@ -1523,13 +1523,14 @@ class TcpAdaptorStuckDeliveryTest(TestCase):
deliveries. See Dispatch-2036.
"""
@classmethod
def setUpClass(cls):
def setUpClass(cls, encap='legacy', test_name='TCPStuckDeliveryTest'):
super(TcpAdaptorStuckDeliveryTest, cls).setUpClass()

if DISABLE_SELECTOR_TESTS:
return

cls.test_name = 'TCPStuckDeliveryTest'
cls.encapsulation = encap
cls.test_name = test_name

# Topology: linear.
# tcp-client->edge1->interior1->tcp-server
Expand Down Expand Up @@ -1564,15 +1565,17 @@ def router(cls, name, mode, config):
('tcpConnector', {'host': "127.0.0.1",
'port':
cls.interior_tcp_connector_port,
'address': 'nostuck'})])
'address': 'nostuck',
'encapsulation': cls.encapsulation})])
cls.i_router.wait_ready()
cls.e_router = router(cls,
"%s_E" % cls.test_name,
"edge",
[('tcpListener', {'host': "0.0.0.0",
'port':
cls.edge_tcp_listener_port,
'address': 'nostuck'}),
'address': 'nostuck',
'encapsulation': cls.encapsulation}),
('connector', {'role': 'edge',
'port':
cls.interior_edge_listener_port})])
Expand Down Expand Up @@ -1643,6 +1646,16 @@ def test_01_ignore_stuck_deliveries(self):
"Stuck deliveries should not be logged!")


class TcpAdaptorStuckDeliveryLiteTest(TcpAdaptorStuckDeliveryTest):
"""
Verify that the routers stuck delivery detection is not applied to TCP
deliveries. See Dispatch-2036.
"""
@classmethod
def setUpClass(cls):
super(TcpAdaptorStuckDeliveryLiteTest, cls).setUpClass(encap='lite', test_name='TCPStuckDeliveryLiteTest')


class TcpAdaptorManagementTest(TestCase):
"""
Test Creation and deletion of TCP management entities
Expand Down Expand Up @@ -2635,9 +2648,10 @@ class TcpAdaptorNoDelayedDelivery(TestCase):
Ensure long lived TCP sessions are not counted as delayed deliveries
"""
@classmethod
def setUpClass(cls):
def setUpClass(cls, encap="legacy"):
super(TcpAdaptorNoDelayedDelivery, cls).setUpClass()

cls.encapsulation = encap
cls.listener_port = cls.tester.get_port()
cls.connector_port = cls.tester.get_port()
config = [
Expand All @@ -2647,10 +2661,12 @@ def setUpClass(cls):
'port': cls.tester.get_port()}),
('tcpListener', {'host': "0.0.0.0",
'port': cls.listener_port,
'address': "no/delay"}),
'address': "no/delay",
'encapsulation': cls.encapsulation}),
('tcpConnector', {'host': "127.0.0.1",
'port': cls.connector_port,
'address': "no/delay"}),
'address': "no/delay",
'encapsulation': cls.encapsulation}),
('address', {'prefix': 'closest', 'distribution': 'closest'}),
('address', {'prefix': 'multicast', 'distribution': 'multicast'}),
]
Expand Down Expand Up @@ -2720,6 +2736,15 @@ def test_01_check_delayed_deliveries(self):
f"Expected delay counter to be zero, got {counters}")


class TcpAdaptorNoDelayedDeliveryLite(TcpAdaptorNoDelayedDelivery):
"""
Ensure long lived TCP sessions are not counted as delayed deliveries
"""
@classmethod
def setUpClass(cls):
super(TcpAdaptorNoDelayedDeliveryLite, cls).setUpClass(encap='lite')


class TcpMisconfiguredLegacyLiteEncapsTest(TestCase):
"""
Ensure that the TCP adaptor can detect misconfiguration of the
Expand Down

0 comments on commit 5f791f1

Please sign in to comment.