Browse Source

Improve unit test coverage of gnocchi::storage::swift

Currently we only test swift_endpoint_type, but we should test all
options to ensure all available options work.

Change-Id: Iadb9a0d0a9c4b3dab70f34a87435df7a5c692a1e
(cherry picked from commit 7c3ec98728)
(cherry picked from commit 2d33aa890a)
changes/14/773214/1
Takashi Kajinami 4 months ago
parent
commit
f9fd67e25b
1 changed files with 21 additions and 3 deletions
  1. +21
    -3
      spec/classes/gnocchi_storage_swift_spec.rb

+ 21
- 3
spec/classes/gnocchi_storage_swift_spec.rb View File

@ -26,14 +26,32 @@ describe 'gnocchi::storage::swift' do
end
end
context 'with swift_endpoint_type set' do
context 'with specific parameters' do
before do
params.merge!({
:swift_endpoint_type => 'internalURL'
:swift_user => 'swift2',
:swift_key => 'admin',
:swift_authurl => 'http://localhost:5000',
:swift_project_name => 'service',
:swift_user_domain_name => 'Default',
:swift_project_domain_name => 'Default',
:swift_region => 'regionOne',
:swift_auth_version => 2,
:swift_endpoint_type => 'publicURL',
})
end
it 'configures gnocchi-api with given endpoint type' do
is_expected.to contain_gnocchi_config('storage/swift_endpoint_type').with_value('internalURL')
is_expected.to contain_gnocchi_config('storage/driver').with_value('swift')
is_expected.to contain_gnocchi_config('storage/swift_user').with_value('swift2')
is_expected.to contain_gnocchi_config('storage/swift_key').with_value('admin')
is_expected.to contain_gnocchi_config('storage/swift_authurl').with_value('http://localhost:5000')
is_expected.to contain_gnocchi_config('storage/swift_project_name').with_value('service')
is_expected.to contain_gnocchi_config('storage/swift_user_domain_name').with_value('Default')
is_expected.to contain_gnocchi_config('storage/swift_project_domain_name').with_value('Default')
is_expected.to contain_gnocchi_config('storage/swift_region').with_value('regionOne')
is_expected.to contain_gnocchi_config('storage/swift_auth_version').with_value(2)
is_expected.to contain_gnocchi_config('storage/swift_endpoint_type').with_value('publicURL')
end
end
end


Loading…
Cancel
Save