Federation openidc - spec test wrong filename + typos

Closes-Bug: #1655666
Change-Id: I72eca737c392064f3874c103d295db13be354194
This commit is contained in:
Harald Jensas 2017-01-13 20:00:23 +01:00
parent 3010079b0a
commit 81cab9a2df
1 changed files with 41 additions and 28 deletions

View File

@ -2,44 +2,61 @@ require 'spec_helper'
describe 'keystone::federation::openidc' do
describe 'with invalid params' do
let(:pre_condition) do
<<-EOS
class { 'keystone':
admin_token => 'service_token',
admin_password => 'special_password',
}
include apache
class { 'keystone::wsgi::apache': }
EOS
end
let :params do
{ :methods => 'password, token, openidc',
:idp_name => 'myidp',
:openidc_provider_metadata_url => 'https://accounts.google.com/.well-known/openid-configuration',
:openidc_client_id => 'openid_client_id',
:openidc_client_secret => 'openid_client_secret',
:template_order => 331
}
end
context 'with invalid params' do
before do
params.merge!(:methods => 'external, password, token, oauth1')
it_raises 'a Puppet::Error', /The external method should be dropped to avoid any interference with openidc/
end
it_raises 'a Puppet::Error', /The external method should be dropped to avoid any interference with openidc/
before do
params.merge!(:methods => 'password, token, oauth1')
it_raises 'a Puppet::Error', /Methods should contain openidc as one of the auth methods./
end
it_raises 'a Puppet::Error', /Methods should contain openidc as one of the auth methods./
before do
params.merge!(:methods => 'password, token, oauth1, openidc',
:module_plugin => 'keystone.auth.plugins')
it_raises 'a Puppet:Error', /The plugin for openidc should be keystone.auth.plugins.mapped.Mapped/
end
it_raises 'a Puppet:Error', /The plugin for openidc should be keystone.auth.plugins.mapped.Mapped/
before do
params.merge!(:admin_port => false,
:main_port => false)
it_raises 'a Puppet:Error', /No VirtualHost port to configure, please choose at least one./
end
it_raises 'a Puppet:Error', /No VirtualHost port to configure, please choose at least one./
befode do
before do
params.merge!(:template_port => 330)
it_raises 'a Puppet:Error', /The template order should be greater than 330 and less than 999./
end
it_raises 'a Puppet:Error', /The template order should be greater than 330 and less than 999./
befode do
before do
params.merge!(:template_port => 999)
it_raises 'a Puppet:Error', /The template order should be greater than 330 and less than 999./
end
it_raises 'a Puppet:Error', /The template order should be greater than 330 and less than 999./
end
on_supported_os({
@ -52,35 +69,32 @@ describe 'keystone::federation::openidc' do
case facts[:osfamily]
when 'Debian'
{
:openidc_package_name => 'libapache2-mod-auth-mellon',
:openidc_package_name => 'libapache2-mod-auth-openidc',
}
when 'RedHat'
{
:openidc_package_name => 'mod_auth_openidc'
:openidc_package_name => 'mod_auth_openidc',
}
end
end
context 'with only required parameters' do
let :params do
{ :methods => 'password, token, openidc' }
end
it 'should have basic params for mellon in Keystone configuration' do
is_expected.to contain_keystone_config('auth/methods').with_value('password, token, openidc')
is_expected.to contain_keystone_config('auth/openidc').with_value('keystone.auth.plugins.mapped.Mapped')
end
it { is_expected.to contain_concat__fragment('configure_openidc_on_port_5000').with({
:target => "${keystone::wsgi::apache::priority}-keystone_wsgi_main.conf",
:target => "10-keystone_wsgi_main.conf",
:order => params[:template_order],
})}
end
context 'with override default parameters' do
let :params do
{ :methods => 'password, token, openidc',
:admin_port => true }
before do
params.merge!({
:admin_port => true,
})
end
it 'should have basic params for mellon in Keystone configuration' do
@ -89,12 +103,12 @@ describe 'keystone::federation::openidc' do
end
it { is_expected.to contain_concat__fragment('configure_openidc_on_port_5000').with({
:target => "${keystone::wsgi::apache::priority}-keystone_wsgi_main.conf",
:target => "10-keystone_wsgi_main.conf",
:order => params[:template_order],
})}
it { is_expected.to contain_concat__fragment('configure_openidc_on_port_35357').with({
:target => "${keystone::wsgi::apache::priority}-keystone_wsgi_admin.conf",
:target => "10-keystone_wsgi_admin.conf",
:order => params[:template_order],
})}
end
@ -102,5 +116,4 @@ describe 'keystone::federation::openidc' do
it { is_expected.to contain_package(platform_parameters[:openidc_package_name]) }
end
end