2012-03-31 16:09:29 -07:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe 'glance::backend::swift' do
|
|
|
|
let :facts do
|
|
|
|
{
|
|
|
|
:osfamily => 'Debian'
|
|
|
|
}
|
|
|
|
end
|
2012-10-14 00:23:20 -07:00
|
|
|
|
2012-03-31 16:09:29 -07:00
|
|
|
let :params do
|
|
|
|
{
|
2012-10-14 00:23:20 -07:00
|
|
|
:swift_store_user => 'user',
|
|
|
|
:swift_store_key => 'key',
|
2012-03-31 16:09:29 -07:00
|
|
|
}
|
|
|
|
end
|
2012-10-14 00:23:20 -07:00
|
|
|
|
2012-10-14 12:36:13 -07:00
|
|
|
let :pre_condition do
|
|
|
|
'class { "glance::api": keystone_password => "pass" }'
|
|
|
|
end
|
|
|
|
|
2013-07-02 19:28:49 -04:00
|
|
|
describe 'when default parameters' do
|
|
|
|
|
|
|
|
it 'configures glance-api.conf' do
|
2015-02-25 05:37:44 +01:00
|
|
|
is_expected.to contain_glance_api_config('glance_store/default_store').with_value('swift')
|
|
|
|
is_expected.to contain_glance_api_config('glance_store/swift_store_key').with_value('key')
|
|
|
|
is_expected.to contain_glance_api_config('glance_store/swift_store_user').with_value('user')
|
2015-06-23 19:43:29 +03:00
|
|
|
is_expected.to contain_glance_api_config('glance_store/swift_store_auth_version').with_value('2')
|
|
|
|
is_expected.to contain_glance_api_config('glance_store/swift_store_large_object_size').with_value('5120')
|
2015-02-25 05:37:44 +01:00
|
|
|
is_expected.to contain_glance_api_config('glance_store/swift_store_auth_address').with_value('127.0.0.1:5000/v2.0/')
|
2015-06-23 19:43:29 +03:00
|
|
|
is_expected.to contain_glance_api_config('glance_store/swift_store_container').with_value('glance')
|
|
|
|
is_expected.to contain_glance_api_config('glance_store/swift_store_create_container_on_put').with_value(false)
|
2015-05-13 18:27:33 +03:00
|
|
|
is_expected.to contain_glance_api_config('glance_store/swift_store_endpoint_type').with_value('internalURL')
|
2015-07-06 12:47:21 +02:00
|
|
|
is_expected.to contain_glance_api_config('glance_store/swift_store_region').with_value(nil)
|
2013-07-02 19:28:49 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
it 'configures glance-cache.conf' do
|
2015-02-25 05:37:44 +01:00
|
|
|
is_expected.to contain_glance_cache_config('glance_store/swift_store_key').with_value('key')
|
|
|
|
is_expected.to contain_glance_cache_config('glance_store/swift_store_user').with_value('user')
|
2015-06-23 19:43:29 +03:00
|
|
|
is_expected.to contain_glance_cache_config('glance_store/swift_store_auth_version').with_value('2')
|
|
|
|
is_expected.to contain_glance_cache_config('glance_store/swift_store_large_object_size').with_value('5120')
|
2015-02-25 05:37:44 +01:00
|
|
|
is_expected.to contain_glance_cache_config('glance_store/swift_store_auth_address').with_value('127.0.0.1:5000/v2.0/')
|
2015-06-23 19:43:29 +03:00
|
|
|
is_expected.to contain_glance_cache_config('glance_store/swift_store_container').with_value('glance')
|
|
|
|
is_expected.to contain_glance_cache_config('glance_store/swift_store_create_container_on_put').with_value(false)
|
2015-07-06 12:47:21 +02:00
|
|
|
is_expected.to contain_glance_cache_config('glance_store/swift_store_region').with_value(nil)
|
2013-07-02 19:28:49 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
describe 'when overriding parameters' do
|
2012-03-31 16:09:29 -07:00
|
|
|
let :params do
|
|
|
|
{
|
2013-07-02 19:28:49 -04:00
|
|
|
:swift_store_user => 'user',
|
|
|
|
:swift_store_key => 'key',
|
|
|
|
:swift_store_auth_version => '1',
|
2014-09-25 17:12:21 -07:00
|
|
|
:swift_store_large_object_size => '100',
|
2012-10-14 00:23:20 -07:00
|
|
|
:swift_store_auth_address => '127.0.0.2:8080/v1.0/',
|
2013-05-09 23:12:33 -04:00
|
|
|
:swift_store_container => 'swift',
|
2015-05-13 18:27:33 +03:00
|
|
|
:swift_store_create_container_on_put => true,
|
2015-07-06 12:47:21 +02:00
|
|
|
:swift_store_endpoint_type => 'publicURL',
|
|
|
|
:swift_store_region => 'RegionTwo'
|
2012-03-31 16:09:29 -07:00
|
|
|
}
|
|
|
|
end
|
2013-07-02 19:28:49 -04:00
|
|
|
|
|
|
|
it 'configures glance-api.conf' do
|
2015-06-23 19:43:29 +03:00
|
|
|
is_expected.to contain_glance_api_config('glance_store/swift_store_container').with_value('swift')
|
|
|
|
is_expected.to contain_glance_api_config('glance_store/swift_store_create_container_on_put').with_value(true)
|
|
|
|
is_expected.to contain_glance_api_config('glance_store/swift_store_auth_version').with_value('1')
|
|
|
|
is_expected.to contain_glance_api_config('glance_store/swift_store_large_object_size').with_value('100')
|
2015-02-25 05:37:44 +01:00
|
|
|
is_expected.to contain_glance_api_config('glance_store/swift_store_auth_address').with_value('127.0.0.2:8080/v1.0/')
|
2015-05-13 18:27:33 +03:00
|
|
|
is_expected.to contain_glance_api_config('glance_store/swift_store_endpoint_type').with_value('publicURL')
|
2015-07-06 12:47:21 +02:00
|
|
|
is_expected.to contain_glance_api_config('glance_store/swift_store_region').with_value('RegionTwo')
|
2013-07-02 19:28:49 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
it 'configures glance-cache.conf' do
|
2015-06-23 19:43:29 +03:00
|
|
|
is_expected.to contain_glance_cache_config('glance_store/swift_store_container').with_value('swift')
|
|
|
|
is_expected.to contain_glance_cache_config('glance_store/swift_store_create_container_on_put').with_value(true)
|
|
|
|
is_expected.to contain_glance_cache_config('glance_store/swift_store_auth_version').with_value('1')
|
|
|
|
is_expected.to contain_glance_cache_config('glance_store/swift_store_large_object_size').with_value('100')
|
2015-02-25 05:37:44 +01:00
|
|
|
is_expected.to contain_glance_cache_config('glance_store/swift_store_auth_address').with_value('127.0.0.2:8080/v1.0/')
|
2015-07-06 12:47:21 +02:00
|
|
|
is_expected.to contain_glance_cache_config('glance_store/swift_store_region').with_value('RegionTwo')
|
2013-07-02 19:28:49 -04:00
|
|
|
end
|
2012-03-31 16:09:29 -07:00
|
|
|
end
|
|
|
|
end
|