Files
cookbook-openstack-integrat…/spec/dns_spec.rb
Lance Albertson d5ea08e31a Update to Chef Workstation 21.2.303
- Fixes for using the resolver 3.x cookbook

Change-Id: I5b0a6783f0602983baeaf8b0e9bb90f150212644
Depends-On: https://review.opendev.org/c/openstack/openstack-chef/+/779389
Signed-off-by: Lance Albertson <lance@osuosl.org>
2021-03-08 16:46:13 -08:00

78 lines
1.8 KiB
Ruby

require_relative 'spec_helper'
describe 'openstack-integration-test::dns' do
describe 'ubuntu' do
let(:runner) { ChefSpec::SoloRunner.new(UBUNTU_OPTS) }
let(:node) { runner.node }
cached(:chef_run) do
runner.converge(described_recipe)
end
include_context 'tempest-stubs'
it do
expect(chef_run).to stop_service('systemd-resolved')
expect(chef_run).to disable_service('systemd-resolved')
end
it do
expect(chef_run).to set_resolver_config('/etc/resolv.conf').with(
nameservers: %w(1.0.0.1 8.8.8.8)
)
end
it do
expect(chef_run).to disable_service('unbound')
end
it do
expect(chef_run).to stop_service('unbound')
end
it do
expect(chef_run).to create_bind_service('default')
expect(chef_run).to start_bind_service('default')
end
it do
expect(chef_run).to create_template('/etc/bind/rndc.key').with(
source: 'rndc.key.erb',
owner: 'bind',
group: 'bind',
mode: '440',
sensitive: true,
variables: {
secret: 'rndc-key',
}
)
end
it do
expect(chef_run.template('/etc/bind/rndc.key')).to notify('bind_service[default]').to(:restart)
end
it do
expect(chef_run).to create_template('/etc/bind/named.designate').with(
owner: 'bind',
group: 'bind',
variables: {
bind_sysconfig: '/etc/bind',
}
)
end
it do
expect(chef_run.template('/etc/bind/named.designate')).to notify('bind_service[default]').to(:restart)
end
it do
expect(chef_run).to create_bind_config('default').with(
options: [
'allow-new-zones yes',
],
additional_config_files: %w(named.designate)
)
end
end
end