diff options
author | Red_M <pooatyou.com@gmail.com> | 2018-03-30 11:43:58 +1000 |
---|---|---|
committer | Red_M <pooatyou.com@gmail.com> | 2018-03-30 11:43:58 +1000 |
commit | d26602d553dcbba3da03a5e99924b590bbcb5c54 (patch) | |
tree | 780f7e813e233990335f07f095246261b1160f1e /tests | |
parent | dfce37eb26fa49d1fd9abce16f8d3139941592c0 (diff) | |
download | pexpect-git-d26602d553dcbba3da03a5e99924b590bbcb5c54.tar.gz |
Fix bug with dynamic SSH tunnels.
Add basic test for SSH tunneling, this can be expanded on with a proper SSH server to test the tunnels over, however this should be good enough for now.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_pxssh.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/test_pxssh.py b/tests/test_pxssh.py index 3b3e50b..c89aa98 100644 --- a/tests/test_pxssh.py +++ b/tests/test_pxssh.py @@ -56,6 +56,15 @@ class PxsshTestCase(SSHTestBase): pass else: assert False, 'should have raised exception, pxssh.ExceptionPxssh' + + def test_ssh_tunnel_string(self): + ssh = pxssh.pxssh(debug_tunnel_command=True) + tunnels = { 'local': ['2424:localhost:22'],'remote': ['2525:localhost:22'], + 'dynamic': [8888] } + confirmation_string = 'ssh -q -R 2525:localhost:22 -L 2424:localhost:22 -D 8888 -l me server' + string = ssh.login('server', 'me', password='s3cret', ssh_tunnels=tunnels) + if string!=confirmation_string: + raise False, 'String generated from tunneling is potientally incorrect.' if __name__ == '__main__': |