diff --git a/tests/test_util.py b/tests/test_util.py index e6f417d..c4ad9d8 100644 --- a/tests/test_util.py +++ b/tests/test_util.py @@ -205,7 +205,6 @@ Host * self.assertRaises(AssertionError, lambda: paramiko.util.retry_on_signal(raises_other_exception)) -<<<<<<< HEAD def test_9_proxycommand_config_equals_parsing(self): """ ProxyCommand should not split on equals signs within the value. @@ -300,3 +299,33 @@ ProxyCommand foo=bar:%h-%p paramiko.util.lookup_ssh_host_config(host, config), values ) + + def test_11_host_config_test_identityfile(self): + test_config_file = """ + +IdentityFile id_dsa0 + +Host * +IdentityFile id_dsa1 + +Host dsa2 +IdentityFile id_dsa2 + +Host dsa2* +IdentityFile id_dsa22 + """ + for host, values in { + 'foo' :{'hostname': 'foo', + 'identityfile': ['id_dsa0', 'id_dsa1']}, + 'dsa2' :{'hostname': 'dsa2', + 'identityfile': ['id_dsa0', 'id_dsa1', 'id_dsa2', 'id_dsa22']}, + 'dsa22' :{'hostname': 'dsa22', + 'identityfile': ['id_dsa0', 'id_dsa1', 'id_dsa22']} + }.items(): + + f = cStringIO.StringIO(test_config_file) + config = paramiko.util.parse_ssh_config(f) + self.assertEquals( + paramiko.util.lookup_ssh_host_config(host, config), + values + )