/usr/share/puppet/modules.available/glance/spec/classes/glance_config_spec.rb is in puppet-module-glance 9.4.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 | require 'spec_helper'
describe 'glance::config' do
let(:config_hash) do {
'DEFAULT/foo' => { 'value' => 'fooValue' },
'DEFAULT/bar' => { 'value' => 'barValue' },
'DEFAULT/baz' => { 'ensure' => 'absent' }
}
end
shared_examples_for 'glance_api_config' do
let :params do
{ :api_config => config_hash,
:api_paste_ini_config => config_hash }
end
it 'configures arbitrary glance-api configurations' do
is_expected.to contain_glance_api_config('DEFAULT/foo').with_value('fooValue')
is_expected.to contain_glance_api_config('DEFAULT/bar').with_value('barValue')
is_expected.to contain_glance_api_config('DEFAULT/baz').with_ensure('absent')
end
it 'configures arbitrary glance-api-paste configurations' do
is_expected.to contain_glance_api_paste_ini('DEFAULT/foo').with_value('fooValue')
is_expected.to contain_glance_api_paste_ini('DEFAULT/bar').with_value('barValue')
is_expected.to contain_glance_api_paste_ini('DEFAULT/baz').with_ensure('absent')
end
end
shared_examples_for 'glance_registry_config' do
let :params do
{ :registry_config => config_hash,
:registry_paste_ini_config => config_hash }
end
it 'configures arbitrary glance-registry configurations' do
is_expected.to contain_glance_registry_config('DEFAULT/foo').with_value('fooValue')
is_expected.to contain_glance_registry_config('DEFAULT/bar').with_value('barValue')
is_expected.to contain_glance_registry_config('DEFAULT/baz').with_ensure('absent')
end
it 'configures arbitrary glance-registry-paste configurations' do
is_expected.to contain_glance_registry_paste_ini('DEFAULT/foo').with_value('fooValue')
is_expected.to contain_glance_registry_paste_ini('DEFAULT/bar').with_value('barValue')
is_expected.to contain_glance_registry_paste_ini('DEFAULT/baz').with_ensure('absent')
end
end
shared_examples_for 'glance_glare_config' do
let :params do
{ :glare_config => config_hash,
:glare_paste_ini_config => config_hash }
end
it 'configures arbitrary glance-glare configurations' do
is_expected.to contain_glance_glare_config('DEFAULT/foo').with_value('fooValue')
is_expected.to contain_glance_glare_config('DEFAULT/bar').with_value('barValue')
is_expected.to contain_glance_glare_config('DEFAULT/baz').with_ensure('absent')
end
it 'configures arbitrary glance-glare-paste configurations' do
is_expected.to contain_glance_glare_paste_ini('DEFAULT/foo').with_value('fooValue')
is_expected.to contain_glance_glare_paste_ini('DEFAULT/bar').with_value('barValue')
is_expected.to contain_glance_glare_paste_ini('DEFAULT/baz').with_ensure('absent')
end
end
shared_examples_for 'glance_cache_config' do
let :params do
{ :cache_config => config_hash }
end
it 'configures arbitrary glance-cache configurations' do
is_expected.to contain_glance_cache_config('DEFAULT/foo').with_value('fooValue')
is_expected.to contain_glance_cache_config('DEFAULT/bar').with_value('barValue')
is_expected.to contain_glance_cache_config('DEFAULT/baz').with_ensure('absent')
end
end
on_supported_os({
:supported_os => OSDefaults.get_supported_os
}).each do |os,facts|
context "on #{os}" do
let (:facts) do
facts.merge!(OSDefaults.get_facts())
end
it_configures 'glance_api_config'
it_configures 'glance_registry_config'
it_configures 'glance_glare_config'
it_configures 'glance_cache_config'
end
end
end
|