mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Add regression test for #17051
This commit is contained in:
parent
5cf110b80c
commit
d2b548a0e7
2 changed files with 56 additions and 0 deletions
|
@ -0,0 +1,24 @@
|
|||
# A --+
|
||||
# |
|
||||
# B <-+ ----+
|
||||
# |
|
||||
# C <-------+
|
||||
|
||||
# runs before A and/or B
|
||||
A:
|
||||
cmd.run:
|
||||
- name: echo A first
|
||||
# is running in test mode before B/C
|
||||
- prereq:
|
||||
- cmd: B
|
||||
- cmd: C
|
||||
|
||||
# always has to run
|
||||
B:
|
||||
cmd.run:
|
||||
- name: echo B second
|
||||
|
||||
# never has to run
|
||||
C:
|
||||
cmd.wait:
|
||||
- name: echo C third
|
|
@ -665,6 +665,26 @@ fi
|
|||
'comment': 'Command "echo E" run',
|
||||
'result': True}
|
||||
}
|
||||
expected_result_simple3 = {
|
||||
'cmd_|-A_|-echo A first_|-run': {
|
||||
'__run_num__': 0,
|
||||
'comment': 'Command "echo A first" run',
|
||||
'result': True,
|
||||
'changes': True, # whether there should be changes or not
|
||||
},
|
||||
'cmd_|-B_|-echo B second_|-run': {
|
||||
'__run_num__': 1,
|
||||
'comment': 'Command "echo B second" run',
|
||||
'result': True,
|
||||
'changes': True, # whether there should be changes or not
|
||||
},
|
||||
'cmd_|-C_|-echo C third_|-wait': {
|
||||
'__run_num__': 2,
|
||||
'comment': '',
|
||||
'result': True,
|
||||
'changes': False,
|
||||
}
|
||||
}
|
||||
expected_result_complex = {
|
||||
'cmd_|-A_|-echo A fourth_|-run': {
|
||||
'__run_num__': 3,
|
||||
|
@ -721,6 +741,18 @@ fi
|
|||
}
|
||||
self.assertEqual(expected_result_simple2, result)
|
||||
|
||||
result = {}
|
||||
ret = self.run_function('state.sls', mods='requisites.prereq_simple3')
|
||||
self.assertReturnNonEmptySaltType(ret)
|
||||
for item, descr in ret.iteritems():
|
||||
result[item] = {
|
||||
'__run_num__': descr['__run_num__'],
|
||||
'comment': descr['comment'],
|
||||
'result': descr['result'],
|
||||
'changes': descr['changes'] != {}
|
||||
}
|
||||
self.assertEqual(expected_result_simple3, result)
|
||||
|
||||
#ret = self.run_function('state.sls', mods='requisites.prereq_error_nolist')
|
||||
#self.assertEqual(
|
||||
# ret,
|
||||
|
|
Loading…
Add table
Reference in a new issue