Fix unit tests of barbican::api
This change ensures that default values are tested in unit tests. Also, test cases for retry_scheduler parameters are added. Change-Id: I69caa4e29ea4018105166bc879c6a93622df256a
This commit is contained in:
parent
cafa5e99f2
commit
8166a080b9
@ -72,7 +72,9 @@ describe 'barbican::api' do
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
[{
|
[
|
||||||
|
{},
|
||||||
|
{
|
||||||
:bind_host => '127.0.0.1',
|
:bind_host => '127.0.0.1',
|
||||||
:bind_port => '9312',
|
:bind_port => '9312',
|
||||||
:default_transport_url => 'rabbit://bugs:bugs_bunny@localhost:1234/rabbithost',
|
:default_transport_url => 'rabbit://bugs:bugs_bunny@localhost:1234/rabbithost',
|
||||||
@ -105,8 +107,8 @@ describe 'barbican::api' do
|
|||||||
:enabled_crypto_plugins => ['simple_crypto'],
|
:enabled_crypto_plugins => ['simple_crypto'],
|
||||||
:enabled_certificate_plugins => ['simple_certificate', 'dogtag'],
|
:enabled_certificate_plugins => ['simple_certificate', 'dogtag'],
|
||||||
:enabled_certificate_event_plugins => ['simple_certificate_event', 'foo_event'],
|
:enabled_certificate_event_plugins => ['simple_certificate_event', 'foo_event'],
|
||||||
:retry_scheduler_initial_delay_seconds => 20.0,
|
:retry_scheduler_initial_delay_seconds => 10,
|
||||||
:retry_scheduler_periodic_interval_max_seconds => 20.0,
|
:retry_scheduler_periodic_interval_max_seconds => 11,
|
||||||
:max_allowed_secret_in_bytes => 20000,
|
:max_allowed_secret_in_bytes => 20000,
|
||||||
:max_allowed_request_size_in_bytes => 2000000,
|
:max_allowed_request_size_in_bytes => 2000000,
|
||||||
:enable_proxy_headers_parsing => false,
|
:enable_proxy_headers_parsing => false,
|
||||||
@ -208,6 +210,13 @@ describe 'barbican::api' do
|
|||||||
.with_value(param_hash[:multiple_secret_stores_enabled])
|
.with_value(param_hash[:multiple_secret_stores_enabled])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'configures retry scheduler' do
|
||||||
|
is_expected.to contain_barbican_config('retry_scheduler/initial_delay_seconds') \
|
||||||
|
.with_value(param_hash[:retry_scheduler_initial_delay_seconds])
|
||||||
|
is_expected.to contain_barbican_config('retry_scheduler/periodic_interval_max_seconds') \
|
||||||
|
.with_value(param_hash[:retry_scheduler_periodic_interval_max_seconds])
|
||||||
|
end
|
||||||
|
|
||||||
it 'resets the barbican_api pipeline' do
|
it 'resets the barbican_api pipeline' do
|
||||||
is_expected.to contain_barbican_api_paste_ini('pipeline:barbican_api/pipeline')\
|
is_expected.to contain_barbican_api_paste_ini('pipeline:barbican_api/pipeline')\
|
||||||
.with_value('cors http_proxy_to_wsgi unauthenticated-context apiapp')
|
.with_value('cors http_proxy_to_wsgi unauthenticated-context apiapp')
|
||||||
@ -247,8 +256,8 @@ describe 'barbican::api' do
|
|||||||
|
|
||||||
describe 'with SSL socket options set' do
|
describe 'with SSL socket options set' do
|
||||||
let :pre_condition do
|
let :pre_condition do
|
||||||
'class { "barbican::keystone::authtoken": password => "secret", }
|
'class { "barbican::keystone::authtoken": password => "secret", }
|
||||||
include apache'
|
include apache'
|
||||||
end
|
end
|
||||||
|
|
||||||
let :params do
|
let :params do
|
||||||
@ -267,8 +276,8 @@ describe 'barbican::api' do
|
|||||||
|
|
||||||
describe 'with SSL socket options left by default' do
|
describe 'with SSL socket options left by default' do
|
||||||
let :pre_condition do
|
let :pre_condition do
|
||||||
'class { "barbican::keystone::authtoken": password => "secret", }
|
'class { "barbican::keystone::authtoken": password => "secret", }
|
||||||
include apache'
|
include apache'
|
||||||
end
|
end
|
||||||
|
|
||||||
let :params do
|
let :params do
|
||||||
@ -284,8 +293,8 @@ describe 'barbican::api' do
|
|||||||
|
|
||||||
describe 'with SSL socket options set wrongly configured' do
|
describe 'with SSL socket options set wrongly configured' do
|
||||||
let :pre_condition do
|
let :pre_condition do
|
||||||
'class { "barbican::keystone::authtoken": password => "secret", }
|
'class { "barbican::keystone::authtoken": password => "secret", }
|
||||||
include apache'
|
include apache'
|
||||||
end
|
end
|
||||||
|
|
||||||
let :params do
|
let :params do
|
||||||
@ -301,8 +310,8 @@ describe 'barbican::api' do
|
|||||||
|
|
||||||
describe 'with keystone auth' do
|
describe 'with keystone auth' do
|
||||||
let :pre_condition do
|
let :pre_condition do
|
||||||
'class { "barbican::keystone::authtoken": password => "secret", }
|
'class { "barbican::keystone::authtoken": password => "secret", }
|
||||||
include apache'
|
include apache'
|
||||||
end
|
end
|
||||||
|
|
||||||
let :params do
|
let :params do
|
||||||
@ -372,9 +381,6 @@ describe 'barbican::api' do
|
|||||||
end
|
end
|
||||||
it_behaves_like 'barbican api redhat'
|
it_behaves_like 'barbican api redhat'
|
||||||
when 'Debian'
|
when 'Debian'
|
||||||
let :pre_condition do
|
|
||||||
'include apache'
|
|
||||||
end
|
|
||||||
let (:platform_params) do
|
let (:platform_params) do
|
||||||
{ :service_name => 'httpd' }
|
{ :service_name => 'httpd' }
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user