X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;ds=sidebyside;f=3rdparty%2Fmodules%2Fneutron%2Fspec%2Fclasses%2Fneutron_plugins_midonet_spec.rb;fp=3rdparty%2Fmodules%2Fneutron%2Fspec%2Fclasses%2Fneutron_plugins_midonet_spec.rb;h=197da93ed2e25b0ee76fa0077ea60310357d6bbf;hb=4631045ebb77ee8622f6fa09277a50c372bcc02e;hp=0000000000000000000000000000000000000000;hpb=3d4dc4fd9e59bd0e07646c99f6b356c7d9d859aa;p=dsa-puppet.git diff --git a/3rdparty/modules/neutron/spec/classes/neutron_plugins_midonet_spec.rb b/3rdparty/modules/neutron/spec/classes/neutron_plugins_midonet_spec.rb new file mode 100644 index 00000000..197da93e --- /dev/null +++ b/3rdparty/modules/neutron/spec/classes/neutron_plugins_midonet_spec.rb @@ -0,0 +1,71 @@ +require 'spec_helper' + +describe 'neutron::plugins::midonet' do + + let :pre_condition do + "class { 'neutron::server': auth_password => 'password' } + class { 'neutron': rabbit_password => 'passw0rd' } + package { 'python-neutron-plugin-midonet': }" + end + + let :default_params do + { + :midonet_api_ip => '127.0.0.1', + :midonet_api_port => '8080', + :keystone_username => 'neutron', + :keystone_password => 'test_midonet', + :keystone_tenant => 'services' + } + end + + shared_examples_for 'neutron midonet plugin' do + + let :params do + {} + end + + before do + params.merge!(default_params) + end + + it 'should create plugin symbolic link' do + should contain_file('/etc/neutron/plugin.ini').with( + :ensure => 'link', + :target => '/etc/neutron/plugins/midonet/midonet.ini', + :require => 'Package[python-neutron-plugin-midonet]') + end + + it 'should perform default configuration of' do + midonet_uri = "http://" + params[:midonet_api_ip] + ":" + params[:midonet_api_port] + "/midonet-api"; + should contain_neutron_plugin_midonet('MIDONET/midonet_uri').with_value(midonet_uri) + should contain_neutron_plugin_midonet('MIDONET/username').with_value(params[:keystone_username]) + should contain_neutron_plugin_midonet('MIDONET/password').with_value(params[:keystone_password]) + should contain_neutron_plugin_midonet('MIDONET/project_id').with_value(params[:keystone_tenant]) + end + + end + + context 'on Debian platforms' do + let :facts do + { :osfamily => 'Debian'} + 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/midonet/midonet.ini', + :require => ['Package[neutron-server]', 'Package[python-neutron-plugin-midonet]'], + :notify => 'Service[neutron-server]' + ) + end + it_configures 'neutron midonet plugin' + end + + context 'on RedHat platforms' do + let :facts do + { :osfamily => 'RedHat'} + end + it_configures 'neutron midonet plugin' + end + +end