diff options
author | Jeff Forcier <jeff@bitprophet.org> | 2016-04-25 18:44:59 -0700 |
---|---|---|
committer | Jeff Forcier <jeff@bitprophet.org> | 2016-04-25 18:44:59 -0700 |
commit | e9cc18a3986de129b7efc54c1edfd19bad218798 (patch) | |
tree | 1b3179a56ac40b152395582f150814444d58df8d /tests/test_util.py | |
parent | 09b38a4ebdb6d70377794a4da55db5d1775e7078 (diff) | |
parent | 8a89fb0e2924e8f5c3ed31ddcd0cc0ee1337dd57 (diff) |
Merge branch '1.17'
Diffstat (limited to 'tests/test_util.py')
-rw-r--r-- | tests/test_util.py | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/test_util.py b/tests/test_util.py index a6a2c30b..e25f0563 100644 --- a/tests/test_util.py +++ b/tests/test_util.py @@ -485,3 +485,33 @@ Host proxycommand-with-equals-none paramiko.util.lookup_ssh_host_config(host, config), values ) + + def test_proxycommand_none_masking(self): + # Re: https://github.com/paramiko/paramiko/issues/670 + source_config = """ +Host specific-host + ProxyCommand none + +Host other-host + ProxyCommand other-proxy + +Host * + ProxyCommand default-proxy +""" + config = paramiko.SSHConfig() + config.parse(StringIO(source_config)) + # When bug is present, the full stripping-out of specific-host's + # ProxyCommand means it actually appears to pick up the default + # ProxyCommand value instead, due to cascading. It should (for + # backwards compatibility reasons in 1.x/2.x) appear completely blank, + # as if the host had no ProxyCommand whatsoever. + # Threw another unrelated host in there just for sanity reasons. + self.assertFalse('proxycommand' in config.lookup('specific-host')) + self.assertEqual( + config.lookup('other-host')['proxycommand'], + 'other-proxy' + ) + self.assertEqual( + config.lookup('some-random-host')['proxycommand'], + 'default-proxy' + ) |