mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +00:00
Merge pull request #49056 from Ch3LL/test_mine
Add orch runner with mine.get integration tests
This commit is contained in:
commit
6fb8d4a33f
10
tests/integration/files/file/base/orch/mine.sls
Normal file
10
tests/integration/files/file/base/orch/mine.sls
Normal file
@ -0,0 +1,10 @@
|
||||
{% set minion = '*' %}
|
||||
{% set mine = salt.saltutil.runner('mine.get',
|
||||
tgt=minion,
|
||||
fun='test.ping') %}
|
||||
|
||||
{% if mine %}
|
||||
test.ping:
|
||||
salt.function:
|
||||
- tgt: "{{ minion }}"
|
||||
{% endif %}
|
@ -93,6 +93,23 @@ class StateRunnerTest(ShellCase):
|
||||
assert os.path.exists('/tmp/ewu-2016-12-13') is False
|
||||
assert code != 0
|
||||
|
||||
def test_orchestrate_with_mine(self):
|
||||
'''
|
||||
test salt-run state.orchestrate with mine.get call in sls
|
||||
'''
|
||||
fail_time = time.time() + 120
|
||||
self.run_run('mine.update "*"')
|
||||
|
||||
exp_ret = 'Succeeded: 1 (changed=1)'
|
||||
while True:
|
||||
ret = self.run_run('state.orchestrate orch.mine')
|
||||
try:
|
||||
assert exp_ret in ret
|
||||
break
|
||||
except AssertionError:
|
||||
if time.time() > fail_time:
|
||||
self.fail('"{0}" was not found in the orchestration call'.format(exp_ret))
|
||||
|
||||
def test_orchestrate_state_and_function_failure(self):
|
||||
'''
|
||||
Ensure that returns from failed minions are in the changes dict where
|
||||
|
Loading…
Reference in New Issue
Block a user