Merge "Allow deployment when DVR is enabled and L2 pop and tunneling are disabled"

This commit is contained in:
Jenkins 2015-08-18 15:40:00 +00:00 committed by Gerrit Code Review
commit bff7f0f5d6
2 changed files with 20 additions and 5 deletions

View File

@ -118,8 +118,8 @@ class neutron::agents::ml2::ovs (
fail('Local ip for ovs agent must be set when tunneling is enabled')
}
if $enable_distributed_routing and ! $l2_population {
fail('L2 population must be enabled when DVR is enabled')
if $enable_tunneling and $enable_distributed_routing and ! $l2_population {
fail('L2 population must be enabled when DVR and tunneling are enabled')
}
Package['neutron-ovs-agent'] -> Neutron_agent_ovs<||>

View File

@ -165,13 +165,28 @@ describe 'neutron::agents::ml2::ovs' do
end
end
context 'when l2 population is disabled and DVR enabled' do
context 'when l2 population is disabled and DVR and tunneling enabled' do
before :each do
params.merge!(:enable_distributed_routing => true,
:l2_population => false )
:l2_population => false,
:enable_tunneling => true,
:local_ip => '127.0.0.1' )
end
it_raises 'a Puppet::Error', /L2 population must be enabled when DVR is enabled/
it_raises 'a Puppet::Error', /L2 population must be enabled when DVR and tunneling are enabled/
end
context 'when DVR is enabled and l2 population and tunneling are disabled' do
before :each do
params.merge!(:enable_distributed_routing => true,
:l2_population => false,
:enable_tunneling => false )
end
it 'should enable DVR without L2 population' do
is_expected.to contain_neutron_agent_ovs('agent/enable_distributed_routing').with_value(true)
is_expected.to contain_neutron_agent_ovs('agent/l2_population').with_value(false)
end
end
end
end