mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #44629 from Ch3LL/high_masterless
Add masterless state.highstate integration test
This commit is contained in:
commit
c5206113ce
2 changed files with 28 additions and 0 deletions
|
@ -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': [
|
||||
|
|
|
@ -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)
|
||||
|
||||
destpath = os.path.join(TMP, 'testfile')
|
||||
exp_out = [' Function: file.managed', ' Result: True',
|
||||
' ID: {0}'.format(destpath)]
|
||||
|
||||
for out in exp_out:
|
||||
self.assertIn(out, ret)
|
||||
|
||||
self.assertTrue(os.path.exists(destpath))
|
||||
|
||||
def test_exit_status_correct_usage(self):
|
||||
'''
|
||||
Ensure correct exit status when salt-call starts correctly.
|
||||
|
|
Loading…
Add table
Reference in a new issue