MCPcopy
hub / github.com/jtesta/ssh-audit / test_policy_evaluate_failing_3

Method test_policy_evaluate_failing_3

test/test_policy.py:362–377  ·  view source on GitHub ↗

Ensure that a mismatched host keys results in a failure

(self)

Source from the content-addressed store, hash-verified

360
361
362 def test_policy_evaluate_failing_3(self):
363 '''Ensure that a mismatched host keys results in a failure'''
364
365 policy_data = '''name = "Test Policy"
366version = 1
367compressions = comp_alg1, comp_alg2
368host keys = XXXmismatchedXXX, key_alg1, key_alg2
369key exchanges = kex_alg1, kex_alg2
370ciphers = cipher_alg1, cipher_alg2, cipher_alg3
371macs = mac_alg1, mac_alg2, mac_alg3'''
372
373 policy = self.Policy(policy_data=policy_data)
374 ret, errors, error_str = policy.evaluate('SSH Server 1.0', self._get_kex())
375 assert ret is False
376 assert len(errors) == 1
377 assert error_str.find('Host keys did not match.') != -1
378
379
380 def test_policy_evaluate_failing_4(self):

Callers

nothing calls this directly

Calls 2

evaluateMethod · 0.95
_get_kexMethod · 0.95

Tested by

no test coverage detected