| 1 |
require 'spec_helper' |
| 2 |
|
| 3 |
describe 'nova::config' do |
| 4 |
let(:config_hash) do { |
| 5 |
'DEFAULT/foo' => { 'value' => 'fooValue' }, |
| 6 |
'DEFAULT/bar' => { 'value' => 'barValue' }, |
| 7 |
'DEFAULT/baz' => { 'ensure' => 'absent' } |
| 8 |
} |
| 9 |
end |
| 10 |
|
| 11 |
shared_examples 'nova_config' do |
| 12 |
let :params do |
| 13 |
{ :nova_config => config_hash } |
| 14 |
end |
| 15 |
|
| 16 |
it { is_expected.to contain_class('nova::deps') } |
| 17 |
|
| 18 |
it 'configures arbitrary nova-config configurations' do |
| 19 |
is_expected.to contain_nova_config('DEFAULT/foo').with_value('fooValue') |
| 20 |
is_expected.to contain_nova_config('DEFAULT/bar').with_value('barValue') |
| 21 |
is_expected.to contain_nova_config('DEFAULT/baz').with_ensure('absent') |
| 22 |
end |
| 23 |
end |
| 24 |
|
| 25 |
shared_examples 'nova_api_paste_ini' do |
| 26 |
let :params do |
| 27 |
{ :nova_api_paste_ini => config_hash } |
| 28 |
end |
| 29 |
|
| 30 |
it 'configures arbitrary nova-api-paste-ini configurations' do |
| 31 |
is_expected.to contain_nova_api_paste_ini('DEFAULT/foo').with_value('fooValue') |
| 32 |
is_expected.to contain_nova_api_paste_ini('DEFAULT/bar').with_value('barValue') |
| 33 |
is_expected.to contain_nova_api_paste_ini('DEFAULT/baz').with_ensure('absent') |
| 34 |
end |
| 35 |
end |
| 36 |
|
| 37 |
shared_examples 'nova_rootwrap_config' do |
| 38 |
let :params do |
| 39 |
{ :nova_rootwrap_config => config_hash } |
| 40 |
end |
| 41 |
|
| 42 |
it 'configures arbitrary nova-rootwrap-config configurations' do |
| 43 |
is_expected.to contain_nova_rootwrap_config('DEFAULT/foo').with_value('fooValue') |
| 44 |
is_expected.to contain_nova_rootwrap_config('DEFAULT/bar').with_value('barValue') |
| 45 |
is_expected.to contain_nova_rootwrap_config('DEFAULT/baz').with_ensure('absent') |
| 46 |
end |
| 47 |
end |
| 48 |
|
| 49 |
on_supported_os({ |
| 50 |
:supported_os => OSDefaults.get_supported_os |
| 51 |
}).each do |os,facts| |
| 52 |
context "on #{os}" do |
| 53 |
let (:facts) do |
| 54 |
facts.merge!(OSDefaults.get_facts()) |
| 55 |
end |
| 56 |
|
| 57 |
it_behaves_like 'nova_config' |
| 58 |
it_behaves_like 'nova_api_paste_ini' |
| 59 |
it_behaves_like 'nova_rootwrap_config' |
| 60 |
end |
| 61 |
end |
| 62 |
end |