Skip to content

Commit

Permalink
added tests for resolved cache variants
Browse files Browse the repository at this point in the history
  • Loading branch information
bryangwilliam committed Jan 27, 2021
1 parent 0153a21 commit 6b726fa
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion spec/classes/init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,29 @@
it { is_expected.to contain_ini_setting('llmnr') }
it { is_expected.to contain_ini_setting('dnssec') }
it { is_expected.to contain_ini_setting('dnsovertls') }
it { is_expected.to contain_ini_setting('cache') }
it { is_expected.to contain_ini_setting('cache').with(
path: '/etc/systemd/resolved.conf',
value: 'yes',
) }
it { is_expected.to contain_ini_setting('dns_stub_listener') }
end

context 'when enabling resolved with no-negative cache variant' do
let(:params) do
{
manage_resolved: true,
cache: 'no-negative',
}
end

it { is_expected.to create_service('systemd-resolved').with_ensure('running') }
it { is_expected.to create_service('systemd-resolved').with_enable(true) }
it { is_expected.to contain_ini_setting('cache').with(
path: '/etc/systemd/resolved.conf',
value: 'no-negative',
) }
end

context 'when enabling timesyncd' do
let(:params) do
{
Expand Down

0 comments on commit 6b726fa

Please sign in to comment.