| 1 |
require 'spec_helper' |
| 2 |
|
| 3 |
describe 'nova::compute::ironic' do |
| 4 |
|
| 5 |
shared_examples_for 'nova::compute::ironic' do |
| 6 |
context 'with default parameters' do |
| 7 |
it 'configures ironic in nova.conf' do |
| 8 |
is_expected.to contain_nova_config('DEFAULT/compute_driver').with_value('ironic.IronicDriver') |
| 9 |
end |
| 10 |
end |
| 11 |
|
| 12 |
context 'with overridden parameters' do |
| 13 |
let :params do |
| 14 |
{ |
| 15 |
:compute_driver => 'ironic.FoobarDriver', |
| 16 |
} |
| 17 |
end |
| 18 |
|
| 19 |
it 'configures ironic in nova.conf' do |
| 20 |
is_expected.to contain_nova_config('DEFAULT/compute_driver').with_value('ironic.FoobarDriver') |
| 21 |
end |
| 22 |
end |
| 23 |
end |
| 24 |
|
| 25 |
shared_examples_for 'nova::compute::ironic in Debian' do |
| 26 |
context 'with default parameters' do |
| 27 |
it 'installs nova-compute-ironic' do |
| 28 |
is_expected.to contain_package('nova-compute-ironic').with( |
| 29 |
:ensure => 'present', |
| 30 |
:tag => ['openstack', 'nova-package'], |
| 31 |
) |
| 32 |
end |
| 33 |
end |
| 34 |
end |
| 35 |
|
| 36 |
on_supported_os({ |
| 37 |
:supported_os => OSDefaults.get_supported_os |
| 38 |
}).each do |os,facts| |
| 39 |
context "on #{os}" do |
| 40 |
let (:facts) do |
| 41 |
facts.merge!(OSDefaults.get_facts()) |
| 42 |
end |
| 43 |
|
| 44 |
it_configures 'nova::compute::ironic' |
| 45 |
if facts[:os]['family'] == 'Debian' |
| 46 |
it_configures 'nova::compute::ironic in Debian' |
| 47 |
end |
| 48 |
end |
| 49 |
end |
| 50 |
end |