
This commit updates the default value for enable for nova components to default to true, instead of false. Without this change the nova service is not enabled by default resulting in a different behavior than with other puppet openstack modules. Associated tests are updated to expect the change in defaults. Co-Authored-By: Cody Herriges <cody@puppetlabs.com> Change-Id: I49fc84f9fedfe00d7846441e1b49334abb09e0eb Closes-bug: #1220473
106 lines
2.9 KiB
Ruby
106 lines
2.9 KiB
Ruby
require 'spec_helper'
|
|
|
|
describe 'nova::scheduler' do
|
|
|
|
let :pre_condition do
|
|
'include nova'
|
|
end
|
|
|
|
shared_examples 'nova-scheduler' do
|
|
|
|
|
|
it { is_expected.to contain_package('nova-scheduler').with(
|
|
:name => platform_params[:scheduler_package_name],
|
|
:ensure => 'present'
|
|
) }
|
|
|
|
it { is_expected.to contain_service('nova-scheduler').with(
|
|
:name => platform_params[:scheduler_service_name],
|
|
:hasstatus => 'true',
|
|
:ensure => 'running'
|
|
)}
|
|
|
|
it { is_expected.to contain_nova_config('DEFAULT/scheduler_driver').with_value('nova.scheduler.filter_scheduler.FilterScheduler') }
|
|
|
|
context 'with manage_service as false' do
|
|
let :params do
|
|
{ :enabled => true,
|
|
:manage_service => false
|
|
}
|
|
end
|
|
it { is_expected.to contain_service('nova-scheduler').without_ensure }
|
|
end
|
|
|
|
context 'with package version' do
|
|
let :params do
|
|
{ :ensure_package => '2012.1-2' }
|
|
end
|
|
|
|
it { is_expected.to contain_package('nova-scheduler').with(
|
|
:ensure => params[:ensure_package]
|
|
)}
|
|
end
|
|
|
|
context 'with scheduler driver' do
|
|
let :params do
|
|
{ :scheduler_driver => 'custom driver' }
|
|
end
|
|
|
|
it { is_expected.to contain_nova_config('DEFAULT/scheduler_driver').with_value('custom driver') }
|
|
end
|
|
|
|
context 'with default database parameters' do
|
|
let :pre_condition do
|
|
"include nova"
|
|
end
|
|
|
|
it { is_expected.to_not contain_nova_config('database/connection') }
|
|
it { is_expected.to_not contain_nova_config('database/slave_connection') }
|
|
it { is_expected.to_not contain_nova_config('database/idle_timeout').with_value('3600') }
|
|
end
|
|
|
|
context 'with overridden database parameters' do
|
|
let :pre_condition do
|
|
"class { 'nova':
|
|
database_connection => 'mysql://user:pass@db/db',
|
|
slave_connection => 'mysql://user:pass@slave/db',
|
|
database_idle_timeout => '30',
|
|
}
|
|
"
|
|
end
|
|
|
|
it { is_expected.to contain_nova_config('database/connection').with_value('mysql://user:pass@db/db').with_secret(true) }
|
|
it { is_expected.to contain_nova_config('database/slave_connection').with_value('mysql://user:pass@slave/db').with_secret(true) }
|
|
it { is_expected.to contain_nova_config('database/idle_timeout').with_value('30') }
|
|
end
|
|
|
|
end
|
|
|
|
context 'on Debian platforms' do
|
|
let :facts do
|
|
{ :osfamily => 'Debian' }
|
|
end
|
|
|
|
let :platform_params do
|
|
{ :scheduler_package_name => 'nova-scheduler',
|
|
:scheduler_service_name => 'nova-scheduler' }
|
|
end
|
|
|
|
it_configures 'nova-scheduler'
|
|
end
|
|
|
|
context 'on Redhat platforms' do
|
|
let :facts do
|
|
{ :osfamily => 'RedHat' }
|
|
end
|
|
|
|
let :platform_params do
|
|
{ :scheduler_package_name => 'openstack-nova-scheduler',
|
|
:scheduler_service_name => 'openstack-nova-scheduler' }
|
|
end
|
|
|
|
it_configures 'nova-scheduler'
|
|
end
|
|
|
|
end
|