fix ssh integration tests when echo comes in multiple tcp chunks
@@ -429,6 +429,10 @@ def test_passive_connection_receive_detects_remote_end_close(passive_sshshell_co
echo_bytes = connection.receive(timeout=0.5)
echo = echo_bytes.decode("utf-8")
print("echo = {}".format(echo))
+ if b'molerssh@' not in echo: # first we need prompt
+ echo_bytes = connection.receive(timeout=0.5) # but bytes happen to come in separate tcp chunks
+ echo = echo_bytes.decode("utf-8")
+ print("echo = {}".format(echo))
if not re.search(r'molerssh@.+exit', echo): # exit echo should be after prompt
echo2_bytes = connection.receive(timeout=0.5) # but bytes happen to come in separate tcp chunks
echo2 = echo2_bytes.decode("utf-8")
@@ -520,6 +524,10 @@ def test_passive_connection_send_detects_remote_end_closed(passive_sshshell_conn
echo_bytes = connection.receive(timeout=0.5) # ignore echo (tested elsewhere)
echo = echo_bytes.decode("utf-8")
print("echo = {}".format(echo))
+ if b'molerssh@' not in echo: # first we need prompt
+ echo_bytes = connection.receive(timeout=0.5) # but bytes happen to come in separate tcp chunks
+ echo = echo_bytes.decode("utf-8")
+ print("echo = {}".format(echo))
if not re.search(r'molerssh@.+exit', echo): # exit echo should be after prompt
echo2_bytes = connection.receive(timeout=0.5) # but bytes happen to come in separate tcp chunks
echo2 = echo2_bytes.decode("utf-8")
