mirror of
https://github.com/saltstack-formulas/template-formula.git
synced 2025-04-17 10:10:28 +00:00
test(libtofs): “tofs.files_switch” lookup can return a list
We need to verify that “libtofs” works when the “tofs.files_switch” lookup return a list instead of a single element. * kitchen.yml (provisioner): copy tests specific pillars into the test environment. * pillar.example (template.tofs.files_switch): lookup for “roles” at the end. * test/salt/pillar/test.sls (roles): list of roles to apply during tests. * test/integration/default/controls/config_spec.rb: add “roles” to the list of “tofs.files_switch” items to verify.
This commit is contained in:
parent
f2c6454c2a
commit
13f1728c27
4 changed files with 8 additions and 1 deletions
|
@ -124,8 +124,10 @@ provisioner:
|
|||
base:
|
||||
'*':
|
||||
- template
|
||||
- define_roles
|
||||
pillars_from_files:
|
||||
template.sls: pillar.example
|
||||
define_roles.sls: test/salt/pillar/define_roles.sls
|
||||
|
||||
verifier:
|
||||
# https://www.inspec.io/
|
||||
|
|
|
@ -33,6 +33,7 @@ template:
|
|||
files_switch:
|
||||
- any/path/can/be/used/here
|
||||
- id
|
||||
- roles
|
||||
- osfinger
|
||||
- os
|
||||
- os_family
|
||||
|
|
|
@ -14,7 +14,7 @@ control 'template configuration' do
|
|||
its('content') { should include '"lookup": {"added_in_lookup": "lookup_value",' }
|
||||
its('content') { should include '"pkg": {"name": "' }
|
||||
its('content') { should include '"service": {"name": "' }
|
||||
its('content') { should include '"tofs": {"files_switch": ["any/path/can/be/used/here", "id", "osfinger", "os", "os_family"], "source_files": {"template-config-file-file-managed": ["example.tmpl.jinja"]}' }
|
||||
its('content') { should include '"tofs": {"files_switch": ["any/path/can/be/used/here", "id", "roles", "osfinger", "os", "os_family"], "source_files": {"template-config-file-file-managed": ["example.tmpl.jinja"]}' }
|
||||
its('content') { should include '"winner": "pillar"}' }
|
||||
its('content') { should include 'winner of the merge: pillar' }
|
||||
end
|
||||
|
|
4
test/salt/pillar/define_roles.sls
Normal file
4
test/salt/pillar/define_roles.sls
Normal file
|
@ -0,0 +1,4 @@
|
|||
# libtofs.jinja must work with tofs.files_switch looked up list
|
||||
roles:
|
||||
- foo
|
||||
- bar
|
Loading…
Add table
Reference in a new issue