1
0

test_key.py 780 B

1234567891011121314151617181920212223242526
  1. # -*- coding: utf-8 -*-
  2. # Import Python libs
  3. from __future__ import absolute_import, unicode_literals, print_function
  4. import re
  5. # Import Salt Testing libs
  6. from tests.support.case import ModuleCase
  7. class KeyModuleTest(ModuleCase):
  8. def test_key_finger(self):
  9. '''
  10. test key.finger to ensure we receive a valid fingerprint
  11. '''
  12. out = self.run_function('key.finger')
  13. match = re.match("([0-9a-z]{2}:){15,}[0-9a-z]{2}$", out)
  14. self.assertTrue(match)
  15. def test_key_finger_master(self):
  16. '''
  17. test key.finger_master to ensure we receive a valid fingerprint
  18. '''
  19. out = self.run_function('key.finger_master')
  20. match = re.match("([0-9a-z]{2}:){15,}[0-9a-z]{2}$", out)
  21. self.assertTrue(match)