fd4485d64e
Ceilometer supports multiple notifications. The config entry in ceilometer.conf allows for a multi-value for notification/messaging_urls. Change-Id: Ic1791c7021bf2dbb06269317b8495eebc8d6e7ed Closes-Bug: 1564061
73 lines
1.7 KiB
Ruby
73 lines
1.7 KiB
Ruby
$LOAD_PATH.push(
|
|
File.join(
|
|
File.dirname(__FILE__),
|
|
'..',
|
|
'..',
|
|
'..',
|
|
'fixtures',
|
|
'modules',
|
|
'inifile',
|
|
'lib')
|
|
)
|
|
$LOAD_PATH.push(
|
|
File.join(
|
|
File.dirname(__FILE__),
|
|
'..',
|
|
'..',
|
|
'..',
|
|
'fixtures',
|
|
'modules',
|
|
'openstacklib',
|
|
'lib')
|
|
)
|
|
|
|
require 'spec_helper'
|
|
|
|
provider_class = Puppet::Type.type(:ceilometer_config).provider(:openstackconfig)
|
|
|
|
describe provider_class do
|
|
|
|
it 'should default to the default setting when no other one is specified' do
|
|
resource = Puppet::Type::Ceilometer_config.new(
|
|
{
|
|
:name => 'DEFAULT/foo',
|
|
:value => 'bar'
|
|
}
|
|
)
|
|
provider = provider_class.new(resource)
|
|
expect(provider.section).to eq('DEFAULT')
|
|
expect(provider.setting).to eq('foo')
|
|
end
|
|
|
|
it 'should allow setting to be set explicitly' do
|
|
resource = Puppet::Type::Ceilometer_config.new(
|
|
{
|
|
:name => 'dude/foo',
|
|
:value => 'bar'
|
|
}
|
|
)
|
|
provider = provider_class.new(resource)
|
|
expect(provider.section).to eq('dude')
|
|
expect(provider.setting).to eq('foo')
|
|
end
|
|
|
|
it 'should ensure absent when <SERVICE DEFAULT> is specified as a value' do
|
|
resource = Puppet::Type::Ceilometer_config.new(
|
|
{:name => 'dude/foo', :value => '<SERVICE DEFAULT>'}
|
|
)
|
|
provider = provider_class.new(resource)
|
|
provider.exists?
|
|
expect(resource[:ensure]).to eq :absent
|
|
end
|
|
|
|
it 'should ensure absent when value matches ensure_absent_val' do
|
|
resource = Puppet::Type::Ceilometer_config.new(
|
|
{:name => 'dude/foo', :value => 'foo', :ensure_absent_val => 'foo' }
|
|
)
|
|
provider = provider_class.new(resource)
|
|
provider.exists?
|
|
expect(resource[:ensure]).to eq :absent
|
|
end
|
|
|
|
end
|