2021-03-31 10:10:43 +02:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2021-03-31 10:10:44 +02:00
|
|
|
control 'unbound.config.file' do
|
2021-03-31 10:10:43 +02:00
|
|
|
title 'Verify the configuration file'
|
|
|
|
|
2021-03-31 11:08:28 +02:00
|
|
|
describe file('/etc/unbound/unbound.conf') do
|
2021-03-31 10:10:43 +02:00
|
|
|
it { should be_file }
|
|
|
|
it { should be_owned_by 'root' }
|
|
|
|
it { should be_grouped_into 'root' }
|
|
|
|
its('mode') { should cmp '0644' }
|
|
|
|
its('content') do
|
|
|
|
should include(
|
2021-03-31 11:08:28 +02:00
|
|
|
'This is just a sample for testing purposes.'
|
2021-03-31 10:10:43 +02:00
|
|
|
)
|
|
|
|
end
|
|
|
|
its('content') { should include '"added_in_pillar": "pillar_value"' }
|
|
|
|
its('content') { should include '"added_in_defaults": "defaults_value"' }
|
|
|
|
its('content') { should include '"added_in_lookup": "lookup_value"' }
|
2021-03-31 11:08:28 +02:00
|
|
|
its('content') { should include '"config": "/etc/unbound/unbound.conf"' }
|
2021-03-31 10:10:43 +02:00
|
|
|
its('content') { should include '"lookup": {"added_in_lookup": "lookup_value",' }
|
|
|
|
its('content') { should include '"pkg": {"name": "' }
|
|
|
|
its('content') { should include '"service": {"name": "' }
|
|
|
|
its('content') do
|
|
|
|
# rubocop:disable Lint/RedundantCopDisableDirective
|
|
|
|
# rubocop:disable Layout/LineLength
|
|
|
|
should include(
|
|
|
|
'"tofs": {"files_switch": ["any/path/can/be/used/here", "id", '\
|
|
|
|
'"roles", "osfinger", "os", "os_family"], "source_files": '\
|
2021-03-31 11:08:28 +02:00
|
|
|
'{"unbound-config-file-file-managed": ["unbound.conf.jinja"]}'
|
2021-03-31 10:10:43 +02:00
|
|
|
)
|
|
|
|
# rubocop:enable Layout/LineLength
|
|
|
|
# rubocop:enable Lint/RedundantCopDisableDirective
|
|
|
|
end
|
|
|
|
its('content') { should include '"arch": "amd64"' }
|
|
|
|
its('content') { should include '"winner": "pillar"}' }
|
|
|
|
its('content') { should include 'winner of the merge: pillar' }
|
|
|
|
end
|
|
|
|
end
|