shared_examples_for 'ceilometer-polling' do
- it { should contain_class('ceilometer::params') }
+ it { is_expected.to contain_class('ceilometer::params') }
context 'when compute_namespace => true' do
it 'adds ceilometer user to nova group and, if required, to libvirt group' do
if platform_params[:libvirt_group]
- should contain_user('ceilometer').with_groups(['nova', "#{platform_params[:libvirt_group]}"])
+ is_expected.to contain_user('ceilometer').with_groups(['nova', "#{platform_params[:libvirt_group]}"])
else
- should contain_user('ceilometer').with_groups('nova')
+ is_expected.to contain_user('ceilometer').with_groups('nova')
end
end
it 'ensures nova-common is installed before the package ceilometer-common' do
- should contain_package('nova-common').with(
+ is_expected.to contain_package('nova-common').with(
:before => /Package\[ceilometer-common\]/
)
end
it 'configures nova notification driver' do
- should contain_file_line_after('nova-notification-driver-common').with(
+ is_expected.to contain_file_line_after('nova-notification-driver-common').with(
:line => 'notification_driver=nova.openstack.common.notifier.rpc_notifier',
:path => '/etc/nova/nova.conf',
:notify => 'Service[nova-compute]'
)
- should contain_file_line_after('nova-notification-driver-ceilometer').with(
+ is_expected.to contain_file_line_after('nova-notification-driver-ceilometer').with(
:line => 'notification_driver=ceilometer.compute.nova_notifier',
:path => '/etc/nova/nova.conf',
:notify => 'Service[nova-compute]'
end
it 'installs ceilometer-polling package' do
- should contain_package('ceilometer-polling').with(
+ is_expected.to contain_package('ceilometer-polling').with(
:ensure => 'latest',
:name => platform_params[:agent_package_name],
:before => /Service\[ceilometer-polling\]/,
end
it 'configures central agent' do
- should contain_ceilometer_config('DEFAULT/polling_namespaces').with_value('central,compute,ipmi')
+ is_expected.to contain_ceilometer_config('DEFAULT/polling_namespaces').with_value('central,compute,ipmi')
end
it 'ensures ceilometer-common is installed before the service' do
- should contain_package('ceilometer-common').with(
+ is_expected.to contain_package('ceilometer-common').with(
:before => /Service\[ceilometer-polling\]/
)
end
end
it 'configures ceilometer-polling service' do
- should contain_service('ceilometer-polling').with(
+ is_expected.to contain_service('ceilometer-polling').with(
:ensure => (params[:manage_service] && params[:enabled]) ? 'running' : 'stopped',
:name => platform_params[:agent_service_name],
:enable => params[:enabled],
end
it 'configures ceilometer-polling service' do
- should contain_service('ceilometer-polling').with(
+ is_expected.to contain_service('ceilometer-polling').with(
:ensure => nil,
:name => platform_params[:agent_service_name],
:enable => false,
end
it 'configures central agent' do
- should contain_ceilometer_config('coordination/backend_url').with_value( params[:coordination_url] )
+ is_expected.to contain_ceilometer_config('coordination/backend_url').with_value( params[:coordination_url] )
end
end
})
end
it 'configures identity_uri' do
- should contain_ceilometer_config('keystone_authtoken/identity_uri').with_value("https://foo.bar:1234/");
+ is_expected.to contain_ceilometer_config('keystone_authtoken/identity_uri').with_value("https://foo.bar:1234/");
# since only auth_uri is set the deprecated auth parameters should
# still get set in case they are still in use
- should contain_ceilometer_config('keystone_authtoken/auth_host').with_value('127.0.0.1');
- should contain_ceilometer_config('keystone_authtoken/auth_port').with_value('35357');
- should contain_ceilometer_config('keystone_authtoken/auth_protocol').with_value('http');
+ is_expected.to contain_ceilometer_config('keystone_authtoken/auth_host').with_value('127.0.0.1');
+ is_expected.to contain_ceilometer_config('keystone_authtoken/auth_port').with_value('35357');
+ is_expected.to contain_ceilometer_config('keystone_authtoken/auth_protocol').with_value('http');
end
end
})
end
it 'configures identity_uri and auth_uri but deprecates old auth settings' do
- should contain_ceilometer_config('keystone_authtoken/identity_uri').with_value("https://foo.bar:35357/");
- should contain_ceilometer_config('keystone_authtoken/auth_uri').with_value("https://foo.bar:5000/v2.0/");
- should contain_ceilometer_config('keystone_authtoken/auth_admin_prefix').with(:ensure => 'absent')
- should contain_ceilometer_config('keystone_authtoken/auth_port').with(:ensure => 'absent')
- should contain_ceilometer_config('keystone_authtoken/auth_protocol').with(:ensure => 'absent')
- should contain_ceilometer_config('keystone_authtoken/auth_host').with(:ensure => 'absent')
+ is_expected.to contain_ceilometer_config('keystone_authtoken/identity_uri').with_value("https://foo.bar:35357/");
+ is_expected.to contain_ceilometer_config('keystone_authtoken/auth_uri').with_value("https://foo.bar:5000/v2.0/");
+ is_expected.to contain_ceilometer_config('keystone_authtoken/auth_admin_prefix').with(:ensure => 'absent')
+ is_expected.to contain_ceilometer_config('keystone_authtoken/auth_port').with(:ensure => 'absent')
+ is_expected.to contain_ceilometer_config('keystone_authtoken/auth_protocol').with(:ensure => 'absent')
+ is_expected.to contain_ceilometer_config('keystone_authtoken/auth_host').with(:ensure => 'absent')
end
end