diff options
author | Red_M <pooatyou.com@gmail.com> | 2018-03-30 12:08:44 +1000 |
---|---|---|
committer | Red_M <pooatyou.com@gmail.com> | 2018-03-30 12:08:44 +1000 |
commit | 45108f0650c09680d0d0b7d7d3be4eeb86b8494d (patch) | |
tree | ad5c29387b4b5bde14ad06e6bddb3feea97bc259 /tests | |
parent | dedfd4e78a28d05530c3e8e33987a399fec8b934 (diff) | |
download | pexpect-git-45108f0650c09680d0d0b7d7d3be4eeb86b8494d.tar.gz |
Bug fix unit test for SSH tunnels.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_pxssh.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/test_pxssh.py b/tests/test_pxssh.py index 0944fc5..f68a1cc 100644 --- a/tests/test_pxssh.py +++ b/tests/test_pxssh.py @@ -61,10 +61,14 @@ class PxsshTestCase(SSHTestBase): 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' + confirmation_strings = 0 + confirmation_array = ['-R 2525:localhost:22','-L 2424:localhost:22','-D 8888'] string = ssh.login('server', 'me', password='s3cret', ssh_tunnels=tunnels) - if string!=confirmation_string: - print(string) + for confirmation in confirmation_array: + if confirmation in string: + confirmation_strings+=1 + + if confirmation_strings!=3: assert False, 'String generated from tunneling is potientally incorrect.' |