Files
puppet-gnocchi/spec/classes/gnocchi_storage_swift_spec.rb
Takashi Kajinami 237961239b Add domain/region parameters for gnocchi::storage::swift
... so that operators can configure their keystone domain and region
used for access to swift.

Change-Id: Ide2bcd1326270b5ba0a8ce25f3388e8bf48a66a0
2020-04-20 00:21:38 +09:00

53 lines
1.9 KiB
Ruby

#
# Unit tests for gnocchi::storage::swift
#
require 'spec_helper'
describe 'gnocchi::storage::swift' do
let :params do
{}
end
shared_examples 'gnocchi storage swift' do
context 'with default parameters' do
it 'configures gnocchi-api with default parameters' do
is_expected.to contain_gnocchi_config('storage/driver').with_value('swift')
is_expected.to contain_gnocchi_config('storage/swift_user').with_value('<SERVICE DEFAULT>')
is_expected.to contain_gnocchi_config('storage/swift_key').with_value('<SERVICE DEFAULT>')
is_expected.to contain_gnocchi_config('storage/swift_authurl').with_value('<SERVICE DEFAULT>')
is_expected.to contain_gnocchi_config('storage/swift_project_name').with_value('<SERVICE DEFAULT>')
is_expected.to contain_gnocchi_config('storage/swift_user_domain_name').with_value('<SERVICE DEFAULT>')
is_expected.to contain_gnocchi_config('storage/swift_project_domain_name').with_value('<SERVICE DEFAULT>')
is_expected.to contain_gnocchi_config('storage/swift_region').with_value('<SERVICE DEFAULT>')
is_expected.to contain_gnocchi_config('storage/swift_auth_version').with_value('<SERVICE DEFAULT>')
is_expected.to contain_gnocchi_config('storage/swift_endpoint_type').with_value('<SERVICE DEFAULT>')
end
end
context 'with swift_endpoint_type set' do
before do
params.merge!({
:swift_endpoint_type => 'internalURL'
})
end
it 'configures gnocchi-api with given endpoint type' do
is_expected.to contain_gnocchi_config('storage/swift_endpoint_type').with_value('internalURL')
end
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_behaves_like 'gnocchi storage swift'
end
end
end