| 1 |
require 'spec_helper' |
| 2 |
|
| 3 |
describe 'cloudkitty::fetcher::gnocchi' do |
| 4 |
|
| 5 |
let :params do |
| 6 |
{ :scope_attribute => '<SERVICE DEFAULT>', |
| 7 |
:resource_types => '<SERVICE DEFAULT>', |
| 8 |
:gnocchi_auth_type => '<SERVICE DEFAULT>', |
| 9 |
:gnocchi_user => '<SERVICE DEFAULT>', |
| 10 |
:gnocchi_endpoint => '<SERVICE DEFAULT>', |
| 11 |
:interface => '<SERVICE DEFAULT>', |
| 12 |
:region_name => '<SERVICE DEFAULT>', |
| 13 |
:auth_type => '<SERVICE DEFAULT>', |
| 14 |
:auth_section => '<SERVICE DEFAULT>', |
| 15 |
} |
| 16 |
end |
| 17 |
|
| 18 |
|
| 19 |
shared_examples_for 'cloudkitty::fetcher::gnocchi' do |
| 20 |
it { should contain_class('cloudkitty::deps') } |
| 21 |
|
| 22 |
it { is_expected.to contain_cloudkitty_config('fetcher_gnocchi/scope_attribute').with_value( params[:scope_attribute])} |
| 23 |
it { is_expected.to contain_cloudkitty_config('fetcher_gnocchi/resource_types').with_value( params[:resource_types])} |
| 24 |
it { is_expected.to contain_cloudkitty_config('fetcher_gnocchi/gnocchi_auth_type').with_value( params[:gnocchi_auth_type])} |
| 25 |
it { is_expected.to contain_cloudkitty_config('fetcher_gnocchi/gnocchi_user').with_value( params[:gnocchi_user])} |
| 26 |
it { is_expected.to contain_cloudkitty_config('fetcher_gnocchi/gnocchi_endpoint').with_value( params[:gnocchi_endpoint])} |
| 27 |
it { is_expected.to contain_cloudkitty_config('fetcher_gnocchi/interface').with_value( params[:interface])} |
| 28 |
it { is_expected.to contain_cloudkitty_config('fetcher_gnocchi/region_name').with_value( params[:region_name])} |
| 29 |
it { is_expected.to contain_cloudkitty_config('fetcher_gnocchi/auth_type').with_value( params[:auth_type])} |
| 30 |
it { is_expected.to contain_cloudkitty_config('fetcher_gnocchi/auth_section').with_value( params[:auth_section])} |
| 31 |
end |
| 32 |
|
| 33 |
on_supported_os({ |
| 34 |
:supported_os => OSDefaults.get_supported_os |
| 35 |
}).each do |os,facts| |
| 36 |
context "on #{os}" do |
| 37 |
let (:facts) do |
| 38 |
facts.merge!(OSDefaults.get_facts()) |
| 39 |
end |
| 40 |
|
| 41 |
context 'with default parameters' do |
| 42 |
it_behaves_like 'cloudkitty::fetcher::gnocchi' |
| 43 |
end |
| 44 |
|
| 45 |
context 'when overriding parameters' do |
| 46 |
before do |
| 47 |
params.merge!({ |
| 48 |
:scope_attribute => 'project_id', |
| 49 |
:resource_types => 'some_types', |
| 50 |
:gnocchi_auth_type => 'basic', |
| 51 |
:gnocchi_user => 'myuser', |
| 52 |
:gnocchi_endpoint => 'https://somwhere/', |
| 53 |
:interface => 'external', |
| 54 |
:region_name => 'myregion', |
| 55 |
:auth_type => 'typeA', |
| 56 |
:auth_section => 'ks_auth', |
| 57 |
}) |
| 58 |
end |
| 59 |
it_behaves_like 'cloudkitty::fetcher::gnocchi' |
| 60 |
end |
| 61 |
end |
| 62 |
end |
| 63 |
end |