mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Add pillar include tests
This commit is contained in:
parent
7745242f29
commit
c79f496021
7 changed files with 40 additions and 0 deletions
2
tests/integration/files/pillar/base/glob_include.sls
Normal file
2
tests/integration/files/pillar/base/glob_include.sls
Normal file
|
@ -0,0 +1,2 @@
|
|||
include:
|
||||
- 'glob_include*'
|
2
tests/integration/files/pillar/base/glob_include_a.sls
Normal file
2
tests/integration/files/pillar/base/glob_include_a.sls
Normal file
|
@ -0,0 +1,2 @@
|
|||
glob-a:
|
||||
- 'Entry A'
|
2
tests/integration/files/pillar/base/glob_include_b.sls
Normal file
2
tests/integration/files/pillar/base/glob_include_b.sls
Normal file
|
@ -0,0 +1,2 @@
|
|||
glob-b:
|
||||
- 'Entry B'
|
2
tests/integration/files/pillar/base/include-a.sls
Normal file
2
tests/integration/files/pillar/base/include-a.sls
Normal file
|
@ -0,0 +1,2 @@
|
|||
a:
|
||||
- 'Entry A'
|
2
tests/integration/files/pillar/base/include-b.sls
Normal file
2
tests/integration/files/pillar/base/include-b.sls
Normal file
|
@ -0,0 +1,2 @@
|
|||
b:
|
||||
- 'Entry B'
|
5
tests/integration/files/pillar/base/include.sls
Normal file
5
tests/integration/files/pillar/base/include.sls
Normal file
|
@ -0,0 +1,5 @@
|
|||
include:
|
||||
- include-a:
|
||||
key: element:a
|
||||
- include-b:
|
||||
key: element:b
|
25
tests/integration/pillar/test_pillar_include.py
Normal file
25
tests/integration/pillar/test_pillar_include.py
Normal file
|
@ -0,0 +1,25 @@
|
|||
from __future__ import unicode_literals
|
||||
from tests.support.case import ModuleCase
|
||||
|
||||
|
||||
class PillarIncludeTest(ModuleCase):
|
||||
|
||||
def test_pillar_include(self):
|
||||
'''
|
||||
Test pillar include
|
||||
'''
|
||||
ret = self.minion_run('pillar.items')
|
||||
assert 'a' in ret['element']
|
||||
assert ret['element']['a'] == {'a': ['Entry A']}
|
||||
assert 'b' in ret['element']
|
||||
assert ret['element']['b'] == {'b': ['Entry B']}
|
||||
|
||||
def test_pillar_glob_include(self):
|
||||
'''
|
||||
Test pillar include via glob pattern
|
||||
'''
|
||||
ret = self.minion_run('pillar.items')
|
||||
assert 'glob-a' in ret
|
||||
assert ret['glob-a'] == 'Entry A'
|
||||
assert 'glob-b' in ret
|
||||
assert ret['glob-b'] == 'Entry B'
|
Loading…
Add table
Reference in a new issue