mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +00:00
Merge branch 'develop' of github.com:saltstack/salt into develop
This commit is contained in:
commit
7e16fd680a
@ -617,6 +617,16 @@ class AESFuncs(object):
|
||||
load['opts']['id'],
|
||||
load['opts']['environment'])
|
||||
|
||||
def _minion_event(self, load):
|
||||
'''
|
||||
Receive an event from the minion and fire it on the master event
|
||||
interface
|
||||
'''
|
||||
if 'id' not in load or 'tag' not in load or 'msg':
|
||||
return False
|
||||
tag = '{0}_{1}'.format(load['tag'], load['id'])
|
||||
return self.event.fire_event(load['msg'], tag)
|
||||
|
||||
def _return(self, load):
|
||||
'''
|
||||
Handle the return data sent from the minions
|
||||
|
@ -74,6 +74,10 @@ class TestDaemon(object):
|
||||
self._clean()
|
||||
self.master_opts['hosts.file'] = os.path.join(TMP, 'hosts')
|
||||
self.minion_opts['hosts.file'] = os.path.join(TMP, 'hosts')
|
||||
shutil.copy(os.path.join(INTEGRATION_TEST_DIR, 'files', 'hosts'),
|
||||
self.master_opts['hosts.file'])
|
||||
shutil.copy(os.path.join(INTEGRATION_TEST_DIR, 'files', 'hosts'),
|
||||
self.minion_opts['hosts.file'])
|
||||
verify_env([
|
||||
os.path.join(self.master_opts['pki_dir'], 'minions'),
|
||||
os.path.join(self.master_opts['pki_dir'], 'minions_pre'),
|
||||
|
@ -12,8 +12,8 @@ import integration
|
||||
from integration import TestDaemon
|
||||
|
||||
|
||||
AUTHORIZED_KEYS = os.path.join(integration.TMP, 'authorized_keys')
|
||||
KNOWN_HOSTS = os.path.join(integration.TMP, 'known_hosts')
|
||||
AUTHORIZED_KEYS = os.path.join('/tmp/subsalttest', 'authorized_keys')
|
||||
KNOWN_HOSTS = os.path.join('/tmp/subsalttest', 'known_hosts')
|
||||
GITHUB_FINGERPRINT = '16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48'
|
||||
|
||||
|
||||
|
@ -6,9 +6,7 @@ tests for host state
|
||||
import os
|
||||
#
|
||||
# Import salt libs
|
||||
from saltunittest import TestLoader, TextTestRunner
|
||||
import integration
|
||||
from integration import TestDaemon
|
||||
|
||||
HFILE = os.path.join(integration.TMP, 'hosts')
|
||||
|
||||
@ -21,8 +19,11 @@ class HostTest(integration.ModuleCase):
|
||||
'''
|
||||
host.present
|
||||
'''
|
||||
ret = self.run_state('host.present', name='spam.bacon', ip='10.10.10.10')
|
||||
name = 'spam.bacon'
|
||||
ip = '10.10.10.10'
|
||||
ret = self.run_state('host.present', name=name, ip=ip)
|
||||
result = self.state_result(ret)
|
||||
self.assertTrue(result)
|
||||
with open(HFILE) as fp_:
|
||||
self.assertIn('{0}\t\t{1}'.format(ip, name), fp_.read())
|
||||
output = fp_.read()
|
||||
self.assertIn('{0}\t\t{1}'.format(ip, name), output)
|
||||
|
Loading…
Reference in New Issue
Block a user