puppet-manila/spec/defines/manila_network_neutron_network_spec.rb
Takashi Kajinami d7ecfc750f Support NeutronNetworkPlugin options
Change-Id: I39f3758379a724b07a11e827be3af520ef2cd3f2
2024-10-18 22:25:59 +09:00

62 lines
1.9 KiB
Ruby

require 'spec_helper'
describe 'manila::network::neutron_network' do
let(:title) do
'neutronnet'
end
let :params do
{
:neutron_physical_net_name => 'br-ex',
}
end
shared_examples 'manila::network::neutron_network' do
context 'with required parameters' do
it 'configures neutron single network plugin' do
is_expected.to contain_manila_config("neutronnet/network_api_class").with_value(
'manila.network.neutron.neutron_network_plugin.NeutronNetworkPlugin')
is_expected.to contain_manila_config('neutronnet/neutron_physical_net_name')\
.with_value('br-ex')
is_expected.to contain_manila_config('neutronnet/network_plugin_ipv4_enabled')\
.with_value('<SERVICE DEFAULT>')
is_expected.to contain_manila_config('neutronnet/network_plugin_ipv6_enabled')\
.with_value('<SERVICE DEFAULT>')
end
end
context 'with custom parameters' do
before do
params.merge!({
:network_plugin_ipv4_enabled => true,
:network_plugin_ipv6_enabled => false,
})
end
it 'configures neutron single network plugin' do
is_expected.to contain_manila_config("neutronnet/network_api_class").with_value(
'manila.network.neutron.neutron_network_plugin.NeutronNetworkPlugin')
is_expected.to contain_manila_config('neutronnet/neutron_physical_net_name')\
.with_value('br-ex')
is_expected.to contain_manila_config('neutronnet/network_plugin_ipv4_enabled')\
.with_value(true)
is_expected.to contain_manila_config('neutronnet/network_plugin_ipv6_enabled')\
.with_value(false)
end
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
it_behaves_like 'manila::network::neutron_network'
end
end
end