Skip to content

Commit

Permalink
fixup: more comments!
Browse files Browse the repository at this point in the history
  • Loading branch information
kgiusti committed Oct 25, 2023
1 parent 22fb5dc commit 049b644
Showing 1 changed file with 24 additions and 7 deletions.
31 changes: 24 additions & 7 deletions tests/system_tests_tcp_adaptor.py
Original file line number Diff line number Diff line change
Expand Up @@ -2231,8 +2231,10 @@ def setUpClass(cls):

def test_invalid_egress_client_request_encaps(self):
"""
Simulate an invalid message arriving at the egress connector. Verify
the message is RELEASED and an error has been logged.
Simulate an message with an incompatible ecapsulation sent by a client
that arrives at the egress connector. Verify that the egress connector
RELEASED the message and an error has been logged. The message should
be released so it can be delivered to another (compatible) connector.
"""

# send a request message with an incompatible encapsulation
Expand All @@ -2249,8 +2251,11 @@ def test_invalid_egress_client_request_encaps(self):

def test_invalid_ingress_server_reply_encaps(self):
"""
Simulate an invalid reply message arriving at the ingress listener. Verify
the message is RELEASED and an error has been logged.
Simulate an invalid reply message arriving at the ingress
listener. Verify the message is REJECTED and an error has been
logged. The message is rejected because the link is a reply-to stream
with a unique address for the client - it cannot be redelivered to
another client.
"""

# send a reply message with an incompatible encapsulation
Expand All @@ -2268,8 +2273,11 @@ def test_invalid_ingress_server_reply_encaps(self):

def test_invalid_ingress_server_reply_body(self):
"""
Simulate an invalid reply message arriving at the ingress listener. Verify
the message is RELEASED and an error has been logged.
Simulate a reply message arriving at the ingress listener that has an
invalid body structure. The client should close the connection and set
the outcome to ACCEPTED. The reason REJECTED is not used is because
data may already have been sent to the TCP client and it is too late to
reject the message.
"""

# send a reply message with an incompatible body format
Expand All @@ -2287,6 +2295,11 @@ def test_invalid_ingress_server_reply_body(self):


class InvalidClientSendRequest(MessagingHandler):
"""
Builds a legacy TCP adaptor client request message with an incompatible
encapsulation format. Expect the TCP adaptor connector to release the
message so it can be re-delivered to another (compatible) connector.
"""
def __init__(self, msg, address, destination):
super(InvalidClientSendRequest, self).__init__(auto_settle=False)
self.msg = msg
Expand Down Expand Up @@ -2331,6 +2344,10 @@ def run(self):


class InvalidServerSendReply(MessagingHandler):
"""
Simulate a TCP adaptor reply message that is invalid. Expect the client
(egress) to ignore the message and set its disposition to dispo.
"""
def __init__(self, msg, server_address, listener_address, service_address, dispo):
super(InvalidServerSendReply, self).__init__(auto_settle=False)
self.msg = msg
Expand All @@ -2353,7 +2370,7 @@ def __init__(self, msg, server_address, listener_address, service_address, dispo
self.request_dlv = None
self.dlv_drain_timer = None

# fack tcp client, just sends a request message
# fake tcp client, just sends a request message
self.listener_address = listener_address
self.client_conn = None
self.client_sent = False
Expand Down

0 comments on commit 049b644

Please sign in to comment.