2016-06-24 22:24:21 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
|
|
|
# Import Python libs
|
|
|
|
from __future__ import absolute_import
|
|
|
|
import re
|
|
|
|
|
|
|
|
# Import Salt Testing libs
|
2017-04-03 16:04:09 +00:00
|
|
|
from tests.support.case import ModuleCase
|
2016-06-24 22:24:21 +00:00
|
|
|
|
|
|
|
|
2017-04-03 16:04:09 +00:00
|
|
|
class KeyModuleTest(ModuleCase):
|
2016-06-24 22:24:21 +00:00
|
|
|
def test_key_finger(self):
|
|
|
|
'''
|
|
|
|
test key.finger to ensure we receive a valid fingerprint
|
|
|
|
'''
|
|
|
|
out = self.run_function('key.finger')
|
|
|
|
match = re.match("([0-9a-z]{2}:){15,}[0-9a-z]{2}$", out)
|
|
|
|
self.assertTrue(match)
|
|
|
|
|
|
|
|
def test_key_finger_master(self):
|
|
|
|
'''
|
|
|
|
test key.finger_master to ensure we receive a valid fingerprint
|
|
|
|
'''
|
|
|
|
out = self.run_function('key.finger_master')
|
|
|
|
match = re.match("([0-9a-z]{2}:){15,}[0-9a-z]{2}$", out)
|
|
|
|
self.assertTrue(match)
|