puppet-glance/spec/classes/glance_backend_swift_spec.rb
Dan Prince 5dbcb47c50 Add swift_store_auth_version to swift backend.
Updates the glance swift backend to support configuring the
swift_store_auth_version setting. The default value for this is '2'
(which matches the glance config file defaults).

As part of this change I am also updating the default value
for swift_store_auth_address to use 127.0.0.1:5000/v2.0/ (keystone).
This makes sense because the previous value would have required
us to set swift_store_auth_version by default to 1.

Change-Id: I865712914dd0506b2722ab8da3e1c56d7d9f433a
2013-04-11 11:30:41 -04:00

46 lines
1.8 KiB
Ruby

require 'spec_helper'
describe 'glance::backend::swift' do
let :facts do
{
:osfamily => 'Debian'
}
end
let :params do
{
:swift_store_user => 'user',
:swift_store_key => 'key',
}
end
let :pre_condition do
'class { "glance::api": keystone_password => "pass" }'
end
it { should contain_glance_api_config('DEFAULT/default_store').with_value('swift') }
it { should contain_glance_api_config('DEFAULT/swift_store_key').with_value('key') }
it { should contain_glance_api_config('DEFAULT/swift_store_user').with_value('user') }
it { should contain_glance_api_config('DEFAULT/swift_store_auth_version').with_value('2') }
it { should contain_glance_api_config('DEFAULT/swift_store_auth_address').with_value('127.0.0.1:5000/v2.0/') }
it { should contain_glance_api_config('DEFAULT/swift_store_container').with_value('glance') }
it { should contain_glance_api_config('DEFAULT/swift_store_create_container_on_put').with_value('False') }
describe 'when overriding datadir' do
let :params do
{
:swift_store_user => 'user',
:swift_store_key => 'key',
:swift_store_auth_version => '1',
:swift_store_auth_address => '127.0.0.2:8080/v1.0/',
:swift_store_container => 'swift',
:swift_store_create_container_on_put => 'True'
}
end
it { should contain_glance_api_config('DEFAULT/swift_store_container').with_value('swift') }
it { should contain_glance_api_config('DEFAULT/swift_store_create_container_on_put').with_value('True') }
it { should contain_glance_api_config('DEFAULT/swift_store_auth_version').with_value('1') }
it { should contain_glance_api_config('DEFAULT/swift_store_auth_address').with_value('127.0.0.2:8080/v1.0/') }
end
end