Add tunable parameters of mistral-engine
This change introduces support for some tunable parameters of the mistral-engine service. Change-Id: I9f67af2855b6b423c3d5cfbf69f2ff7747aef7d0
This commit is contained in:
@@ -2,28 +2,77 @@ require 'spec_helper'
|
||||
|
||||
describe 'mistral::engine' do
|
||||
let :params do
|
||||
{
|
||||
:enabled => true,
|
||||
:manage_service => true,
|
||||
:host => 'foo_host',
|
||||
:topic => 'foo_topic',
|
||||
:version => '1.0',
|
||||
:execution_field_size_limit_kb => '1234',
|
||||
:evaluation_interval => 1234,
|
||||
:older_than => 60
|
||||
}
|
||||
{}
|
||||
end
|
||||
|
||||
shared_examples 'mistral::engine' do
|
||||
context 'config params' do
|
||||
context 'with defaults' do
|
||||
it { is_expected.to contain_class('mistral::params') }
|
||||
|
||||
it { is_expected.to contain_mistral_config('engine/host').with_value( params[:host] ) }
|
||||
it { is_expected.to contain_mistral_config('engine/topic').with_value( params[:topic] ) }
|
||||
it { is_expected.to contain_mistral_config('engine/version').with_value( params[:version] ) }
|
||||
it { is_expected.to contain_mistral_config('engine/execution_field_size_limit_kb').with_value( params[:execution_field_size_limit_kb] ) }
|
||||
it { is_expected.to contain_mistral_config('execution_expiration_policy/evaluation_interval').with_value( params[:evaluation_interval] ) }
|
||||
it { is_expected.to contain_mistral_config('execution_expiration_policy/older_than').with_value( params[:older_than] ) }
|
||||
it 'configures mistral-engine parameters' do
|
||||
is_expected.to contain_mistral_config('engine/host')\
|
||||
.with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_mistral_config('engine/topic')\
|
||||
.with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_mistral_config('engine/version')\
|
||||
.with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_mistral_config('engine/execution_field_size_limit_kb')
|
||||
.with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_mistral_config('engine/execution_integrity_check_delay')
|
||||
.with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_mistral_config('engine/execution_integrity_check_batch_size')
|
||||
.with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_mistral_config('engine/action_definition_cache_time')
|
||||
.with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_mistral_config('engine/start_subworkflows_via_rpc')
|
||||
.with_value('<SERVICE DEFAULT>')
|
||||
|
||||
is_expected.to contain_mistral_config('execution_expiration_policy/evaluation_interval')\
|
||||
.with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_mistral_config('execution_expiration_policy/older_than')\
|
||||
.with_value('<SERVICE DEFAULT>')
|
||||
end
|
||||
end
|
||||
|
||||
context 'config params' do
|
||||
before do
|
||||
params.merge!({
|
||||
:host => 'foo_host',
|
||||
:topic => 'foo_topic',
|
||||
:version => '1.0',
|
||||
:execution_field_size_limit_kb => 1024,
|
||||
:execution_integrity_check_delay => 20,
|
||||
:execution_integrity_check_batch_size => 5,
|
||||
:action_definition_cache_time => 60,
|
||||
:start_subworkflows_via_rpc => false,
|
||||
:evaluation_interval => 1234,
|
||||
:older_than => 60
|
||||
})
|
||||
end
|
||||
|
||||
it 'configures mistral-engine parameters' do
|
||||
is_expected.to contain_mistral_config('engine/host')\
|
||||
.with_value(params[:host])
|
||||
is_expected.to contain_mistral_config('engine/topic')\
|
||||
.with_value(params[:topic])
|
||||
is_expected.to contain_mistral_config('engine/version')\
|
||||
.with_value(params[:version])
|
||||
is_expected.to contain_mistral_config('engine/execution_field_size_limit_kb')
|
||||
.with_value(params[:execution_field_size_limit_kb])
|
||||
is_expected.to contain_mistral_config('engine/execution_integrity_check_delay')
|
||||
.with_value(params[:execution_integrity_check_delay])
|
||||
is_expected.to contain_mistral_config('engine/execution_integrity_check_batch_size')
|
||||
.with_value(params[:execution_integrity_check_batch_size])
|
||||
is_expected.to contain_mistral_config('engine/action_definition_cache_time')
|
||||
.with_value(params[:action_definition_cache_time])
|
||||
is_expected.to contain_mistral_config('engine/start_subworkflows_via_rpc')
|
||||
.with_value(params[:start_subworkflows_via_rpc])
|
||||
|
||||
is_expected.to contain_mistral_config('execution_expiration_policy/evaluation_interval')\
|
||||
.with_value(params[:evaluation_interval])
|
||||
is_expected.to contain_mistral_config('execution_expiration_policy/older_than')\
|
||||
.with_value(params[:older_than])
|
||||
end
|
||||
end
|
||||
|
||||
[{:enabled => true}, {:enabled => false}].each do |param_hash|
|
||||
@@ -40,7 +89,7 @@ describe 'mistral::engine' do
|
||||
:hasstatus => true,
|
||||
:hasrestart => true,
|
||||
:tag => 'mistral-service',
|
||||
)
|
||||
)
|
||||
is_expected.to contain_service('mistral-engine').that_subscribes_to(nil)
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user