puppet-neutron/spec/classes/neutron_plugins_ml2_opendaylight_spec.rb
Takashi Kajinami 90277442a1 Add missing dependencies about ml2 plugins
neutron::plugins::ml2::netwokring_ansible should be applied after
neutron::plugins::ml2, otherwise purge_config can remove the parameters
unexpectedly.
Also, all plugin packages should be install before configuration
completes, otherwise these packages can be missing when actual
code should be referred.

Change-Id: Ide4e65b6deac381df954341adbb804c9432d8643
2020-05-05 14:42:45 +09:00

70 lines
2.1 KiB
Ruby

require 'spec_helper'
describe 'neutron::plugins::ml2::opendaylight' do
let :pre_condition do
"class { 'neutron::keystone::authtoken':
password => 'passw0rd',
}
class { 'neutron::server': }
class { 'neutron':
core_plugin => 'ml2'
}"
end
let :default_params do
{
:package_ensure => 'present',
:odl_url => '<SERVICE DEFAULT>',
:ovsdb_connection => 'tcp:127.0.0.1:6639',
:port_binding_controller => '<SERVICE DEFAULT>',
:odl_hostconf_uri => '<SERVICE DEFAULT>',
:odl_features => '<SERVICE DEFAULT>',
}
end
let :params do
{
:odl_username => 'user',
:odl_password => 'password',
}
end
shared_examples 'neutron plugin opendaylight ml2' do
before do
params.merge!(default_params)
end
it 'should have' do
should contain_package('python-networking-odl').with(
:ensure => params[:package_ensure],
:tag => ['openstack', 'neutron-plugin-ml2-package']
)
end
it 'configures ml2_odl settings' do
should contain_neutron_plugin_ml2('ml2_odl/password').with_value(params[:odl_password]).with_secret(true)
should contain_neutron_plugin_ml2('ml2_odl/username').with_value(params[:odl_username])
should contain_neutron_plugin_ml2('ml2_odl/url').with_value(params[:odl_url])
should contain_neutron_plugin_ml2('ml2_odl/port_binding_controller').with_value(params[:port_binding_controller])
should contain_neutron_plugin_ml2('ml2_odl/odl_hostconf_uri').with_value(params[:odl_hostconf_uri])
should contain_neutron_plugin_ml2('ml2_odl/odl_features').with_value(params[:odl_features])
end
it 'configures neutron server settings' do
should contain_neutron_config('OVS/ovsdb_connection').with_value(params[:ovsdb_connection])
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 'neutron plugin opendaylight ml2'
end
end
end