
The module was written in a way that was not consistent with other Puppet OpenStack modules, the interface was very different. This patch: * add db.pp * update logging.pp with usual parameters * drop useless parameters in keystone/auth.pp * cleanup params.pp * drop services.pp, which is useless * Update unit tests * Add coordination support in init.pp * Some alignment issues * Add more doc in README * Stop including ::mistral in all classes * Include mistral::policy in mistral::api This is a non-backward compatible change, but since the module has no release and no stable branch, also very new, this is not something we need to care at this stage. People using this module at this stage will have to update their manifests otherwise their Puppet catalog will fail. Change-Id: I979e21caa71ee35337dc01b225878701868e966a
105 lines
3.0 KiB
Ruby
105 lines
3.0 KiB
Ruby
#
|
|
# Unit tests for mistral::keystone::auth
|
|
#
|
|
|
|
require 'spec_helper'
|
|
|
|
describe 'mistral::keystone::auth' do
|
|
|
|
let :facts do
|
|
{ :osfamily => 'Debian' }
|
|
end
|
|
|
|
describe 'with default class parameters' do
|
|
let :params do
|
|
{ :password => 'mistral_password',
|
|
:tenant => 'services' }
|
|
end
|
|
|
|
it { is_expected.to contain_keystone_user('mistral').with(
|
|
:ensure => 'present',
|
|
:password => 'mistral_password',
|
|
) }
|
|
|
|
it { is_expected.to contain_keystone_user_role('mistral@services').with(
|
|
:ensure => 'present',
|
|
:roles => ['admin']
|
|
)}
|
|
|
|
it { is_expected.to contain_keystone_service('mistral::workflowv2').with(
|
|
:ensure => 'present',
|
|
:description => 'OpenStack Workflow Service'
|
|
) }
|
|
|
|
it { is_expected.to contain_keystone_endpoint('RegionOne/mistral::workflowv2').with(
|
|
:ensure => 'present',
|
|
:public_url => "http://127.0.0.1:8989/v2",
|
|
:admin_url => "http://127.0.0.1:8989/v2",
|
|
:internal_url => "http://127.0.0.1:8989/v2"
|
|
) }
|
|
end
|
|
|
|
describe 'when overriding auth name' do
|
|
let :params do
|
|
{ :password => 'foo',
|
|
:auth_name => 'mistraly' }
|
|
end
|
|
|
|
it { is_expected.to contain_keystone_user('mistraly') }
|
|
it { is_expected.to contain_keystone_user_role('mistraly@services') }
|
|
it { is_expected.to contain_keystone_service('mistraly::workflowv2') }
|
|
it { is_expected.to contain_keystone_endpoint('RegionOne/mistraly::workflowv2') }
|
|
end
|
|
|
|
describe 'when overriding service name' do
|
|
let :params do
|
|
{ :service_name => 'mistral_service',
|
|
:auth_name => 'mistral',
|
|
:password => 'mistral_password' }
|
|
end
|
|
|
|
it { is_expected.to contain_keystone_user('mistral') }
|
|
it { is_expected.to contain_keystone_user_role('mistral@services') }
|
|
it { is_expected.to contain_keystone_service('mistral_service::workflowv2') }
|
|
it { is_expected.to contain_keystone_endpoint('RegionOne/mistral_service::workflowv2') }
|
|
end
|
|
|
|
describe 'when disabling user configuration' do
|
|
|
|
let :params do
|
|
{
|
|
:password => 'mistral_password',
|
|
:configure_user => false
|
|
}
|
|
end
|
|
|
|
it { is_expected.not_to contain_keystone_user('mistral') }
|
|
it { is_expected.to contain_keystone_user_role('mistral@services') }
|
|
it { is_expected.to contain_keystone_service('mistral::workflowv2').with(
|
|
:ensure => 'present',
|
|
:description => 'OpenStack Workflow Service'
|
|
) }
|
|
|
|
end
|
|
|
|
describe 'when disabling user and user role configuration' do
|
|
|
|
let :params do
|
|
{
|
|
:password => 'mistral_password',
|
|
:configure_user => false,
|
|
:configure_user_role => false
|
|
}
|
|
end
|
|
|
|
it { is_expected.not_to contain_keystone_user('mistral') }
|
|
it { is_expected.not_to contain_keystone_user_role('mistral@services') }
|
|
it { is_expected.to contain_keystone_service('mistral::workflowv2').with(
|
|
:ensure => 'present',
|
|
:description => 'OpenStack Workflow Service'
|
|
) }
|
|
|
|
end
|
|
|
|
end
|