2013-04-15 01:31:19 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2013-08-05 13:20:54 -04:00
|
|
|
describe 'neutron::plugins::linuxbridge' do
|
2013-04-15 01:31:19 -04:00
|
|
|
|
|
|
|
let :pre_condition do
|
2013-08-05 13:20:54 -04:00
|
|
|
"class { 'neutron': rabbit_password => 'passw0rd' }"
|
2013-04-15 01:31:19 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
let :params do
|
2013-10-31 17:33:36 +00:00
|
|
|
{ :sql_connection => false,
|
2013-04-15 01:31:19 -04:00
|
|
|
:network_vlan_ranges => 'physnet0:100:109',
|
|
|
|
:tenant_network_type => 'vlan',
|
|
|
|
:package_ensure => 'installed'
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
2013-08-05 13:20:54 -04:00
|
|
|
shared_examples_for 'neutron linuxbridge plugin' do
|
2013-04-15 01:31:19 -04:00
|
|
|
|
2013-12-16 11:43:20 -06:00
|
|
|
it { should contain_class('neutron::params') }
|
2013-04-15 01:31:19 -04:00
|
|
|
|
2013-08-05 13:20:54 -04:00
|
|
|
it 'installs neutron linuxbridge plugin package' do
|
|
|
|
should contain_package('neutron-plugin-linuxbridge').with(
|
2013-04-15 01:31:19 -04:00
|
|
|
:ensure => params[:package_ensure],
|
|
|
|
:name => platform_params[:linuxbridge_plugin_package]
|
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'configures linuxbridge_conf.ini' do
|
2013-08-05 13:20:54 -04:00
|
|
|
should contain_neutron_plugin_linuxbridge('VLANS/tenant_network_type').with(
|
2013-04-15 01:31:19 -04:00
|
|
|
:value => params[:tenant_network_type]
|
|
|
|
)
|
2013-08-05 13:20:54 -04:00
|
|
|
should contain_neutron_plugin_linuxbridge('VLANS/network_vlan_ranges').with(
|
2013-04-15 01:31:19 -04:00
|
|
|
:value => params[:network_vlan_ranges]
|
|
|
|
)
|
|
|
|
end
|
2014-02-03 13:28:03 +01:00
|
|
|
|
|
|
|
it 'should create plugin symbolic link' do
|
|
|
|
should contain_file('/etc/neutron/plugin.ini').with(
|
|
|
|
:ensure => 'link',
|
|
|
|
:target => '/etc/neutron/plugins/linuxbridge/linuxbridge_conf.ini',
|
|
|
|
:require => 'Package[neutron-plugin-linuxbridge]'
|
|
|
|
)
|
|
|
|
end
|
2013-04-15 01:31:19 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
context 'on Debian platforms' do
|
|
|
|
let :facts do
|
|
|
|
{ :osfamily => 'Debian' }
|
|
|
|
end
|
|
|
|
|
|
|
|
let :platform_params do
|
2013-08-05 13:20:54 -04:00
|
|
|
{ :linuxbridge_plugin_package => 'neutron-plugin-linuxbridge' }
|
2013-04-15 01:31:19 -04:00
|
|
|
end
|
|
|
|
|
2014-09-19 20:01:37 -04:00
|
|
|
context 'on Ubuntu operating systems' do
|
|
|
|
before do
|
|
|
|
facts.merge!({:operatingsystem => 'Ubuntu'})
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'configures /etc/default/neutron-server' do
|
|
|
|
should contain_file_line('/etc/default/neutron-server:NEUTRON_PLUGIN_CONFIG').with(
|
|
|
|
:path => '/etc/default/neutron-server',
|
|
|
|
:match => '^NEUTRON_PLUGIN_CONFIG=(.*)$',
|
|
|
|
:line => 'NEUTRON_PLUGIN_CONFIG=/etc/neutron/plugins/linuxbridge/linuxbridge_conf.ini',
|
|
|
|
:require => ['Package[neutron-plugin-linuxbridge]', 'Package[neutron-server]'],
|
|
|
|
:notify => 'Service[neutron-server]'
|
|
|
|
)
|
|
|
|
end
|
|
|
|
it_configures 'neutron linuxbridge plugin'
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'on Debian operating systems' do
|
|
|
|
before do
|
|
|
|
facts.merge!({:operatingsystem => 'Debian'})
|
|
|
|
end
|
|
|
|
|
|
|
|
it_configures 'neutron linuxbridge plugin'
|
2013-05-09 19:25:31 -06:00
|
|
|
end
|
2013-04-15 01:31:19 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
context 'on RedHat platforms' do
|
|
|
|
let :facts do
|
|
|
|
{ :osfamily => 'RedHat' }
|
|
|
|
end
|
|
|
|
|
|
|
|
let :platform_params do
|
2013-08-05 13:20:54 -04:00
|
|
|
{ :linuxbridge_plugin_package => 'openstack-neutron-linuxbridge' }
|
2013-04-15 01:31:19 -04:00
|
|
|
end
|
|
|
|
|
2013-08-05 13:20:54 -04:00
|
|
|
it_configures 'neutron linuxbridge plugin'
|
2013-04-15 01:31:19 -04:00
|
|
|
end
|
|
|
|
end
|