puppet-neutron/spec/unit/provider/neutron_agent_ovs/ini_setting_spec.rb
Gael Chamoulaud 48ae3df855 Configure OVS mechanism agent configs in its config file
Configurations for the OVS agent should go in its config file:
/etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini
but as packaging is broken and different in Ubuntu and Redhat
we have to use new neutron_agent_ovs provider to configure
ovs agent correctly.

Therefore, we should not remove the agent config file and
replace it with a symlink to plugin.ini or ml2_conf.ini.

Those config files are meant to be used by the core plugin itself
in neutron-server, not the agents themselves.

- Remove symlink creation from ovs_neutron_plugin.ini to plugin.ini
- Use neutron_agent_ovs to configure OVS mechanism agent configs

Change-Id: I53d9b923784587e8a2a934f004a3b054c716daaa
Signed-off-by: Gael Chamoulaud <gchamoul@redhat.com>
2015-04-14 06:57:40 +02:00

46 lines
1.2 KiB
Ruby

$LOAD_PATH.push(
File.join(
File.dirname(__FILE__),
'..',
'..',
'..',
'fixtures',
'modules',
'inifile',
'lib')
)
require 'spec_helper'
provider_class = Puppet::Type.type(:neutron_agent_ovs).provider(:ini_setting)
describe provider_class do
let(:resource ) do
Puppet::Type::Neutron_agent_ovs.new({
:name => 'DEFAULT/foo',
:value => 'bar',
})
end
let (:provider) { resource.provider }
[ 'RedHat', 'Debian' ].each do |os|
context "on #{os} with default setting" do
it 'it should fall back to default and use ovs_neutron_plugin.ini' do
Facter.fact(:operatingsystem).stubs(:value).returns("#{os}")
expect(provider.section).to eq('DEFAULT')
expect(provider.setting).to eq('foo')
expect(provider.file_path).to eq('/etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini')
end
end
end
context 'on Ubuntu with default setting' do
it 'it should fall back to default and use ml2_conf.ini' do
Facter.fact(:operatingsystem).stubs(:value).returns('Ubuntu')
expect(provider.section).to eq('DEFAULT')
expect(provider.setting).to eq('foo')
expect(provider.file_path).to eq('/etc/neutron/plugins/ml2/ml2_conf.ini')
end
end
end