add a context for simplify nova-scheduler filters test
This commit is contained in:
parent
95caf7e19b
commit
e8522141e4
@ -43,6 +43,12 @@ describe 'cloud::compute::scheduler' do
|
|||||||
log_facility => 'LOG_LOCAL0' }"
|
log_facility => 'LOG_LOCAL0' }"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
let :params do
|
||||||
|
{
|
||||||
|
:scheduler_default_filters => false
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
it 'configure nova common' do
|
it 'configure nova common' do
|
||||||
should contain_class('nova').with(
|
should contain_class('nova').with(
|
||||||
:verbose => true,
|
:verbose => true,
|
||||||
@ -86,31 +92,17 @@ describe 'cloud::compute::scheduler' do
|
|||||||
should contain_class('nova::scheduler').with(:enabled => true)
|
should contain_class('nova::scheduler').with(:enabled => true)
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
context 'openstack compute scheduler with nova-scheduler filters' do
|
||||||
|
before do
|
||||||
shared_examples_for 'openstack compute scheduler with nova-scheduler filters' do
|
params.merge!(
|
||||||
let :params do
|
:scheduler_default_filters => ['RamFilter', 'ComputeFilter']
|
||||||
{ :scheduler_default_filters => ['RamFilter', 'ComputeFilter'] }
|
)
|
||||||
end
|
end
|
||||||
|
it { should contain_nova_config('DEFAULT/scheduler_default_filters').with(
|
||||||
it 'configure nova-scheduler filters' do
|
|
||||||
should contain_class('nova::scheduler::filter').with(
|
|
||||||
:scheduler_default_filters => ['RamFilter', 'ComputeFilter']
|
|
||||||
)
|
|
||||||
should contain_nova_config('DEFAULT/scheduler_default_filters').with(
|
|
||||||
'value' => "RamFilter,ComputeFilter"
|
'value' => "RamFilter,ComputeFilter"
|
||||||
)
|
)}
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
shared_examples_for 'openstack compute scheduler without nova-scheduler filters' do
|
|
||||||
|
|
||||||
it 'not configure nova-scheduler filters' do
|
|
||||||
should contain_class('nova::scheduler::filter').with(
|
|
||||||
:scheduler_default_filters => false
|
|
||||||
)
|
|
||||||
should_not contain_nova_config('scheduler_default_filters')
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'on Debian platforms' do
|
context 'on Debian platforms' do
|
||||||
@ -119,18 +111,6 @@ describe 'cloud::compute::scheduler' do
|
|||||||
end
|
end
|
||||||
|
|
||||||
it_configures 'openstack compute scheduler'
|
it_configures 'openstack compute scheduler'
|
||||||
it_configures 'openstack compute scheduler without nova-scheduler filters'
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
context 'on Debian platforms with nova-scheduler filters' do
|
|
||||||
let :facts do
|
|
||||||
{ :osfamily => 'Debian' }
|
|
||||||
end
|
|
||||||
|
|
||||||
it_configures 'openstack compute scheduler'
|
|
||||||
it_configures 'openstack compute scheduler with nova-scheduler filters'
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'on RedHat platforms' do
|
context 'on RedHat platforms' do
|
||||||
@ -138,16 +118,6 @@ describe 'cloud::compute::scheduler' do
|
|||||||
{ :osfamily => 'RedHat' }
|
{ :osfamily => 'RedHat' }
|
||||||
end
|
end
|
||||||
it_configures 'openstack compute scheduler'
|
it_configures 'openstack compute scheduler'
|
||||||
it_configures 'openstack compute scheduler without nova-scheduler filters'
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
context 'on RedHat platforms with nova-scheduler filters' do
|
|
||||||
let :facts do
|
|
||||||
{ :osfamily => 'RedHat' }
|
|
||||||
end
|
|
||||||
it_configures 'openstack compute scheduler'
|
|
||||||
it_configures 'openstack compute scheduler with nova-scheduler filters'
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user