mirror of
https://github.com/saltstack-formulas/template-formula.git
synced 2025-04-17 10:10:28 +00:00
test(inspec): verify subcomponent configuration file
* test/integration/default/controls/subcomponent_config_spec.rb: the subcomponent file must come from the “/subcomponent/files/” directory * test/integration/default/controls/config_spec.rb: update to match the new subcomponent override.
This commit is contained in:
parent
9b98b3eb6c
commit
fd55e03692
2 changed files with 13 additions and 1 deletions
|
@ -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", "roles", "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"], "template-subcomponent-config-file-file-managed": ["subcomponent-example.tmpl.jinja"]}' }
|
||||
its('content') { should include '"arch": "amd64"' }
|
||||
its('content') { should include '"winner": "pillar"}' }
|
||||
its('content') { should include 'winner of the merge: pillar' }
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
control 'template subcomponent configuration' do
|
||||
title 'should match desired lines'
|
||||
|
||||
describe file('/etc/template-subcomponent-formula.conf') do
|
||||
it { should be_file }
|
||||
it { should be_owned_by 'root' }
|
||||
it { should be_grouped_into 'root' }
|
||||
its('mode') { should cmp '0644' }
|
||||
its('content') { should include '# File managed by Salt at <salt://template/subcomponent/files/default/subcomponent-example.tmpl.jinja>.' }
|
||||
its('content') { should include 'This is another subcomponent example file from SaltStack template-formula.' }
|
||||
end
|
||||
end
|
Loading…
Add table
Reference in a new issue