1
0

test_key.py 828 B

1234567891011121314151617181920212223242526272829
  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. import pytest
  8. @pytest.mark.windows_whitelisted
  9. class KeyModuleTest(ModuleCase):
  10. def test_key_finger(self):
  11. '''
  12. test key.finger to ensure we receive a valid fingerprint
  13. '''
  14. out = self.run_function('key.finger')
  15. match = re.match("([0-9a-z]{2}:){15,}[0-9a-z]{2}$", out)
  16. self.assertTrue(match)
  17. def test_key_finger_master(self):
  18. '''
  19. test key.finger_master to ensure we receive a valid fingerprint
  20. '''
  21. out = self.run_function('key.finger_master')
  22. match = re.match("([0-9a-z]{2}:){15,}[0-9a-z]{2}$", out)
  23. self.assertTrue(match)