Merge "Set sane defaults for linuxbridge_conf.ini"
This commit is contained in:
commit
66761dc769
|
@ -40,6 +40,8 @@ node.default['openstack']['network']['plugins']['linuxbridge'].tap do |lb|
|
||||||
'/etc/neutron/plugins/linuxbridge'
|
'/etc/neutron/plugins/linuxbridge'
|
||||||
lb['filename'] =
|
lb['filename'] =
|
||||||
'linuxbridge_conf.ini'
|
'linuxbridge_conf.ini'
|
||||||
|
lb['conf']['securitygroup']['firewall_driver'] =
|
||||||
|
'neutron.agent.linux.iptables_firewall.IptablesFirewallDriver'
|
||||||
end
|
end
|
||||||
|
|
||||||
include_recipe 'openstack-network::plugin_config'
|
include_recipe 'openstack-network::plugin_config'
|
||||||
|
|
|
@ -0,0 +1,63 @@
|
||||||
|
# pkg upgrade
|
||||||
|
|
||||||
|
# service
|
||||||
|
|
||||||
|
# Encoding: utf-8
|
||||||
|
require_relative 'spec_helper'
|
||||||
|
|
||||||
|
describe 'openstack-network::ml2_linuxbridge' do
|
||||||
|
describe 'redhat' do
|
||||||
|
let(:runner) { ChefSpec::SoloRunner.new(REDHAT_OPTS) }
|
||||||
|
let(:node) { runner.node }
|
||||||
|
let(:chef_run) do
|
||||||
|
runner.converge(described_recipe)
|
||||||
|
end
|
||||||
|
|
||||||
|
include_context 'neutron-stubs'
|
||||||
|
|
||||||
|
before do
|
||||||
|
node.set['openstack']['network']['plugins']['linuxbridge']['path'] =
|
||||||
|
'/etc/neutron/plugins/linuxbridge'
|
||||||
|
node.set['openstack']['network']['plugins']['linuxbridge']['filename'] =
|
||||||
|
'linuxbridge_conf.ini'
|
||||||
|
end
|
||||||
|
it 'creates the /etc/neutron/plugins/linuxbridge agent directory' do
|
||||||
|
expect(chef_run).to create_directory('/etc/neutron/plugins/linuxbridge').with(
|
||||||
|
owner: 'neutron',
|
||||||
|
group: 'neutron',
|
||||||
|
mode: 0700
|
||||||
|
)
|
||||||
|
end
|
||||||
|
it do
|
||||||
|
expect(chef_run).to include_recipe('openstack-network::plugin_config')
|
||||||
|
end
|
||||||
|
|
||||||
|
describe '/etc/neutron/plugins/linuxbridge/linuxbridge_conf.ini' do
|
||||||
|
let(:file) do
|
||||||
|
chef_run.template('/etc/neutron/plugins/linuxbridge/linuxbridge_conf.ini')
|
||||||
|
end
|
||||||
|
[
|
||||||
|
/^firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver$/
|
||||||
|
].each do |line|
|
||||||
|
it do
|
||||||
|
expect(chef_run).to render_config_file(file.name)
|
||||||
|
.with_section_content('securitygroup', line)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
it do
|
||||||
|
%w(openstack-neutron-linuxbridge iproute).each do |pkg|
|
||||||
|
expect(chef_run).to upgrade_package(pkg)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
it do
|
||||||
|
expect(chef_run).to enable_service('neutron-linuxbridge-agent')
|
||||||
|
end
|
||||||
|
it do
|
||||||
|
service = chef_run.service('neutron-linuxbridge-agent')
|
||||||
|
expect(service).to(subscribe_to('template[/etc/neutron/neutron.conf]').on(:restart).delayed) && subscribe_to('template[/etc/neutron/plugins/linuxbridge/linuxbridge_conf.ini]').on(:restart).delayed
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -33,6 +33,20 @@ describe 'openstack-network::ml2_linuxbridge' do
|
||||||
expect(chef_run).to include_recipe('openstack-network::plugin_config')
|
expect(chef_run).to include_recipe('openstack-network::plugin_config')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe '/etc/neutron/plugins/linuxbridge/linuxbridge_conf.ini' do
|
||||||
|
let(:file) do
|
||||||
|
chef_run.template('/etc/neutron/plugins/linuxbridge/linuxbridge_conf.ini')
|
||||||
|
end
|
||||||
|
[
|
||||||
|
/^firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver$/
|
||||||
|
].each do |line|
|
||||||
|
it do
|
||||||
|
expect(chef_run).to render_config_file(file.name)
|
||||||
|
.with_section_content('securitygroup', line)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
it do
|
it do
|
||||||
%w(neutron-plugin-linuxbridge neutron-plugin-linuxbridge-agent).each do |pkg|
|
%w(neutron-plugin-linuxbridge neutron-plugin-linuxbridge-agent).each do |pkg|
|
||||||
expect(chef_run).to upgrade_package(pkg)
|
expect(chef_run).to upgrade_package(pkg)
|
||||||
|
|
Loading…
Reference in New Issue