2012-06-04 13:18:12 -07:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe 'swift::proxy::s3token' do
|
2018-05-17 00:13:44 +02:00
|
|
|
shared_examples 'swift::proxy::s3token' do
|
|
|
|
describe "when using default parameters" do
|
|
|
|
it { is_expected.to contain_swift_proxy_config('filter:s3token/use').with_value('egg:swift#s3token') }
|
2018-05-29 11:47:11 -04:00
|
|
|
it { is_expected.to contain_swift_proxy_config('filter:s3token/auth_uri').with_value('http://127.0.0.1:5000') }
|
2020-05-03 21:52:46 +10:00
|
|
|
it { is_expected.to contain_swift_proxy_config('filter:s3token/reseller_prefix').with_value('AUTH_') }
|
|
|
|
it { is_expected.to contain_swift_proxy_config('filter:s3token/delay_auth_decision').with_value('false') }
|
|
|
|
it { is_expected.to contain_swift_proxy_config('filter:s3token/http_timeout').with_value('<SERVICE DEFAULT>') }
|
|
|
|
it { is_expected.to contain_swift_proxy_config('filter:s3token/secret_cache_duration').with_value('0') }
|
|
|
|
it { is_expected.to contain_swift_proxy_config('filter:s3token/auth_url').with_value('http://127.0.0.1:5000') }
|
|
|
|
it { is_expected.to contain_swift_proxy_config('filter:s3token/auth_type').with_value('password') }
|
|
|
|
it { is_expected.to contain_swift_proxy_config('filter:s3token/username').with_value('swift') }
|
2022-01-25 09:58:14 +09:00
|
|
|
it { is_expected.to contain_swift_proxy_config('filter:s3token/user_domain_id').with_value('default') }
|
2020-05-12 17:41:59 +09:00
|
|
|
it { is_expected.to contain_swift_proxy_config('filter:s3token/password').with_value('password').with_secret(true) }
|
2020-05-03 21:52:46 +10:00
|
|
|
it { is_expected.to contain_swift_proxy_config('filter:s3token/project_name').with_value('services') }
|
|
|
|
it { is_expected.to contain_swift_proxy_config('filter:s3token/project_domain_id').with_value('default') }
|
2022-01-25 09:58:14 +09:00
|
|
|
it { is_expected.to contain_swift_proxy_config('filter:s3token/system_scope').with_value('<SERVICE DEFAULT>') }
|
2018-05-17 00:13:44 +02:00
|
|
|
end
|
2012-06-04 13:18:12 -07:00
|
|
|
|
2018-05-17 00:13:44 +02:00
|
|
|
describe "when overriding default parameters" do
|
|
|
|
let :params do
|
|
|
|
{
|
2020-05-03 21:52:46 +10:00
|
|
|
:auth_uri => 'http://192.168.24.11:5000',
|
|
|
|
:reseller_prefix => 'SWIFT_',
|
|
|
|
:delay_auth_decision => true,
|
|
|
|
:http_timeout => '5',
|
|
|
|
:secret_cache_duration => '10',
|
|
|
|
:auth_url => 'http://192.168.24.11:5000',
|
|
|
|
:auth_type => 'password',
|
|
|
|
:username => 'swift',
|
|
|
|
:password => 'swift',
|
|
|
|
:project_name => 'admin',
|
|
|
|
:project_domain_id => '12345',
|
|
|
|
:user_domain_id => '12345'
|
2018-05-17 00:13:44 +02:00
|
|
|
}
|
|
|
|
end
|
|
|
|
|
2018-05-29 11:47:11 -04:00
|
|
|
it { is_expected.to contain_swift_proxy_config('filter:s3token/auth_uri').with_value('http://192.168.24.11:5000') }
|
2020-05-03 21:52:46 +10:00
|
|
|
it { is_expected.to contain_swift_proxy_config('filter:s3token/reseller_prefix').with_value('SWIFT_') }
|
|
|
|
it { is_expected.to contain_swift_proxy_config('filter:s3token/delay_auth_decision').with_value('true') }
|
|
|
|
it { is_expected.to contain_swift_proxy_config('filter:s3token/http_timeout').with_value('5') }
|
|
|
|
it { is_expected.to contain_swift_proxy_config('filter:s3token/secret_cache_duration').with_value('10') }
|
|
|
|
it { is_expected.to contain_swift_proxy_config('filter:s3token/auth_url').with_value('http://192.168.24.11:5000') }
|
|
|
|
it { is_expected.to contain_swift_proxy_config('filter:s3token/auth_type').with_value('password') }
|
|
|
|
it { is_expected.to contain_swift_proxy_config('filter:s3token/username').with_value('swift') }
|
2022-01-25 09:58:14 +09:00
|
|
|
it { is_expected.to contain_swift_proxy_config('filter:s3token/user_domain_id').with_value('12345') }
|
2020-05-12 17:41:59 +09:00
|
|
|
it { is_expected.to contain_swift_proxy_config('filter:s3token/password').with_value('swift').with_secret(true) }
|
2020-05-03 21:52:46 +10:00
|
|
|
it { is_expected.to contain_swift_proxy_config('filter:s3token/project_name').with_value('admin') }
|
|
|
|
it { is_expected.to contain_swift_proxy_config('filter:s3token/project_domain_id').with_value('12345') }
|
2022-01-25 09:58:14 +09:00
|
|
|
it { is_expected.to contain_swift_proxy_config('filter:s3token/system_scope').with_value('<SERVICE DEFAULT>') }
|
|
|
|
end
|
|
|
|
|
|
|
|
describe 'when system_scope is set' do
|
|
|
|
let :params do
|
|
|
|
{
|
|
|
|
:system_scope => 'all'
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
it { is_expected.to contain_swift_proxy_config('filter:s3token/project_name').with_value('<SERVICE DEFAULT>') }
|
|
|
|
it { is_expected.to contain_swift_proxy_config('filter:s3token/project_domain_id').with_value('<SERVICE DEFAULT>') }
|
|
|
|
it { is_expected.to contain_swift_proxy_config('filter:s3token/system_scope').with_value('all') }
|
2012-06-04 13:18:12 -07:00
|
|
|
end
|
2017-08-23 18:54:17 -04:00
|
|
|
end
|
|
|
|
|
2018-05-17 00:13:44 +02:00
|
|
|
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_configures 'swift::proxy::s3token'
|
2017-08-23 18:54:17 -04:00
|
|
|
end
|
2012-06-04 13:18:12 -07:00
|
|
|
end
|
|
|
|
end
|