mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Use requisite
This commit is contained in:
parent
6a7d35bc59
commit
a99cd0eafd
2 changed files with 65 additions and 0 deletions
55
tests/integration/files/file/base/requisites/use.sls
Normal file
55
tests/integration/files/file/base/requisites/use.sls
Normal file
|
@ -0,0 +1,55 @@
|
|||
# None of theses states should run
|
||||
A:
|
||||
cmd.run:
|
||||
- name: echo "A"
|
||||
- onlyif: return 0
|
||||
|
||||
# issue #8235
|
||||
#B:
|
||||
# cmd.run:
|
||||
# - name: echo "B"
|
||||
# # here used without "-"
|
||||
# - use:
|
||||
# cmd: A
|
||||
|
||||
C:
|
||||
cmd.run:
|
||||
- name: echo "C"
|
||||
- use:
|
||||
- cmd: A
|
||||
|
||||
D:
|
||||
cmd.run:
|
||||
- name: echo "D"
|
||||
- onlyif: return 0
|
||||
- use_in:
|
||||
- cmd: E
|
||||
|
||||
E:
|
||||
cmd.run:
|
||||
- name: echo "E"
|
||||
|
||||
# issue 8235
|
||||
#F:
|
||||
# cmd.run:
|
||||
# - name: echo "F"
|
||||
# - onlyif: return 0
|
||||
# - use_in:
|
||||
# cmd: G
|
||||
#
|
||||
#G:
|
||||
# cmd.run:
|
||||
# - name: echo "G"
|
||||
|
||||
# issue xxxx
|
||||
#H:
|
||||
# cmd.run:
|
||||
# - name: echo "H"
|
||||
# - use:
|
||||
# - cmd: C
|
||||
#I:
|
||||
# cmd.run:
|
||||
# - name: echo "I"
|
||||
# - use:
|
||||
# - cmd: E
|
||||
|
|
@ -512,6 +512,16 @@ fi
|
|||
# }
|
||||
#self.assertEqual(expected_result_complex, result)
|
||||
|
||||
def test_requisites_use(self):
|
||||
'''
|
||||
Call sls file containing several use_in and use.
|
||||
|
||||
'''
|
||||
# TODO issue #8235 & #8774 some examples are still commented in the test file
|
||||
ret = self.run_function('state.sls', mods='requisites.use')
|
||||
for item,descr in ret.iteritems():
|
||||
self.assertEqual(descr['comment'], 'onlyif execution failed')
|
||||
|
||||
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