mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
commented test for issue #8211 complex prepreq
This commit is contained in:
parent
e4c68d1a94
commit
6a7d35bc59
2 changed files with 86 additions and 0 deletions
|
@ -0,0 +1,56 @@
|
|||
# issue #8211
|
||||
# expected rank
|
||||
# B --+ 1
|
||||
# |
|
||||
# C <-+ ----+ 2/3
|
||||
# |
|
||||
# D ---+ | 3/2
|
||||
# | |
|
||||
# A <--+ <--+ 4
|
||||
#
|
||||
# resulting rank
|
||||
# D --+
|
||||
# |
|
||||
# A <-+ <==+
|
||||
# |
|
||||
# B --+ +--> unrespected A prereq_in C (FAILURE)
|
||||
# | |
|
||||
# C <-+ ===+
|
||||
|
||||
# runs after C
|
||||
A:
|
||||
cmd.run:
|
||||
- name: echo A fourth
|
||||
# is running in test mode before C
|
||||
# C gets executed first if this states modify something
|
||||
- prereq_in:
|
||||
- cmd: C
|
||||
|
||||
# runs before C
|
||||
B:
|
||||
cmd.run:
|
||||
- name: echo B first
|
||||
# will test C and be applied only if C changes,
|
||||
# and then will run before C
|
||||
- prereq:
|
||||
- cmd: C
|
||||
|
||||
C:
|
||||
cmd.run:
|
||||
- name: echo C second
|
||||
# replacing A prereq_in C by theses lines
|
||||
# changes nothing actually
|
||||
#- prereq:
|
||||
# - cmd: A
|
||||
|
||||
# Removing D, A gets executed after C
|
||||
# as described in (A prereq_in C)
|
||||
# runs before A
|
||||
D:
|
||||
cmd.run:
|
||||
- name: echo D third
|
||||
# will test A and be applied only if A changes,
|
||||
# and then will run before A
|
||||
- prereq:
|
||||
- cmd: A
|
||||
|
|
@ -456,6 +456,24 @@ fi
|
|||
+ ' foobar: A\n',
|
||||
'result': False}
|
||||
}
|
||||
expected_result_complex={
|
||||
'cmd_|-A_|-echo A fourth_|-run': {
|
||||
'__run_num__': 3,
|
||||
'comment': 'Command "echo A fourth" run',
|
||||
'result': True},
|
||||
'cmd_|-B_|-echo B first_|-run': {
|
||||
'__run_num__': 0,
|
||||
'comment': 'Command "echo B first" run',
|
||||
'result': True},
|
||||
'cmd_|-C_|-echo C second_|-run': {
|
||||
'__run_num__': 1,
|
||||
'comment': 'Command "echo C second" run',
|
||||
'result': True},
|
||||
'cmd_|-D_|-echo D third_|-run': {
|
||||
'__run_num__': 2,
|
||||
'comment': 'Command "echo D third" run',
|
||||
'result': True},
|
||||
}
|
||||
result={}
|
||||
ret = self.run_function('state.sls', mods='requisites.prereq_simple')
|
||||
for item,descr in ret.iteritems():
|
||||
|
@ -482,6 +500,18 @@ fi
|
|||
+ ' foobar: C\n'
|
||||
)
|
||||
|
||||
# issue #8211, chaining complex prereq & prereq_in
|
||||
# TODO: Actually this test fails
|
||||
#result={}
|
||||
#ret = self.run_function('state.sls', mods='requisites.prereq_complex')
|
||||
#for item,descr in ret.iteritems():
|
||||
# result[item] = {
|
||||
# '__run_num__': descr['__run_num__'],
|
||||
# 'comment':descr['comment'],
|
||||
# 'result':descr['result']
|
||||
# }
|
||||
#self.assertEqual(expected_result_complex, result)
|
||||
|
||||
def test_get_file_from_env_in_top_match(self):
|
||||
tgt = os.path.join(integration.SYS_TMP_DIR, 'prod-cheese-file')
|
||||
try:
|
||||
|
|
Loading…
Add table
Reference in a new issue