Do not test service_user parameters directly
The service_user parameters are not managed directly but managed by the keystone::resource::service_user resource type. Thus we should avoid testing parameters directly otherwise any change in the resource type can cause test failures. Change-Id: Idc1324b4eb683a0ec0e57e20bca25238149adb0f
This commit is contained in:
parent
1ae066c60b
commit
688e39654c
|
@ -1,6 +1,7 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe 'cinder::keystone::service_user' do
|
||||
|
||||
let :params do
|
||||
{
|
||||
:password => 'cinder_password',
|
||||
|
@ -8,22 +9,26 @@ describe 'cinder::keystone::service_user' do
|
|||
end
|
||||
|
||||
shared_examples 'cinder service_user' do
|
||||
|
||||
context 'with default parameters' do
|
||||
|
||||
it 'configure service_user' do
|
||||
is_expected.to contain_cinder_config('service_user/username').with_value('cinder')
|
||||
is_expected.to contain_cinder_config('service_user/password').with_value('cinder_password')
|
||||
is_expected.to contain_cinder_config('service_user/auth_url').with_value('http://localhost:5000')
|
||||
is_expected.to contain_cinder_config('service_user/project_name').with_value('services')
|
||||
is_expected.to contain_cinder_config('service_user/user_domain_name').with_value('Default')
|
||||
is_expected.to contain_cinder_config('service_user/project_domain_name').with_value('Default')
|
||||
is_expected.to contain_cinder_config('service_user/send_service_user_token').with_value(false)
|
||||
is_expected.to contain_cinder_config('service_user/insecure').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_cinder_config('service_user/auth_type').with_value('password')
|
||||
is_expected.to contain_cinder_config('service_user/auth_version').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_cinder_config('service_user/cafile').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_cinder_config('service_user/certfile').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_cinder_config('service_user/keyfile').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_cinder_config('service_user/region_name').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_keystone__resource__service_user('cinder_config').with(
|
||||
:username => 'cinder',
|
||||
:password => 'cinder_password',
|
||||
:auth_url => 'http://localhost:5000',
|
||||
:project_name => 'services',
|
||||
:user_domain_name => 'Default',
|
||||
:project_domain_name => 'Default',
|
||||
:insecure => '<SERVICE DEFAULT>',
|
||||
:send_service_user_token => false,
|
||||
:auth_type => 'password',
|
||||
:auth_version => '<SERVICE DEFAULT>',
|
||||
:cafile => '<SERVICE DEFAULT>',
|
||||
:certfile => '<SERVICE DEFAULT>',
|
||||
:keyfile => '<SERVICE DEFAULT>',
|
||||
:region_name => '<SERVICE DEFAULT>',
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -32,7 +37,7 @@ describe 'cinder::keystone::service_user' do
|
|||
params.merge!({
|
||||
:username => 'myuser',
|
||||
:password => 'mypasswd',
|
||||
:auth_url => 'https://127.0.0.1:5000',
|
||||
:auth_url => 'http://127.0.0.1:5000',
|
||||
:project_name => 'service_project',
|
||||
:user_domain_name => 'domainX',
|
||||
:project_domain_name => 'domainX',
|
||||
|
@ -48,20 +53,22 @@ describe 'cinder::keystone::service_user' do
|
|||
end
|
||||
|
||||
it 'configure service_user' do
|
||||
is_expected.to contain_cinder_config('service_user/username').with_value(params[:username])
|
||||
is_expected.to contain_cinder_config('service_user/password').with_value(params[:password]).with_secret(true)
|
||||
is_expected.to contain_cinder_config('service_user/auth_url').with_value(params[:auth_url])
|
||||
is_expected.to contain_cinder_config('service_user/project_name').with_value(params[:project_name])
|
||||
is_expected.to contain_cinder_config('service_user/user_domain_name').with_value(params[:user_domain_name])
|
||||
is_expected.to contain_cinder_config('service_user/project_domain_name').with_value(params[:project_domain_name])
|
||||
is_expected.to contain_cinder_config('service_user/send_service_user_token').with_value(params[:send_service_user_token])
|
||||
is_expected.to contain_cinder_config('service_user/insecure').with_value(params[:insecure])
|
||||
is_expected.to contain_cinder_config('service_user/auth_type').with_value(params[:auth_type])
|
||||
is_expected.to contain_cinder_config('service_user/auth_version').with_value(params[:auth_version])
|
||||
is_expected.to contain_cinder_config('service_user/cafile').with_value(params[:cafile])
|
||||
is_expected.to contain_cinder_config('service_user/certfile').with_value(params[:certfile])
|
||||
is_expected.to contain_cinder_config('service_user/keyfile').with_value(params[:keyfile])
|
||||
is_expected.to contain_cinder_config('service_user/region_name').with_value(params[:region_name])
|
||||
is_expected.to contain_keystone__resource__service_user('cinder_config').with(
|
||||
:username => 'myuser',
|
||||
:password => 'mypasswd',
|
||||
:auth_url => 'http://127.0.0.1:5000',
|
||||
:project_name => 'service_project',
|
||||
:user_domain_name => 'domainX',
|
||||
:project_domain_name => 'domainX',
|
||||
:send_service_user_token => true,
|
||||
:insecure => false,
|
||||
:auth_type => 'password',
|
||||
:auth_version => 'v3',
|
||||
:cafile => '/opt/stack/data/cafile.pem',
|
||||
:certfile => 'certfile.crt',
|
||||
:keyfile => 'keyfile',
|
||||
:region_name => 'region2',
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -77,4 +84,5 @@ describe 'cinder::keystone::service_user' do
|
|||
it_behaves_like 'cinder service_user'
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue