Merge pull request #49056 from Ch3LL/test_mine

Add orch runner with mine.get integration tests
This commit is contained in:
Mike Place 2018-08-18 08:54:47 -04:00 committed by GitHub
commit 6fb8d4a33f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 27 additions and 0 deletions

View 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 %}

View File

@ -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