2014-07-02 14:01:37 +02:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe 'trove::conductor' do
|
|
|
|
|
2014-07-03 14:27:18 +02:00
|
|
|
shared_examples 'trove-conductor' do
|
|
|
|
|
|
|
|
context 'with default parameters' do
|
|
|
|
|
|
|
|
let :pre_condition do
|
2020-05-04 21:48:45 +09:00
|
|
|
"class { 'trove': }
|
|
|
|
class { 'trove::conductor::service_credentials':
|
|
|
|
password => 'verysecrete',
|
|
|
|
}"
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'includes required classes' do
|
|
|
|
is_expected.to contain_class('trove::deps')
|
|
|
|
is_expected.to contain_class('trove::params')
|
|
|
|
is_expected.to contain_class('trove::conductor::service_credentials')
|
2014-07-03 14:27:18 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
it 'installs trove-conductor package and service' do
|
2015-02-25 04:52:01 +01:00
|
|
|
is_expected.to contain_service('trove-conductor').with(
|
2014-07-03 14:27:18 +02:00
|
|
|
:name => platform_params[:conductor_service_name],
|
|
|
|
:ensure => 'running',
|
|
|
|
:hasstatus => true,
|
|
|
|
:enable => true
|
|
|
|
)
|
2015-02-25 04:52:01 +01:00
|
|
|
is_expected.to contain_package('trove-conductor').with(
|
2014-07-03 14:27:18 +02:00
|
|
|
:name => platform_params[:conductor_package_name],
|
|
|
|
:ensure => 'present',
|
2016-03-17 18:37:31 -06:00
|
|
|
:tag => ['openstack', 'trove-package'],
|
2014-07-03 14:27:18 +02:00
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'configures trove-conductor with default parameters' do
|
2016-06-01 10:47:05 -04:00
|
|
|
is_expected.to contain_trove_conductor_config('DEFAULT/transport_url').with_value('<SERVICE DEFAULT>')
|
2017-02-08 10:54:48 +08:00
|
|
|
is_expected.to contain_trove_conductor_config('DEFAULT/rpc_response_timeout').with_value('<SERVICE DEFAULT>')
|
|
|
|
is_expected.to contain_trove_conductor_config('DEFAULT/control_exchange').with_value('trove')
|
2017-03-08 16:31:17 +11:00
|
|
|
is_expected.to contain_trove_conductor_config('DEFAULT/remote_nova_client').with_ensure('absent')
|
|
|
|
is_expected.to contain_trove_conductor_config('DEFAULT/remote_cinder_client').with_ensure('absent')
|
|
|
|
is_expected.to contain_trove_conductor_config('DEFAULT/remote_neutron_client').with_ensure('absent')
|
2016-06-01 10:47:05 -04:00
|
|
|
is_expected.to contain_trove_conductor_config('oslo_messaging_notifications/transport_url').with_value('<SERVICE DEFAULT>')
|
2016-02-12 14:29:10 -07:00
|
|
|
is_expected.to contain_trove_conductor_config('oslo_messaging_rabbit/kombu_reconnect_delay').with_value('<SERVICE DEFAULT>')
|
2018-02-09 15:05:28 +08:00
|
|
|
is_expected.to contain_trove_conductor_config('oslo_messaging_rabbit/kombu_failover_strategy').with_value('<SERVICE DEFAULT>')
|
2016-04-19 15:11:20 +00:00
|
|
|
is_expected.to contain_trove_conductor_config('oslo_messaging_rabbit/amqp_durable_queues').with_value('<SERVICE DEFAULT>')
|
2016-04-01 11:23:03 -04:00
|
|
|
is_expected.to contain_trove_conductor_config('DEFAULT/trove_conductor_workers').with_value('8')
|
2016-04-07 03:31:18 -07:00
|
|
|
is_expected.to contain_trove_conductor_config('profiler/enabled').with_value('<SERVICE DEFAULT>')
|
|
|
|
is_expected.to contain_trove_conductor_config('profiler/trace_sqlalchemy').with_value('<SERVICE DEFAULT>')
|
2017-03-13 21:54:40 +08:00
|
|
|
is_expected.to contain_oslo__messaging__rabbit('trove_conductor_config').with(
|
|
|
|
:rabbit_use_ssl => '<SERVICE DEFAULT>',
|
2017-04-03 13:23:36 +03:00
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'configures trove-conductor with default logging parameters' do
|
|
|
|
is_expected.to contain_oslo__log('trove_conductor_config').with(
|
|
|
|
:use_syslog => '<SERVICE DEFAULT>',
|
|
|
|
:syslog_log_facility => '<SERVICE DEFAULT>',
|
|
|
|
:log_dir => '/var/log/trove',
|
|
|
|
:log_file => '/var/log/trove/trove-conductor.log',
|
|
|
|
:debug => '<SERVICE DEFAULT>',
|
2017-03-13 21:54:40 +08:00
|
|
|
)
|
2014-07-03 14:27:18 +02:00
|
|
|
end
|
|
|
|
|
2017-03-08 16:31:17 +11:00
|
|
|
context 'with single tenant mode enabled' do
|
|
|
|
let :pre_condition do
|
|
|
|
"class { 'trove':
|
|
|
|
single_tenant_mode => 'true'}
|
2020-05-04 21:48:45 +09:00
|
|
|
class { 'trove::conductor::service_credentials':
|
|
|
|
password => 'verysecrete',
|
|
|
|
}
|
2019-12-08 23:24:12 +01:00
|
|
|
class { 'trove::keystone::authtoken':
|
2017-03-08 16:31:17 +11:00
|
|
|
password => 'a_big_secret',
|
|
|
|
}"
|
|
|
|
end
|
|
|
|
it 'single tenant client values are set' do
|
|
|
|
is_expected.to contain_trove_conductor_config('DEFAULT/remote_nova_client').with_value('trove.common.single_tenant_remote.nova_client_trove_admin')
|
|
|
|
is_expected.to contain_trove_conductor_config('DEFAULT/remote_cinder_client').with_value('trove.common.single_tenant_remote.cinder_client_trove_admin')
|
|
|
|
is_expected.to contain_trove_conductor_config('DEFAULT/remote_neutron_client').with_value('trove.common.single_tenant_remote.neutron_client_trove_admin')
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2014-07-03 14:27:18 +02:00
|
|
|
context 'when using a single RabbitMQ server' do
|
|
|
|
let :pre_condition do
|
2020-05-04 21:48:45 +09:00
|
|
|
"class { 'trove': }
|
|
|
|
class { 'trove::conductor::service_credentials':
|
|
|
|
password => 'verysecrete',
|
2018-05-24 11:15:03 +08:00
|
|
|
}"
|
2014-07-03 14:27:18 +02:00
|
|
|
end
|
|
|
|
it 'configures trove-conductor with RabbitMQ' do
|
2016-04-19 15:11:20 +00:00
|
|
|
is_expected.to contain_trove_conductor_config('oslo_messaging_rabbit/rabbit_ha_queues').with_value('<SERVICE DEFAULT>')
|
|
|
|
is_expected.to contain_trove_conductor_config('oslo_messaging_rabbit/amqp_durable_queues').with_value('<SERVICE DEFAULT>')
|
2015-08-19 10:10:45 +08:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2015-08-19 12:50:34 +08:00
|
|
|
context 'when using a single RabbitMQ server with enable ha options' do
|
2015-08-19 10:10:45 +08:00
|
|
|
let :pre_condition do
|
|
|
|
"class { 'trove':
|
2020-05-04 21:48:45 +09:00
|
|
|
rabbit_ha_queues => 'true',
|
|
|
|
amqp_durable_queues => 'true',
|
|
|
|
}
|
|
|
|
class { 'trove::conductor::service_credentials':
|
|
|
|
password => 'verysecrete',
|
2018-05-24 11:15:03 +08:00
|
|
|
}"
|
2015-08-19 10:10:45 +08:00
|
|
|
end
|
|
|
|
it 'configures trove-api with RabbitMQ' do
|
|
|
|
is_expected.to contain_trove_conductor_config('oslo_messaging_rabbit/rabbit_ha_queues').with_value('true')
|
2015-08-19 12:50:34 +08:00
|
|
|
is_expected.to contain_trove_conductor_config('oslo_messaging_rabbit/amqp_durable_queues').with_value('true')
|
2014-07-03 14:27:18 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'when using multiple RabbitMQ servers' do
|
|
|
|
let :pre_condition do
|
|
|
|
"class { 'trove':
|
2020-05-04 21:48:45 +09:00
|
|
|
rabbit_ha_queues => true,
|
|
|
|
}
|
|
|
|
class { 'trove::conductor::service_credentials':
|
|
|
|
password => 'verysecrete',
|
2018-05-24 11:15:03 +08:00
|
|
|
}"
|
2014-07-03 14:27:18 +02:00
|
|
|
end
|
|
|
|
it 'configures trove-conductor with RabbitMQ' do
|
2015-08-19 10:10:45 +08:00
|
|
|
is_expected.to contain_trove_conductor_config('oslo_messaging_rabbit/rabbit_ha_queues').with_value('true')
|
2014-07-03 14:27:18 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'when using MySQL' do
|
|
|
|
let :pre_condition do
|
|
|
|
"class { 'trove':
|
2020-05-04 21:48:45 +09:00
|
|
|
database_connection => 'mysql://trove:pass@10.0.0.1/trove'
|
|
|
|
}
|
|
|
|
class { 'trove::conductor::service_credentials':
|
|
|
|
password => 'verysecrete',
|
|
|
|
}"
|
2014-07-03 14:27:18 +02:00
|
|
|
end
|
|
|
|
it 'configures trove-conductor with RabbitMQ' do
|
2015-03-24 15:50:03 +01:00
|
|
|
is_expected.to contain_trove_conductor_config('database/connection').with_value('mysql://trove:pass@10.0.0.1/trove')
|
2014-07-03 14:27:18 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2015-04-01 11:25:57 -04:00
|
|
|
|
|
|
|
context 'with SSL enabled with kombu' do
|
|
|
|
let :pre_condition do
|
|
|
|
"class { 'trove':
|
|
|
|
nova_proxy_admin_pass => 'verysecrete',
|
|
|
|
rabbit_use_ssl => true,
|
|
|
|
kombu_ssl_ca_certs => '/path/to/ssl/ca/certs',
|
|
|
|
kombu_ssl_certfile => '/path/to/ssl/cert/file',
|
|
|
|
kombu_ssl_keyfile => '/path/to/ssl/keyfile',
|
|
|
|
kombu_ssl_version => 'TLSv1'}"
|
|
|
|
end
|
|
|
|
|
|
|
|
it do
|
2017-03-13 21:54:40 +08:00
|
|
|
is_expected.to contain_oslo__messaging__rabbit('trove_conductor_config').with(
|
|
|
|
:rabbit_use_ssl => true,
|
|
|
|
:kombu_ssl_ca_certs => '/path/to/ssl/ca/certs',
|
|
|
|
:kombu_ssl_certfile => '/path/to/ssl/cert/file',
|
|
|
|
:kombu_ssl_keyfile => '/path/to/ssl/keyfile',
|
|
|
|
:kombu_ssl_version => 'TLSv1',
|
|
|
|
)
|
2015-04-01 11:25:57 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'with SSL enabled without kombu' do
|
|
|
|
let :pre_condition do
|
|
|
|
"class { 'trove':
|
2020-05-04 21:48:45 +09:00
|
|
|
rabbit_use_ssl => true
|
|
|
|
}
|
|
|
|
class { 'trove::conductor::service_credentials':
|
|
|
|
password => 'verysecrete',
|
|
|
|
}"
|
2015-04-01 11:25:57 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
it do
|
2017-03-13 21:54:40 +08:00
|
|
|
is_expected.to contain_oslo__messaging__rabbit('trove_conductor_config').with(
|
|
|
|
:rabbit_use_ssl => true,
|
|
|
|
:kombu_ssl_ca_certs => '<SERVICE DEFAULT>',
|
|
|
|
:kombu_ssl_certfile => '<SERVICE DEFAULT>',
|
|
|
|
:kombu_ssl_keyfile => '<SERVICE DEFAULT>',
|
|
|
|
:kombu_ssl_version => '<SERVICE DEFAULT>',
|
|
|
|
)
|
2015-04-01 11:25:57 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'with SSL disabled' do
|
|
|
|
let :pre_condition do
|
|
|
|
"class { 'trove':
|
2020-05-04 21:48:45 +09:00
|
|
|
rabbit_use_ssl => false
|
|
|
|
}
|
|
|
|
class { 'trove::conductor::service_credentials':
|
|
|
|
password => 'verysecrete',
|
|
|
|
}"
|
2015-04-01 11:25:57 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
it do
|
2017-03-13 21:54:40 +08:00
|
|
|
is_expected.to contain_oslo__messaging__rabbit('trove_conductor_config').with(
|
|
|
|
:rabbit_use_ssl => false,
|
|
|
|
:kombu_ssl_ca_certs => '<SERVICE DEFAULT>',
|
|
|
|
:kombu_ssl_certfile => '<SERVICE DEFAULT>',
|
|
|
|
:kombu_ssl_keyfile => '<SERVICE DEFAULT>',
|
|
|
|
:kombu_ssl_version => '<SERVICE DEFAULT>',
|
|
|
|
)
|
2015-04-01 11:25:57 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2016-06-01 10:47:05 -04:00
|
|
|
context 'with transport_url entries' do
|
|
|
|
let :pre_condition do
|
|
|
|
"class { 'trove':
|
2017-02-08 10:54:48 +08:00
|
|
|
nova_proxy_admin_pass => 'verysecrete',
|
|
|
|
default_transport_url => 'rabbit://rabbit_user:password@localhost:5673',
|
|
|
|
rpc_response_timeout => '120',
|
|
|
|
control_exchange => 'openstack',
|
2016-06-01 10:47:05 -04:00
|
|
|
notification_transport_url => 'rabbit://rabbit_user:password@localhost:5673' }"
|
|
|
|
end
|
|
|
|
|
|
|
|
it do
|
|
|
|
is_expected.to contain_trove_conductor_config('DEFAULT/transport_url').with_value('rabbit://rabbit_user:password@localhost:5673')
|
2017-02-08 10:54:48 +08:00
|
|
|
is_expected.to contain_trove_conductor_config('DEFAULT/rpc_response_timeout').with_value('120')
|
|
|
|
is_expected.to contain_trove_conductor_config('DEFAULT/control_exchange').with_value('openstack')
|
2016-06-01 10:47:05 -04:00
|
|
|
is_expected.to contain_trove_conductor_config('oslo_messaging_notifications/transport_url').with_value('rabbit://rabbit_user:password@localhost:5673')
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2017-07-27 12:14:53 -04:00
|
|
|
context 'with amqp messaging' do
|
2016-05-12 16:13:30 -04:00
|
|
|
let :pre_condition do
|
2020-05-04 21:48:45 +09:00
|
|
|
"class { 'trove' : }
|
|
|
|
class { 'trove::conductor::service_credentials':
|
|
|
|
password => 'verysecrete',
|
|
|
|
}"
|
2016-05-12 16:13:30 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
it do
|
2016-06-01 10:47:05 -04:00
|
|
|
is_expected.to contain_trove_conductor_config('oslo_messaging_amqp/server_request_prefix').with_value('<SERVICE DEFAULT>')
|
|
|
|
is_expected.to contain_trove_conductor_config('oslo_messaging_amqp/broadcast_prefix').with_value('<SERVICE DEFAULT>')
|
|
|
|
is_expected.to contain_trove_conductor_config('oslo_messaging_amqp/group_request_prefix').with_value('<SERVICE DEFAULT>')
|
|
|
|
is_expected.to contain_trove_conductor_config('oslo_messaging_amqp/container_name').with_value('<SERVICE DEFAULT>')
|
|
|
|
is_expected.to contain_trove_conductor_config('oslo_messaging_amqp/idle_timeout').with_value('<SERVICE DEFAULT>')
|
|
|
|
is_expected.to contain_trove_conductor_config('oslo_messaging_amqp/trace').with_value('<SERVICE DEFAULT>')
|
|
|
|
is_expected.to contain_trove_conductor_config('oslo_messaging_amqp/ssl_ca_file').with_value('<SERVICE DEFAULT>')
|
|
|
|
is_expected.to contain_trove_conductor_config('oslo_messaging_amqp/ssl_cert_file').with_value('<SERVICE DEFAULT>')
|
|
|
|
is_expected.to contain_trove_conductor_config('oslo_messaging_amqp/ssl_key_file').with_value('<SERVICE DEFAULT>')
|
|
|
|
is_expected.to contain_trove_conductor_config('oslo_messaging_amqp/ssl_key_password').with_value('<SERVICE DEFAULT>')
|
|
|
|
is_expected.to contain_trove_conductor_config('oslo_messaging_amqp/allow_insecure_clients').with_value('<SERVICE DEFAULT>')
|
|
|
|
is_expected.to contain_trove_conductor_config('oslo_messaging_amqp/sasl_mechanisms').with_value('<SERVICE DEFAULT>')
|
|
|
|
is_expected.to contain_trove_conductor_config('oslo_messaging_amqp/sasl_config_dir').with_value('<SERVICE DEFAULT>')
|
|
|
|
is_expected.to contain_trove_conductor_config('oslo_messaging_amqp/sasl_config_name').with_value('<SERVICE DEFAULT>')
|
|
|
|
is_expected.to contain_trove_conductor_config('oslo_messaging_amqp/username').with_value('<SERVICE DEFAULT>')
|
|
|
|
is_expected.to contain_trove_conductor_config('oslo_messaging_amqp/password').with_value('<SERVICE DEFAULT>')
|
2016-05-12 16:13:30 -04:00
|
|
|
end
|
|
|
|
end
|
2016-05-31 11:50:45 -03:00
|
|
|
|
2014-07-02 14:01:37 +02:00
|
|
|
end
|
|
|
|
|
2016-10-25 09:51:35 -06:00
|
|
|
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({ :os_workers => 8 }))
|
|
|
|
end
|
|
|
|
|
|
|
|
let(:platform_params) do
|
|
|
|
case facts[:osfamily]
|
|
|
|
when 'Debian'
|
|
|
|
{ :conductor_package_name => 'trove-conductor',
|
|
|
|
:conductor_service_name => 'trove-conductor' }
|
|
|
|
when 'RedHat'
|
|
|
|
{ :conductor_package_name => 'openstack-trove-conductor',
|
|
|
|
:conductor_service_name => 'openstack-trove-conductor' }
|
|
|
|
end
|
|
|
|
end
|
|
|
|
it_configures 'trove-conductor'
|
2014-07-03 14:27:18 +02:00
|
|
|
end
|
2014-07-02 14:01:37 +02:00
|
|
|
end
|
2014-07-03 14:27:18 +02:00
|
|
|
|
2014-07-02 14:01:37 +02:00
|
|
|
end
|