mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Add one onchanges requisite test
This commit is contained in:
parent
71ccd5e51a
commit
8f0e80bd66
2 changed files with 20 additions and 0 deletions
|
@ -0,0 +1,9 @@
|
|||
changing_state:
|
||||
cmd.run:
|
||||
- name: echo "Changed!"
|
||||
- onchanges:
|
||||
- cmd: state_to_run
|
||||
|
||||
state_to_run:
|
||||
cmd.run:
|
||||
- name: echo "Success!"
|
|
@ -843,6 +843,17 @@ fi
|
|||
finally:
|
||||
os.unlink(tgt)
|
||||
|
||||
# onchanges tests
|
||||
|
||||
def test_onchanges_requisite(self):
|
||||
'''
|
||||
Tests a simple state using the onchanges requisite
|
||||
'''
|
||||
ret = self.run_function('state.sls', mods='requisites.onchanges_simple')
|
||||
expected_result = 'Command "echo "Success!"" run'
|
||||
|
||||
self.assertIn(expected_result, ret['cmd_|-state_to_run_|-echo "Success!"_|-run']['comment'])
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
from integration import run_tests
|
||||
|
|
Loading…
Add table
Reference in a new issue