From 9da8ee942d731a386d174176e741e05e6ab06cf8 Mon Sep 17 00:00:00 2001 From: Denis Egorenko Date: Wed, 21 Oct 2015 14:18:31 +0300 Subject: [PATCH] Change section name for AMQP qpid parameters According to docs for liberty and kilo [1,2] should be section 'oslo_messaging_qpid' instead of 'DEFAULT'. [1] http://docs.openstack.org/liberty/config-reference/content/configuring-rpc.html [2] http://docs.openstack.org/kilo/config-reference/content/configuring-rpc.html Change-Id: I0dbdda51fc20cec95cbcf8769034692a5ffb92d6 --- manifests/init.pp | 26 ++++++++-------- spec/classes/neutron_init_spec.rb | 50 +++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+), 13 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 52ff28b2e..5801187ed 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -500,19 +500,19 @@ class neutron ( if $rpc_backend == 'qpid' or $rpc_backend == 'neutron.openstack.common.rpc.impl_qpid' { neutron_config { - 'DEFAULT/qpid_hostname': value => $qpid_hostname; - 'DEFAULT/qpid_port': value => $qpid_port; - 'DEFAULT/qpid_username': value => $qpid_username; - 'DEFAULT/qpid_password': value => $qpid_password, secret => true; - 'DEFAULT/qpid_heartbeat': value => $qpid_heartbeat; - 'DEFAULT/qpid_protocol': value => $qpid_protocol; - 'DEFAULT/qpid_tcp_nodelay': value => $qpid_tcp_nodelay; - 'DEFAULT/qpid_reconnect': value => $qpid_reconnect; - 'DEFAULT/qpid_reconnect_timeout': value => $qpid_reconnect_timeout; - 'DEFAULT/qpid_reconnect_limit': value => $qpid_reconnect_limit; - 'DEFAULT/qpid_reconnect_interval_min': value => $qpid_reconnect_interval_min; - 'DEFAULT/qpid_reconnect_interval_max': value => $qpid_reconnect_interval_max; - 'DEFAULT/qpid_reconnect_interval': value => $qpid_reconnect_interval; + 'oslo_messaging_qpid/qpid_hostname': value => $qpid_hostname; + 'oslo_messaging_qpid/qpid_port': value => $qpid_port; + 'oslo_messaging_qpid/qpid_username': value => $qpid_username; + 'oslo_messaging_qpid/qpid_password': value => $qpid_password, secret => true; + 'oslo_messaging_qpid/qpid_heartbeat': value => $qpid_heartbeat; + 'oslo_messaging_qpid/qpid_protocol': value => $qpid_protocol; + 'oslo_messaging_qpid/qpid_tcp_nodelay': value => $qpid_tcp_nodelay; + 'oslo_messaging_qpid/qpid_reconnect': value => $qpid_reconnect; + 'oslo_messaging_qpid/qpid_reconnect_timeout': value => $qpid_reconnect_timeout; + 'oslo_messaging_qpid/qpid_reconnect_limit': value => $qpid_reconnect_limit; + 'oslo_messaging_qpid/qpid_reconnect_interval_min': value => $qpid_reconnect_interval_min; + 'oslo_messaging_qpid/qpid_reconnect_interval_max': value => $qpid_reconnect_interval_max; + 'oslo_messaging_qpid/qpid_reconnect_interval': value => $qpid_reconnect_interval; } } diff --git a/spec/classes/neutron_init_spec.rb b/spec/classes/neutron_init_spec.rb index 33cb3cd36..d51f47346 100644 --- a/spec/classes/neutron_init_spec.rb +++ b/spec/classes/neutron_init_spec.rb @@ -81,6 +81,7 @@ describe 'neutron' do it_configures 'with service_plugins' it_configures 'without memcache_servers' it_configures 'with memcache_servers' + it_configures 'with qpid rpc backend' end shared_examples_for 'a neutron base installation' do @@ -157,6 +158,55 @@ describe 'neutron' do end end + shared_examples_for 'with qpid rpc backend' do + before do + params.merge!({ :rpc_backend => 'qpid' }) + end + + it { is_expected.to contain_neutron_config('DEFAULT/rpc_backend').with_value('qpid') } + + context 'when default params' do + it { is_expected.to contain_neutron_config('oslo_messaging_qpid/qpid_username').with_value('guest') } + it { is_expected.to contain_neutron_config('oslo_messaging_qpid/qpid_password').with_value('guest').with_secret(true) } + it { is_expected.to contain_neutron_config('oslo_messaging_qpid/qpid_hostname').with_value('localhost') } + it { is_expected.to contain_neutron_config('oslo_messaging_qpid/qpid_port').with_value('5672') } + it { is_expected.to contain_neutron_config('oslo_messaging_qpid/qpid_protocol').with_value('tcp') } + it { is_expected.to contain_neutron_config('oslo_messaging_qpid/qpid_heartbeat').with_value('60') } + it { is_expected.to contain_neutron_config('oslo_messaging_qpid/qpid_tcp_nodelay').with_value('true') } + it { is_expected.to contain_neutron_config('oslo_messaging_qpid/qpid_reconnect').with_value('true') } + it { is_expected.to contain_neutron_config('oslo_messaging_qpid/qpid_reconnect_timeout').with_value('0') } + it { is_expected.to contain_neutron_config('oslo_messaging_qpid/qpid_reconnect_limit').with_value('0') } + it { is_expected.to contain_neutron_config('oslo_messaging_qpid/qpid_reconnect_interval_min').with_value('0') } + it { is_expected.to contain_neutron_config('oslo_messaging_qpid/qpid_reconnect_interval_max').with_value('0') } + it { is_expected.to contain_neutron_config('oslo_messaging_qpid/qpid_reconnect_interval').with_value('0') } + end + + context 'when passing params' do + before do + params.merge!({ + :qpid_password => 'pass', + :qpid_username => 'guest2', + :qpid_hostname => 'localhost2', + :qpid_port => '5673', + :qpid_protocol => 'udp', + :qpid_heartbeat => '89', + :qpid_tcp_nodelay => 'false', + :qpid_reconnect => 'false', + }) + end + + it { is_expected.to contain_neutron_config('oslo_messaging_qpid/qpid_username').with_value('guest2') } + it { is_expected.to contain_neutron_config('oslo_messaging_qpid/qpid_password').with_value('pass').with_secret(true) } + it { is_expected.to contain_neutron_config('oslo_messaging_qpid/qpid_hostname').with_value('localhost2') } + it { is_expected.to contain_neutron_config('oslo_messaging_qpid/qpid_port').with_value('5673') } + it { is_expected.to contain_neutron_config('oslo_messaging_qpid/qpid_protocol').with_value('udp') } + it { is_expected.to contain_neutron_config('oslo_messaging_qpid/qpid_heartbeat').with_value('89') } + it { is_expected.to contain_neutron_config('oslo_messaging_qpid/qpid_tcp_nodelay').with_value('false') } + it { is_expected.to contain_neutron_config('oslo_messaging_qpid/qpid_reconnect').with_value('false') } + end + + end + shared_examples_for 'with SSL socket options set' do before do params.merge!(