diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_client.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/test_client.py b/tests/test_client.py index dae5b13a..21ecd72a 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -564,6 +564,30 @@ class SSHClientTest(ClientTest): auth_timeout=0.5, ) + @patch.object( + paramiko.Channel, + "_set_remote_channel", + lambda *args, **kwargs: time.sleep(100), + ) + 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): """ |