Add masterless state.highstate integration test

This commit is contained in:
Ch3LL 2017-11-21 12:33:44 -05:00
parent 2dc3e5c42a
commit 9cc853e3d5
No known key found for this signature in database
GPG key ID: 132B55A7C13EFA73
2 changed files with 28 additions and 0 deletions

View file

@ -824,6 +824,19 @@ class TestDaemon(object):
RUNTIME_VARS.TMP_PRODENV_STATE_TREE
]
}
minion_opts['file_roots'] = {
'base': [
os.path.join(FILES, 'file', 'base'),
# Let's support runtime created files that can be used like:
# salt://my-temp-file.txt
RUNTIME_VARS.TMP_STATE_TREE
],
# Alternate root to test __env__ choices
'prod': [
os.path.join(FILES, 'file', 'prod'),
RUNTIME_VARS.TMP_PRODENV_STATE_TREE
]
}
master_opts.setdefault('reactor', []).append(
{
'salt/minion/*/start': [

View file

@ -488,6 +488,21 @@ class CallTest(ShellCase, testprogram.TestProgramCase, ShellCaseCommonTestsMixin
stdout=stdout, stderr=stderr
)
def test_masterless_highstate(self):
'''
test state.highstate in masterless mode
'''
ret = self.run_call('state.highstate', local=True)
exp_out = [' Function: file.managed', ' Result: True',
'Succeeded: 1 (changed=1)']
for out in exp_out:
self.assertIn(out, ret)
destpath = os.path.join(TMP, 'testfile')
self.assertTrue(os.path.exists(destpath))
def test_exit_status_correct_usage(self):
'''
Ensure correct exit status when salt-call starts correctly.