Add pillar include tests

This commit is contained in:
Daniel A. Wozniak 2019-04-10 20:55:46 +00:00
parent 7745242f29
commit c79f496021
No known key found for this signature in database
GPG key ID: 166B9D2C06C82D61
7 changed files with 40 additions and 0 deletions

View file

@ -0,0 +1,2 @@
include:
- 'glob_include*'

View file

@ -0,0 +1,2 @@
glob-a:
- 'Entry A'

View file

@ -0,0 +1,2 @@
glob-b:
- 'Entry B'

View file

@ -0,0 +1,2 @@
a:
- 'Entry A'

View file

@ -0,0 +1,2 @@
b:
- 'Entry B'

View file

@ -0,0 +1,5 @@
include:
- include-a:
key: element:a
- include-b:
key: element:b

View 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'