Merge "Make vlan_transparent in neutron.conf configurable"

This commit is contained in:
Zuul 2018-08-24 15:19:16 +00:00 committed by Gerrit Code Review
commit dc977b5ae1
3 changed files with 55 additions and 20 deletions

View File

@ -333,6 +333,10 @@
# (optional) Maximum number of allowed address pairs per port # (optional) Maximum number of allowed address pairs per port
# Defaults to $::os_service_default. # Defaults to $::os_service_default.
# #
# [*vlan_transparent*]
# (optional) Allow plugins that support it to create VLAN transparent networks
# Defaults to $::os_service_default
#
class neutron ( class neutron (
$enabled = true, $enabled = true,
$package_ensure = 'present', $package_ensure = 'present',
@ -404,6 +408,7 @@ class neutron (
$notification_topics = $::os_service_default, $notification_topics = $::os_service_default,
$notification_transport_url = $::os_service_default, $notification_transport_url = $::os_service_default,
$max_allowed_address_pair = $::os_service_default, $max_allowed_address_pair = $::os_service_default,
$vlan_transparent = $::os_service_default,
) { ) {
include ::neutron::deps include ::neutron::deps
@ -463,6 +468,7 @@ class neutron (
'DEFAULT/state_path': value => $state_path; 'DEFAULT/state_path': value => $state_path;
'DEFAULT/global_physnet_mtu': value => $global_physnet_mtu; 'DEFAULT/global_physnet_mtu': value => $global_physnet_mtu;
'DEFAULT/max_allowed_address_pair': value => $max_allowed_address_pair; 'DEFAULT/max_allowed_address_pair': value => $max_allowed_address_pair;
'DEFAULT/vlan_transparent': value => $vlan_transparent;
'agent/root_helper': value => $root_helper; 'agent/root_helper': value => $root_helper;
'agent/root_helper_daemon': value => $root_helper_daemon; 'agent/root_helper_daemon': value => $root_helper_daemon;
'agent/report_interval': value => $report_interval; 'agent/report_interval': value => $report_interval;

View File

@ -0,0 +1,4 @@
---
features:
- Added vlan_transparent boolean parameter that if set to true
allows plugins that support transparent VLANs to use it.

View File

@ -53,6 +53,8 @@ describe 'neutron' do
it_configures 'with transport_url defined' it_configures 'with transport_url defined'
it_configures 'with rootwrap daemon' it_configures 'with rootwrap daemon'
it_configures 'with max_allowed_address_pair defined' it_configures 'with max_allowed_address_pair defined'
it_configures 'when disabling vlan_transparent'
it_configures 'when enabling vlan_transparent'
context 'with amqp messaging' do context 'with amqp messaging' do
it_configures 'amqp support' it_configures 'amqp support'
@ -112,6 +114,7 @@ describe 'neutron' do
is_expected.to contain_neutron_config('oslo_concurrency/lock_path').with_value('$state_path/lock') is_expected.to contain_neutron_config('oslo_concurrency/lock_path').with_value('$state_path/lock')
is_expected.to contain_neutron_config('DEFAULT/transport_url').with_value('<SERVICE DEFAULT>') is_expected.to contain_neutron_config('DEFAULT/transport_url').with_value('<SERVICE DEFAULT>')
is_expected.to contain_neutron_config('DEFAULT/rpc_response_timeout').with_value('<SERVICE DEFAULT>') is_expected.to contain_neutron_config('DEFAULT/rpc_response_timeout').with_value('<SERVICE DEFAULT>')
is_expected.to contain_neutron_config('DEFAULT/vlan_transparent').with_value('<SERVICE DEFAULT>')
is_expected.to contain_neutron_config('agent/root_helper').with_value('sudo neutron-rootwrap /etc/neutron/rootwrap.conf') is_expected.to contain_neutron_config('agent/root_helper').with_value('sudo neutron-rootwrap /etc/neutron/rootwrap.conf')
is_expected.to contain_neutron_config('agent/root_helper_daemon').with_value('<SERVICE DEFAULT>') is_expected.to contain_neutron_config('agent/root_helper_daemon').with_value('<SERVICE DEFAULT>')
is_expected.to contain_neutron_config('agent/report_interval').with_value('<SERVICE DEFAULT>') is_expected.to contain_neutron_config('agent/report_interval').with_value('<SERVICE DEFAULT>')
@ -334,6 +337,28 @@ describe 'neutron' do
} }
end end
shared_examples_for 'when disabling vlan_transparent' do
before do
params.merge!(
:vlan_transparent => false
)
end
it do
is_expected.to contain_neutron_config('DEFAULT/vlan_transparent').with_value(false)
end
end
shared_examples_for 'when enabling vlan_transparent' do
before do
params.merge!(
:vlan_transparent => true
)
end
it do
is_expected.to contain_neutron_config('DEFAULT/vlan_transparent').with_value(true)
end
end
shared_examples_for 'without service_plugins' do shared_examples_for 'without service_plugins' do
it { is_expected.not_to contain_neutron_config('DEFAULT/service_plugins') } it { is_expected.not_to contain_neutron_config('DEFAULT/service_plugins') }
end end