| 1 |
require 'spec_helper' |
| 2 |
|
| 3 |
describe 'cloudkitty::keystone::authtoken' do |
| 4 |
|
| 5 |
let :params do |
| 6 |
{ :password => 'cloudkitty_password', } |
| 7 |
end |
| 8 |
|
| 9 |
shared_examples 'cloudkitty::keystone::authtoken' do |
| 10 |
|
| 11 |
context 'with default parameters' do |
| 12 |
|
| 13 |
it 'configure keystone_authtoken' do |
| 14 |
is_expected.to contain_keystone__resource__authtoken('cloudkitty_config').with( |
| 15 |
:username => 'cloudkitty', |
| 16 |
:password => 'cloudkitty_password', |
| 17 |
:auth_url => 'http://localhost:5000', |
| 18 |
:project_name => 'services', |
| 19 |
:user_domain_name => 'Default', |
| 20 |
:project_domain_name => 'Default', |
| 21 |
:system_scope => '<SERVICE DEFAULT>', |
| 22 |
:insecure => '<SERVICE DEFAULT>', |
| 23 |
:auth_section => '<SERVICE DEFAULT>', |
| 24 |
:auth_type => 'password', |
| 25 |
:www_authenticate_uri => 'http://localhost:5000', |
| 26 |
:auth_version => '<SERVICE DEFAULT>', |
| 27 |
:cache => '<SERVICE DEFAULT>', |
| 28 |
:cafile => '<SERVICE DEFAULT>', |
| 29 |
:certfile => '<SERVICE DEFAULT>', |
| 30 |
:delay_auth_decision => '<SERVICE DEFAULT>', |
| 31 |
:enforce_token_bind => '<SERVICE DEFAULT>', |
| 32 |
:http_connect_timeout => '<SERVICE DEFAULT>', |
| 33 |
:http_request_max_retries => '<SERVICE DEFAULT>', |
| 34 |
:include_service_catalog => '<SERVICE DEFAULT>', |
| 35 |
:keyfile => '<SERVICE DEFAULT>', |
| 36 |
:memcache_pool_conn_get_timeout => '<SERVICE DEFAULT>', |
| 37 |
:memcache_pool_dead_retry => '<SERVICE DEFAULT>', |
| 38 |
:memcache_pool_maxsize => '<SERVICE DEFAULT>', |
| 39 |
:memcache_pool_socket_timeout => '<SERVICE DEFAULT>', |
| 40 |
:memcache_pool_unused_timeout => '<SERVICE DEFAULT>', |
| 41 |
:memcache_secret_key => '<SERVICE DEFAULT>', |
| 42 |
:memcache_security_strategy => '<SERVICE DEFAULT>', |
| 43 |
:memcache_use_advanced_pool => '<SERVICE DEFAULT>', |
| 44 |
:memcached_servers => '<SERVICE DEFAULT>', |
| 45 |
:manage_memcache_package => false, |
| 46 |
:region_name => '<SERVICE DEFAULT>', |
| 47 |
:token_cache_time => '<SERVICE DEFAULT>', |
| 48 |
:service_token_roles => '<SERVICE DEFAULT>', |
| 49 |
:service_token_roles_required => '<SERVICE DEFAULT>', |
| 50 |
:service_type => '<SERVICE DEFAULT>', |
| 51 |
:interface => '<SERVICE DEFAULT>', |
| 52 |
) |
| 53 |
end |
| 54 |
end |
| 55 |
|
| 56 |
context 'when overriding parameters' do |
| 57 |
before do |
| 58 |
params.merge!({ |
| 59 |
:www_authenticate_uri => 'https://10.0.0.1:9999/', |
| 60 |
:username => 'myuser', |
| 61 |
:password => 'mypasswd', |
| 62 |
:auth_url => 'http://127.0.0.1:5000', |
| 63 |
:project_name => 'service_project', |
| 64 |
:user_domain_name => 'domainX', |
| 65 |
:project_domain_name => 'domainX', |
| 66 |
:system_scope => 'all', |
| 67 |
:insecure => false, |
| 68 |
:auth_section => 'new_section', |
| 69 |
:auth_type => 'password', |
| 70 |
:auth_version => 'v3', |
| 71 |
:cache => 'somevalue', |
| 72 |
:cafile => '/opt/stack/data/cafile.pem', |
| 73 |
:certfile => 'certfile.crt', |
| 74 |
:delay_auth_decision => false, |
| 75 |
:enforce_token_bind => 'permissive', |
| 76 |
:http_connect_timeout => '300', |
| 77 |
:http_request_max_retries => '3', |
| 78 |
:include_service_catalog => true, |
| 79 |
:keyfile => 'keyfile', |
| 80 |
:memcache_pool_conn_get_timeout => '9', |
| 81 |
:memcache_pool_dead_retry => '302', |
| 82 |
:memcache_pool_maxsize => '11', |
| 83 |
:memcache_pool_socket_timeout => '2', |
| 84 |
:memcache_pool_unused_timeout => '61', |
| 85 |
:memcache_secret_key => 'secret_key', |
| 86 |
:memcache_security_strategy => 'ENCRYPT', |
| 87 |
:memcache_use_advanced_pool => true, |
| 88 |
:memcached_servers => ['memcached01:11211','memcached02:11211'], |
| 89 |
:manage_memcache_package => true, |
| 90 |
:region_name => 'region2', |
| 91 |
:token_cache_time => '301', |
| 92 |
:service_token_roles => ['service'], |
| 93 |
:service_token_roles_required => false, |
| 94 |
:service_type => 'identity', |
| 95 |
:interface => 'internal', |
| 96 |
}) |
| 97 |
end |
| 98 |
|
| 99 |
it 'configure keystone_authtoken' do |
| 100 |
is_expected.to contain_keystone__resource__authtoken('cloudkitty_config').with( |
| 101 |
:www_authenticate_uri => 'https://10.0.0.1:9999/', |
| 102 |
:username => 'myuser', |
| 103 |
:password => 'mypasswd', |
| 104 |
:auth_url => 'http://127.0.0.1:5000', |
| 105 |
:project_name => 'service_project', |
| 106 |
:user_domain_name => 'domainX', |
| 107 |
:project_domain_name => 'domainX', |
| 108 |
:system_scope => 'all', |
| 109 |
:insecure => false, |
| 110 |
:auth_section => 'new_section', |
| 111 |
:auth_type => 'password', |
| 112 |
:auth_version => 'v3', |
| 113 |
:cache => 'somevalue', |
| 114 |
:cafile => '/opt/stack/data/cafile.pem', |
| 115 |
:certfile => 'certfile.crt', |
| 116 |
:delay_auth_decision => false, |
| 117 |
:enforce_token_bind => 'permissive', |
| 118 |
:http_connect_timeout => '300', |
| 119 |
:http_request_max_retries => '3', |
| 120 |
:include_service_catalog => true, |
| 121 |
:keyfile => 'keyfile', |
| 122 |
:memcache_pool_conn_get_timeout => '9', |
| 123 |
:memcache_pool_dead_retry => '302', |
| 124 |
:memcache_pool_maxsize => '11', |
| 125 |
:memcache_pool_socket_timeout => '2', |
| 126 |
:memcache_pool_unused_timeout => '61', |
| 127 |
:memcache_secret_key => 'secret_key', |
| 128 |
:memcache_security_strategy => 'ENCRYPT', |
| 129 |
:memcache_use_advanced_pool => true, |
| 130 |
:memcached_servers => ['memcached01:11211','memcached02:11211'], |
| 131 |
:manage_memcache_package => true, |
| 132 |
:region_name => 'region2', |
| 133 |
:token_cache_time => '301', |
| 134 |
:service_token_roles => ['service'], |
| 135 |
:service_token_roles_required => false, |
| 136 |
:service_type => 'identity', |
| 137 |
:interface => 'internal', |
| 138 |
) |
| 139 |
end |
| 140 |
end |
| 141 |
end |
| 142 |
|
| 143 |
on_supported_os({ |
| 144 |
:supported_os => OSDefaults.get_supported_os |
| 145 |
}).each do |os,facts| |
| 146 |
context "on #{os}" do |
| 147 |
let (:facts) do |
| 148 |
facts.merge!(OSDefaults.get_facts()) |
| 149 |
end |
| 150 |
|
| 151 |
it_configures 'cloudkitty::keystone::authtoken' |
| 152 |
end |
| 153 |
end |
| 154 |
|
| 155 |
end |