Merge "OVN: Add DVR configuration support"

This commit is contained in:
Zuul 2017-12-27 18:23:44 +00:00 committed by Gerrit Code Review
commit bcb2a54cb4
2 changed files with 18 additions and 0 deletions

View File

@ -47,6 +47,11 @@
# (optional) Whether to enable metadata service in OVN.
# Type: boolean
# Defaults to $::os_service_default
#
# [*dvr_enabled*]
# (optional) Whether to enable DVR.
# Type: boolean
# Defaults to $::os_service_default
class neutron::plugins::ml2::ovn(
$ovn_nb_connection = $::os_service_default,
@ -57,6 +62,7 @@ class neutron::plugins::ml2::ovn(
$ovn_l3_mode = $::os_service_default,
$vif_type = $::os_service_default,
$ovn_metadata_enabled = $::os_service_default,
$dvr_enabled = $::os_service_default,
) {
include ::neutron::deps
@ -89,5 +95,6 @@ class neutron::plugins::ml2::ovn(
'ovn/ovn_l3_mode' : value => $ovn_l3_mode;
'ovn/vif_type' : value => $vif_type;
'ovn/ovn_metadata_enabled' : value => $ovn_metadata_enabled;
'ovn/enable_distributed_floating_ip' : value => $dvr_enabled;
}
}

View File

@ -18,6 +18,7 @@ describe 'neutron::plugins::ml2::ovn' do
:neutron_sync_mode => 'log',
:ovn_l3_mode => true,
:vif_type => 'ovs',
:dvr_enabled => false,
}
end
@ -44,6 +45,7 @@ describe 'neutron::plugins::ml2::ovn' do
is_expected.to contain_neutron_plugin_ml2('ovn/neutron_sync_mode').with_value(params[:neutron_sync_mode])
is_expected.to contain_neutron_plugin_ml2('ovn/ovn_l3_mode').with_value(params[:ovn_l3_mode])
is_expected.to contain_neutron_plugin_ml2('ovn/vif_type').with_value(params[:vif_type])
is_expected.to contain_neutron_plugin_ml2('ovn/enable_distributed_floating_ip').with_value(params[:dvr_enabled])
end
end
@ -69,6 +71,15 @@ describe 'neutron::plugins::ml2::ovn' do
params.delete(:vif_type)
is_expected.to contain_neutron_plugin_ml2('ovn/vif_type').with_value('<SERVICE DEFAULT>')
end
context 'with DVR' do
before :each do
params.merge!(:dvr_enabled => true)
end
it 'should enable DVR mode' do
is_expected.to contain_neutron_plugin_ml2('ovn/enable_distributed_floating_ip').with_value(params[:dvr_enabled])
end
end
end
on_supported_os({