a6aff52bc8
This change adds possibility to configure ZeroMQ messaging system for openstack services. Change-Id: Ic6a81926545fccb0945ee939c1ba69a62d6fdf5c
67 lines
2.9 KiB
Ruby
67 lines
2.9 KiB
Ruby
require 'spec_helper'
|
|
|
|
describe 'oslo::messaging::zmq' do
|
|
|
|
let (:title) { 'keystone_config' }
|
|
|
|
shared_examples 'oslo-messaging-zmq' do
|
|
|
|
context 'with default parameters' do
|
|
it 'configure zmq default params' do
|
|
is_expected.to contain_keystone_config('DEFAULT/rpc_cast_timeout').with_value('<SERVICE DEFAULT>')
|
|
is_expected.to contain_keystone_config('DEFAULT/rpc_poll_timeout').with_value('<SERVICE DEFAULT>')
|
|
is_expected.to contain_keystone_config('DEFAULT/rpc_zmq_bind_address').with_value('<SERVICE DEFAULT>')
|
|
is_expected.to contain_keystone_config('DEFAULT/rpc_zmq_bind_port_retries').with_value('<SERVICE DEFAULT>')
|
|
is_expected.to contain_keystone_config('DEFAULT/rpc_zmq_concurrency').with_value('<SERVICE DEFAULT>')
|
|
is_expected.to contain_keystone_config('DEFAULT/rpc_zmq_contexts').with_value('<SERVICE DEFAULT>')
|
|
is_expected.to contain_keystone_config('DEFAULT/rpc_zmq_host').with_value('<SERVICE DEFAULT>')
|
|
is_expected.to contain_keystone_config('DEFAULT/rpc_zmq_ipc_dir').with_value('<SERVICE DEFAULT>')
|
|
is_expected.to contain_keystone_config('DEFAULT/rpc_zmq_matchmaker').with_value('<SERVICE DEFAULT>')
|
|
is_expected.to contain_keystone_config('DEFAULT/rpc_zmq_max_port').with_value('<SERVICE DEFAULT>')
|
|
is_expected.to contain_keystone_config('DEFAULT/rpc_zmq_min_port').with_value('<SERVICE DEFAULT>')
|
|
is_expected.to contain_keystone_config('DEFAULT/rpc_zmq_topic_backlog').with_value('<SERVICE DEFAULT>')
|
|
is_expected.to contain_keystone_config('DEFAULT/use_pub_sub').with_value('<SERVICE DEFAULT>')
|
|
is_expected.to contain_keystone_config('DEFAULT/zmq_target_expire').with_value('<SERVICE DEFAULT>')
|
|
end
|
|
|
|
end
|
|
|
|
context 'with overridden parameters' do
|
|
let :params do
|
|
{ :rpc_zmq_bind_address => '0.0.0.0',
|
|
:rpc_zmq_bind_port_retries => '10',
|
|
:rpc_zmq_concurrency => 'native',
|
|
:rpc_zmq_contexts => '2',
|
|
}
|
|
end
|
|
|
|
it 'configure zmq with overriden values' do
|
|
is_expected.to contain_keystone_config('DEFAULT/rpc_zmq_bind_address').with_value('0.0.0.0')
|
|
is_expected.to contain_keystone_config('DEFAULT/rpc_zmq_bind_port_retries').with_value('10')
|
|
is_expected.to contain_keystone_config('DEFAULT/rpc_zmq_concurrency').with_value('native')
|
|
is_expected.to contain_keystone_config('DEFAULT/rpc_zmq_contexts').with_value('2')
|
|
end
|
|
end
|
|
|
|
context 'with wrong zmq concurrency' do
|
|
let :params do
|
|
{ :rpc_zmq_concurrency => 'some_another' }
|
|
end
|
|
|
|
it_raises 'a Puppet::Error', /Unsupported type of zmq concurrency is used/
|
|
end
|
|
end
|
|
|
|
on_supported_os({
|
|
:supported_os => OSDefaults.get_supported_os
|
|
}).each do |os,facts|
|
|
context "on #{os}" do
|
|
let (:facts) do
|
|
facts.merge!(OSDefaults.get_facts())
|
|
end
|
|
|
|
it_behaves_like 'oslo-messaging-zmq'
|
|
end
|
|
end
|
|
end
|