puppet-neutron/spec/classes/neutron_plugins_ml2_bagpipe_spec.rb
Ricardo Noriega 5393b9beb8 Refactor Bagpipe driver support for including ML2 plugin configuration
Bagpipe driver requires two configurations for a BGPVPN scenario.
  One is related to the bagpipe-bgp service which reads bgp.conf and
  the other related to the ml2 plugin extension.

Change-Id: Ic975ec1d6b2bf6e6bd28b47ba9dd2a3ae629d149
Signed-off-by: Ricardo Noriega <rnoriega@redhat.com>
2017-04-17 11:41:53 +02:00

64 lines
1.5 KiB
Ruby

require 'spec_helper'
describe 'neutron::plugins::ml2::bagpipe' do
let :default_params do
{
:bagpipe_bgp_port => '<SERVICE DEFAULT>',
:mpls_bridge => '<SERVICE DEFAULT>',
:package_ensure => 'present',
}
end
let :params do
{
}
end
let :test_facts do
{
:operatingsystem => 'default',
:operatingsystemrelease => 'default',
}
end
shared_examples_for 'neutron plugin bagpipe ml2' do
before do
params.merge!(default_params)
end
it 'should have' do
is_expected.to contain_package('python-networking-bagpipe').with(
:ensure => params[:package_ensure],
:tag => 'openstack'
)
end
it 'configures bagpipe settings' do
is_expected.to contain_neutron_plugin_ml2('bagpipe/bagpipe_bgp_port').with_value(params[:bagpipe_bgp_port])
is_expected.to contain_neutron_plugin_ml2('bagpipe/mpls_bridge').with_value(params[:mpls_bridge])
end
end
on_supported_os({
:supported_os => OSDefaults.get_supported_os
}).each do |os,facts|
context "on #{os}" do
let (:facts) do
facts.merge(OSDefaults.get_facts())
end
let (:platform_params) do
case facts[:osfamily]
when 'RedHat'
{ :bagpipe_package_name => 'python-networking-bagpipe' }
when 'Debian'
{ :bagpipe_package_name => 'python-networking-bagpipe' }
end
end
it_configures 'neutron plugin bagpipe ml2'
end
end
end