summaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorIlija Lazoroski <ilija.la@live.com>2022-08-31 17:59:54 +0200
committerMike Salvatore <mike.s.salvatore@gmail.com>2023-03-02 13:30:04 -0500
commitcac71338bdf3f3a97a976942198ab7c3b6912615 (patch)
tree6b5528eec7649ebd9bf6d742570fe4e42eb31f66 /tests
parent32a3d33ca1c2d385954304a7a87186f574c780cc (diff)
Test configurable channel timeout
Diffstat (limited to 'tests')
-rw-r--r--tests/test_client.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/test_client.py b/tests/test_client.py
index dae5b13a..7b77ef49 100644
--- a/tests/test_client.py
+++ b/tests/test_client.py
@@ -564,6 +564,25 @@ class SSHClientTest(ClientTest):
auth_timeout=0.5,
)
+ def _mock_set_remote_channel(self, chainid, init_window, max_packet_size):
+ time.sleep(100)
+
+ @patch.object(paramiko.Channel, "_set_remote_channel", _mock_set_remote_channel)
+ def test_channel_timeout(self):
+ """
+ verify that the SSHClient has a configurable channel timeout
+ """
+ threading.Thread(target=self._run).start()
+ # Client setup
+ self.tc = SSHClient()
+ self.tc.set_missing_host_key_policy(paramiko.AutoAddPolicy())
+
+ # Actual connection
+ self.tc.connect(**dict(self.connect_kwargs, password="pygmalion", channel_timeout=0.5))
+ self.event.wait(1.0)
+
+ self.assertRaises(paramiko.SSHException, self.tc.open_sftp)
+
@requires_gss_auth
def test_auth_trickledown_gsskex(self):
"""