92 lines
3.0 KiB
Ruby
92 lines
3.0 KiB
Ruby
require 'spec_helper'
|
|
|
|
describe 'ceilometer' do
|
|
|
|
let :params do
|
|
{ :metering_secret => 'metering-s3cr3t',
|
|
:package_ensure => 'present',
|
|
:verbose => 'False',
|
|
:debug => 'False',
|
|
:rabbit_host => '127.0.0.1',
|
|
:rabbit_port => 5672,
|
|
:rabbit_userid => 'guest',
|
|
:rabbit_password => '',
|
|
:rabbit_virtualhost => '/',
|
|
}
|
|
end
|
|
|
|
context 'with all parameters' do
|
|
|
|
it { should include_class('ceilometer::params') }
|
|
|
|
it 'configures ceilometer group' do
|
|
should contain_group('ceilometer').with(
|
|
:name => 'ceilometer',
|
|
:require => 'Package[ceilometer-common]'
|
|
)
|
|
end
|
|
|
|
it 'configures ceilometer user' do
|
|
should contain_user('ceilometer').with(
|
|
:name => 'ceilometer',
|
|
:gid => 'ceilometer',
|
|
:groups => ['nova'],
|
|
:system => true,
|
|
:require => ['Group[ceilometer]', 'Package[ceilometer-common]']
|
|
)
|
|
end
|
|
|
|
it 'configures ceilometer configuration folder' do
|
|
should contain_file('/etc/ceilometer/').with(
|
|
:ensure => 'directory',
|
|
:owner => 'ceilometer',
|
|
:group => 'ceilometer',
|
|
:mode => '0750',
|
|
:require => ['Package[ceilometer-common]', 'User[ceilometer]']
|
|
)
|
|
end
|
|
|
|
it 'configures ceilometer configuration file' do
|
|
should contain_file('/etc/ceilometer/ceilometer.conf').with(
|
|
:ensure => 'file',
|
|
:owner => 'ceilometer',
|
|
:group => 'ceilometer',
|
|
:mode => '0640',
|
|
:require => ['File[/etc/ceilometer]', 'User[ceilometer]']
|
|
)
|
|
end
|
|
|
|
it 'installs ceilometer common package' do
|
|
should contain_package('ceilometer-common').with(
|
|
:ensure => 'present',
|
|
:name => 'ceilometer-common'
|
|
)
|
|
end
|
|
|
|
it 'configures required metering_secret' do
|
|
should contain_ceilometer_config('DEFAULT/metering_secret').with_value('metering-s3cr3t')
|
|
end
|
|
|
|
it 'configures rabbit' do
|
|
should contain_ceilometer_config('DEFAULT/rabbit_host').with_value( params[:rabbit_host] )
|
|
should contain_ceilometer_config('DEFAULT/rabbit_port').with_value( params[:rabbit_port] )
|
|
should contain_ceilometer_config('DEFAULT/rabbit_userid').with_value( params[:rabbit_userid] )
|
|
should contain_ceilometer_config('DEFAULT/rabbit_password').with_value( params[:rabbit_password] )
|
|
should contain_ceilometer_config('DEFAULT/rabbit_virtualhost').with_value( params[:rabbit_virtualhost] )
|
|
end
|
|
|
|
it 'configures debug and verbose' do
|
|
should contain_ceilometer_config('DEFAULT/debug').with_value( params[:debug] )
|
|
should contain_ceilometer_config('DEFAULT/verbose').with_value( params[:verbose] )
|
|
end
|
|
|
|
it 'fixes a bad value in ceilometer (glance_control_exchange)' do
|
|
should contain_ceilometer_config('DEFAULT/glance_control_exchange').with_value('glance')
|
|
end
|
|
|
|
it 'adds glance-notifications topic' do
|
|
should contain_ceilometer_config('DEFAULT/notification_topics').with_value('notifications,glance_notifications')
|
|
end
|
|
end
|
|
end
|