3 describe 'neutron::plugins::nvp' do
7 rabbit_password => 'passw0rd',
8 core_plugin => 'neutron.plugins.nicira.NeutronPlugin.NvpPluginV2' }"
11 let :default_params do
13 :metadata_mode => 'access_network',
14 :package_ensure => 'present'}
19 :default_tz_uuid => '0344130f-1add-4e86-b36e-ad1c44fe40dc',
20 :nvp_controllers => %w(10.0.0.1 10.0.0.2),
22 :nvp_password => 'password'}
25 let :optional_params do
26 {:default_l3_gw_service_uuid => '0344130f-1add-4e86-b36e-ad1c44fe40dc'}
29 shared_examples_for 'neutron plugin nvp' do
31 default_params.merge(params)
34 it { should contain_class('neutron::params') }
37 should contain_package('neutron-plugin-nvp').with(
38 :name => platform_params[:nvp_server_package],
39 :ensure => p[:package_ensure]
43 it 'should configure neutron.conf' do
44 should contain_neutron_config('DEFAULT/core_plugin').with_value('neutron.plugins.nicira.NeutronPlugin.NvpPluginV2')
47 it 'should create plugin symbolic link' do
48 should contain_file('/etc/neutron/plugin.ini').with(
50 :target => '/etc/neutron/plugins/nicira/nvp.ini',
51 :require => 'Package[neutron-plugin-nvp]'
55 it 'should configure nvp.ini' do
56 should contain_neutron_plugin_nvp('DEFAULT/default_tz_uuid').with_value(p[:default_tz_uuid])
57 should contain_neutron_plugin_nvp('nvp/metadata_mode').with_value(p[:metadata_mode])
58 should contain_neutron_plugin_nvp('DEFAULT/nvp_controllers').with_value(p[:nvp_controllers].join(','))
59 should contain_neutron_plugin_nvp('DEFAULT/nvp_user').with_value(p[:nvp_user])
60 should contain_neutron_plugin_nvp('DEFAULT/nvp_password').with_value(p[:nvp_password])
61 should contain_neutron_plugin_nvp('DEFAULT/nvp_password').with_secret( true )
62 should_not contain_neutron_plugin_nvp('DEFAULT/default_l3_gw_service_uuid').with_value(p[:default_l3_gw_service_uuid])
65 context 'configure nvp with optional params' do
67 params.merge!(optional_params)
70 it 'should configure nvp.ini' do
71 should contain_neutron_plugin_nvp('DEFAULT/default_l3_gw_service_uuid').with_value(params[:default_l3_gw_service_uuid])
75 context 'configure nvp with wrong core_plugin configure' do
78 rabbit_password => 'passw0rd',
79 core_plugin => 'foo' }"
81 it 'should fail to configure nvp because core_plugin should contain NvpPluginV2 class' do
82 expect { subject }.to raise_error(Puppet::Error, /nvp plugin should be the core_plugin in neutron.conf/)
88 context 'on Debian platforms' do
90 {:osfamily => 'Debian'}
93 let :platform_params do
94 { :nvp_server_package => 'neutron-plugin-nicira' }
97 it_configures 'neutron plugin nvp'
100 context 'on RedHat platforms' do
102 {:osfamily => 'RedHat'}
105 let :platform_params do
106 { :nvp_server_package => 'openstack-neutron-nicira' }
109 it_configures 'neutron plugin nvp'