Clean up deprecated health_manager parameters
This is follow-up of dd729322ab31b72194ab58f630fdc20a35527549 and removes the deprecated the health_manager class parameters. Now these parameters should be set in the controller class because they are used by multiple processes(health-manager and worker). Change-Id: Ic121682758a3ddea8ae5f99af85e9627ee6850ce
This commit is contained in:
parent
6840de653f
commit
4ff90f40cf
@ -2,6 +2,10 @@
|
||||
#
|
||||
# === Parameters
|
||||
#
|
||||
# [*heartbeat_key*]
|
||||
# (required) Key to validate amphora messages.
|
||||
# Defaults to undef
|
||||
#
|
||||
# [*amp_active_retries*]
|
||||
# (optional) Retry attempts to wait for Amphora to become active.
|
||||
# Defaults to $::os_service_default
|
||||
@ -243,10 +247,6 @@
|
||||
# when it connects back to the controllers to report its health.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*heartbeat_key*]
|
||||
# (optional) Key to validate amphora messages.
|
||||
# Defaults to undef
|
||||
#
|
||||
# [*heartbeat_interval*]
|
||||
# (optional) Sleep time between sending heartbeats.
|
||||
# Defaults to undef
|
||||
@ -258,6 +258,7 @@
|
||||
# Defaults to undef
|
||||
#
|
||||
class octavia::controller (
|
||||
$heartbeat_key,
|
||||
$amp_active_retries = $::os_service_default,
|
||||
$amp_active_wait_sec = $::os_service_default,
|
||||
$amp_flavor_id = '65',
|
||||
@ -312,10 +313,7 @@ class octavia::controller (
|
||||
$vrrp_garp_refresh_interval = $::os_service_default,
|
||||
$vrrp_garp_refresh_count = $::os_service_default,
|
||||
$controller_ip_port_list = $::os_service_default,
|
||||
# TODO(tkainam): Make this parameter required when we remove
|
||||
# health_manager::heartbeat_key
|
||||
$heartbeat_key = undef,
|
||||
$heartbeat_interval = undef,
|
||||
$heartbeat_interval = $::os_service_default,
|
||||
# DEPRECATED PARAMETERS
|
||||
$port_detach_timeout = undef,
|
||||
) inherits octavia::params {
|
||||
@ -323,6 +321,8 @@ class octavia::controller (
|
||||
include octavia::deps
|
||||
include octavia::db
|
||||
|
||||
validate_legacy(String, 'validate_string', $heartbeat_key)
|
||||
|
||||
if $port_detach_timeout != undef {
|
||||
warning('The octavia::controller::port_detach_timeout parameter is deprecated. \
|
||||
Use the octavia::networking class instead')
|
||||
@ -394,18 +394,7 @@ Use the octavia::networking class instead')
|
||||
'keepalived_vrrp/vrrp_garp_refresh_interval' : value => $vrrp_garp_refresh_interval;
|
||||
'keepalived_vrrp/vrrp_garp_refresh_count' : value => $vrrp_garp_refresh_count;
|
||||
'health_manager/controller_ip_port_list' : value => join(any2array($controller_ip_port_list), ',');
|
||||
}
|
||||
|
||||
# TODO(tkajinam): Remove these if-condition when octavia::health_manager
|
||||
# parameters are removed.
|
||||
if $heartbeat_key != undef {
|
||||
octavia_config{
|
||||
'health_manager/heartbeat_key' : value => $heartbeat_key, secret => true;
|
||||
}
|
||||
}
|
||||
if $heartbeat_interval != undef {
|
||||
octavia_config{
|
||||
'health_manager/heartbeat_interval' : value => $heartbeat_interval;
|
||||
}
|
||||
'health_manager/heartbeat_key' : value => $heartbeat_key, secret => true;
|
||||
'health_manager/heartbeat_interval' : value => $heartbeat_interval;
|
||||
}
|
||||
}
|
||||
|
@ -57,14 +57,6 @@
|
||||
# (optional) The number of workers health_manager spawns
|
||||
# Defaults to undef
|
||||
#
|
||||
# [*heartbeat_key*]
|
||||
# (optional) Key to validate amphora messages.
|
||||
# Defaults to undef
|
||||
#
|
||||
# [*heartbeat_interval*]
|
||||
# (optional) Sleep time between sending heartbeats.
|
||||
# Defaults to undef
|
||||
#
|
||||
class octavia::health_manager (
|
||||
$manage_service = true,
|
||||
$enabled = true,
|
||||
@ -80,21 +72,11 @@ class octavia::health_manager (
|
||||
$failover_threshold = $::os_service_default,
|
||||
# DEPRECATED PARAMETERS
|
||||
$workers = undef,
|
||||
$heartbeat_key = undef,
|
||||
$heartbeat_interval = undef,
|
||||
) inherits octavia::params {
|
||||
|
||||
include octavia::deps
|
||||
include octavia::controller
|
||||
|
||||
if $heartbeat_key != undef {
|
||||
warning('The heartbeat_key parameter is deprecated. Use the octavia::controller class parameter instead.')
|
||||
validate_legacy(String, 'validate_string', $heartbeat_key)
|
||||
}
|
||||
if $heartbeat_interval != undef {
|
||||
warning('The heartbeat_interval parameter is deprecated. Use the octavia::controller class parameter instead.')
|
||||
}
|
||||
|
||||
package { 'octavia-health-manager':
|
||||
ensure => $package_ensure,
|
||||
name => $::octavia::params::health_manager_package_name,
|
||||
@ -136,18 +118,4 @@ Use health_update_threads and stats_update_threads instead')
|
||||
'health_manager/sock_rlimit' : value => $sock_rlimit;
|
||||
'health_manager/failover_threshold' : value => $failover_threshold;
|
||||
}
|
||||
|
||||
if $::octavia::controller::heartbeat_key == undef {
|
||||
if $heartbeat_key == undef {
|
||||
fail('The heartbeat_key parameter is required.')
|
||||
}
|
||||
octavia_config {
|
||||
'health_manager/heartbeat_key': value => $heartbeat_key, secret => true;
|
||||
}
|
||||
}
|
||||
if $::octavia::controller::heartbeat_interval == undef {
|
||||
octavia_config {
|
||||
'health_manager/heartbeat_interval': value => pick($heartbeat_interval, $::os_service_default);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,11 @@
|
||||
---
|
||||
upgrade:
|
||||
- |
|
||||
The following parameters of the ``octavia::health_manager`` class have been
|
||||
removed.
|
||||
|
||||
- ``heartbeat_interval``
|
||||
- ``heartbeat_key``
|
||||
|
||||
- |
|
||||
Now the ``octavia::controller::heartbeat_key`` parameter is required.
|
@ -4,16 +4,23 @@ describe 'octavia::controller' do
|
||||
|
||||
shared_examples_for 'octavia-controller' do
|
||||
|
||||
let :req_params do
|
||||
{ :heartbeat_key => 'abcdefghi' }
|
||||
end
|
||||
|
||||
context 'with invalid lb topology' do
|
||||
let :params do
|
||||
{ :loadbalancer_topology => 'foo', }
|
||||
req_params.merge({
|
||||
:loadbalancer_topology => 'foo'
|
||||
})
|
||||
end
|
||||
it { is_expected.to raise_error(Puppet::Error) }
|
||||
end
|
||||
|
||||
context 'configured with specific parameters' do
|
||||
let :params do
|
||||
{ :amp_active_retries => '30',
|
||||
req_params.merge({
|
||||
:amp_active_retries => '30',
|
||||
:amp_active_wait_sec => '10',
|
||||
:amp_flavor_id => '42',
|
||||
:amp_image_tag => 'amphorae1',
|
||||
@ -67,8 +74,7 @@ describe 'octavia::controller' do
|
||||
:vrrp_garp_refresh_count => 2,
|
||||
:controller_ip_port_list => ['1.2.3.4:5555', '4.3.2.1:5555'],
|
||||
:heartbeat_interval => 10,
|
||||
:heartbeat_key => 'default_key',
|
||||
}
|
||||
})
|
||||
end
|
||||
|
||||
it 'configures with the specified values' do
|
||||
@ -126,72 +132,79 @@ describe 'octavia::controller' do
|
||||
is_expected.to contain_octavia_config('keepalived_vrrp/vrrp_garp_refresh_count').with_value(2)
|
||||
is_expected.to contain_octavia_config('health_manager/controller_ip_port_list').with_value('1.2.3.4:5555,4.3.2.1:5555')
|
||||
is_expected.to contain_octavia_config('health_manager/heartbeat_interval').with_value(10)
|
||||
is_expected.to contain_octavia_config('health_manager/heartbeat_key').with_value('default_key')
|
||||
end
|
||||
end
|
||||
|
||||
it 'configures with the default values' do
|
||||
is_expected.to contain_octavia_config('controller_worker/amp_active_retries').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('controller_worker/amp_active_wait_sec').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('controller_worker/amp_flavor_id').with_value('65')
|
||||
is_expected.to contain_octavia_config('controller_worker/amp_image_tag').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('controller_worker/amp_image_owner_id').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('controller_worker/amp_secgroup_list').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('controller_worker/amp_boot_network_list').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('controller_worker/loadbalancer_topology').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('controller_worker/amphora_driver').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('controller_worker/compute_driver').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('controller_worker/network_driver').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('controller_worker/volume_driver').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('controller_worker/image_driver').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('controller_worker/amp_ssh_key_name').with_value('octavia-ssh-key')
|
||||
is_expected.to contain_octavia_config('controller_worker/amp_timezone').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('controller_worker/amphora_delete_retries').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('controller_worker/amphora_delete_retry_interval').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('haproxy_amphora/timeout_client_data').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('haproxy_amphora/timeout_member_connect').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('haproxy_amphora/timeout_member_data').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('haproxy_amphora/timeout_tcp_inspect').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('haproxy_amphora/connection_max_retries').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('haproxy_amphora/connection_retry_interval').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('haproxy_amphora/connection_logging').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('haproxy_amphora/active_connection_max_retries').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('haproxy_amphora/active_connection_retry_interval').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('haproxy_amphora/failover_connection_max_retries').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('haproxy_amphora/failover_connection_retry_interval').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('haproxy_amphora/build_rate_limit').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('haproxy_amphora/build_active_retries').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('haproxy_amphora/build_retry_interval').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('haproxy_amphora/default_connection_limit').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('networking/port_detach_timeout').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('amphora_agent/agent_request_read_timeout').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('amphora_agent/agent_tls_protocol').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('amphora_agent/admin_log_targets').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('amphora_agent/administrative_log_facility').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('amphora_agent/forward_all_logs').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('amphora_agent/tenant_log_targets').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('amphora_agent/user_log_facility').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('haproxy_amphora/user_log_format').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('amphora_agent/log_protocol').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('amphora_agent/log_retry_count').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('amphora_agent/log_retry_interval').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('amphora_agent/log_queue_size').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('amphora_agent/logging_template_override').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('amphora_agent/disable_local_log_storage').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('keepalived_vrrp/vrrp_advert_int').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('keepalived_vrrp/vrrp_check_interval').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('keepalived_vrrp/vrrp_fail_count').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('keepalived_vrrp/vrrp_success_count').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('keepalived_vrrp/vrrp_garp_refresh_interval').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('keepalived_vrrp/vrrp_garp_refresh_count').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('health_manager/controller_ip_port_list').with_value('<SERVICE DEFAULT>')
|
||||
#is_expected.to contain_octavia_config('health_manager/heartbeat_interval').with_value('<SERVICE DEFAULT>')
|
||||
#is_expected.to contain_octavia_config('health_manager/heartbeat_key').with_value('<SERVICE DEFAULT>')
|
||||
context 'configured with defaults' do
|
||||
let :params do
|
||||
req_params
|
||||
end
|
||||
|
||||
it 'configures with the default values' do
|
||||
is_expected.to contain_octavia_config('controller_worker/amp_active_retries').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('controller_worker/amp_active_wait_sec').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('controller_worker/amp_flavor_id').with_value('65')
|
||||
is_expected.to contain_octavia_config('controller_worker/amp_image_tag').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('controller_worker/amp_image_owner_id').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('controller_worker/amp_secgroup_list').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('controller_worker/amp_boot_network_list').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('controller_worker/loadbalancer_topology').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('controller_worker/amphora_driver').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('controller_worker/compute_driver').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('controller_worker/network_driver').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('controller_worker/volume_driver').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('controller_worker/image_driver').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('controller_worker/amp_ssh_key_name').with_value('octavia-ssh-key')
|
||||
is_expected.to contain_octavia_config('controller_worker/amp_timezone').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('controller_worker/amphora_delete_retries').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('controller_worker/amphora_delete_retry_interval').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('haproxy_amphora/timeout_client_data').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('haproxy_amphora/timeout_member_connect').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('haproxy_amphora/timeout_member_data').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('haproxy_amphora/timeout_tcp_inspect').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('haproxy_amphora/connection_max_retries').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('haproxy_amphora/connection_retry_interval').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('haproxy_amphora/connection_logging').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('haproxy_amphora/active_connection_max_retries').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('haproxy_amphora/active_connection_retry_interval').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('haproxy_amphora/failover_connection_max_retries').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('haproxy_amphora/failover_connection_retry_interval').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('haproxy_amphora/build_rate_limit').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('haproxy_amphora/build_active_retries').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('haproxy_amphora/build_retry_interval').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('haproxy_amphora/default_connection_limit').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('networking/port_detach_timeout').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('amphora_agent/agent_request_read_timeout').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('amphora_agent/agent_tls_protocol').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('amphora_agent/admin_log_targets').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('amphora_agent/administrative_log_facility').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('amphora_agent/forward_all_logs').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('amphora_agent/tenant_log_targets').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('amphora_agent/user_log_facility').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('haproxy_amphora/user_log_format').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('amphora_agent/log_protocol').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('amphora_agent/log_retry_count').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('amphora_agent/log_retry_interval').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('amphora_agent/log_queue_size').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('amphora_agent/logging_template_override').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('amphora_agent/disable_local_log_storage').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('keepalived_vrrp/vrrp_advert_int').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('keepalived_vrrp/vrrp_check_interval').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('keepalived_vrrp/vrrp_fail_count').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('keepalived_vrrp/vrrp_success_count').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('keepalived_vrrp/vrrp_garp_refresh_interval').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('keepalived_vrrp/vrrp_garp_refresh_count').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('health_manager/controller_ip_port_list').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('health_manager/heartbeat_interval').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('health_manager/heartbeat_key').with_value('abcdefghi')
|
||||
end
|
||||
end
|
||||
|
||||
context 'with ssh key access disabled' do
|
||||
let :params do
|
||||
{ :enable_ssh_access => false }
|
||||
req_params.merge({
|
||||
:enable_ssh_access => false
|
||||
})
|
||||
end
|
||||
|
||||
it 'disables configuration of SSH key properties' do
|
||||
@ -199,6 +212,14 @@ describe 'octavia::controller' do
|
||||
end
|
||||
end
|
||||
|
||||
context 'with an invalid value for heartbeat key' do
|
||||
let :params do
|
||||
req_params.merge({
|
||||
:heartbeat_key => 0,
|
||||
})
|
||||
end
|
||||
it { expect { is_expected.to raise_error(Puppet::Error) } }
|
||||
end
|
||||
end
|
||||
|
||||
on_supported_os({
|
||||
|
@ -6,39 +6,24 @@ describe 'octavia::health_manager' do
|
||||
{ :enabled => true,
|
||||
:manage_service => true,
|
||||
:package_ensure => 'latest',
|
||||
:heartbeat_key => 'default_key'
|
||||
}
|
||||
end
|
||||
|
||||
shared_examples_for 'octavia-health-manager' do
|
||||
|
||||
context 'without a heartbeat key' do
|
||||
before { params.delete(:heartbeat_key) }
|
||||
it { expect { is_expected.to raise_error(Puppet::Error) } }
|
||||
end
|
||||
|
||||
context 'with an invalid value for heartbeat key' do
|
||||
before do
|
||||
params.merge!({
|
||||
:heartbeat_key => 0,
|
||||
})
|
||||
end
|
||||
it { expect { is_expected.to raise_error(Puppet::Error) } }
|
||||
let :pre_condition do
|
||||
"include nova
|
||||
class { 'octavia::controller' :
|
||||
heartbeat_key => 'abcdefghi',
|
||||
}"
|
||||
end
|
||||
|
||||
context 'with minimal parameters' do
|
||||
before do
|
||||
params.merge!({
|
||||
:heartbeat_key => 'abcdefghi',
|
||||
})
|
||||
end
|
||||
it { is_expected.to contain_octavia_config('health_manager/heartbeat_key').with_value('abcdefghi') }
|
||||
it { is_expected.to contain_octavia_config('health_manager/health_update_threads').with_value('4') }
|
||||
it { is_expected.to contain_octavia_config('health_manager/stats_update_threads').with_value('4') }
|
||||
it { is_expected.to contain_octavia_config('health_manager/failover_threads').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_octavia_config('health_manager/heartbeat_timeout').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_octavia_config('health_manager/health_check_interval').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_octavia_config('health_manager/heartbeat_interval').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_octavia_config('health_manager/sock_rlimit').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_octavia_config('health_manager/failover_threshold').with_value('<SERVICE DEFAULT>') }
|
||||
end
|
||||
@ -106,7 +91,6 @@ describe 'octavia::health_manager' do
|
||||
:failover_threads => 10,
|
||||
:heartbeat_timeout => 60,
|
||||
:health_check_interval => 3,
|
||||
:heartbeat_interval => 42,
|
||||
:sock_rlimit => 1,
|
||||
:failover_threshold => 2,
|
||||
})
|
||||
@ -116,7 +100,6 @@ describe 'octavia::health_manager' do
|
||||
it { is_expected.to contain_octavia_config('health_manager/failover_threads').with_value(10) }
|
||||
it { is_expected.to contain_octavia_config('health_manager/heartbeat_timeout').with_value(60) }
|
||||
it { is_expected.to contain_octavia_config('health_manager/health_check_interval').with_value(3) }
|
||||
it { is_expected.to contain_octavia_config('health_manager/heartbeat_interval').with_value(42) }
|
||||
it { is_expected.to contain_octavia_config('health_manager/sock_rlimit').with_value(1) }
|
||||
it { is_expected.to contain_octavia_config('health_manager/failover_threshold').with_value(2) }
|
||||
end
|
||||
|
@ -15,11 +15,19 @@ describe 'octavia::worker' do
|
||||
|
||||
shared_examples_for 'octavia-worker' do
|
||||
|
||||
let :pre_condition do
|
||||
"include nova
|
||||
class { 'octavia::controller' :
|
||||
heartbeat_key => 'abcdefghi',
|
||||
}"
|
||||
end
|
||||
|
||||
context 'configured with specific parameters' do
|
||||
let :pre_condition do
|
||||
"include nova
|
||||
class { 'octavia::controller' :
|
||||
amp_flavor_id => '42',
|
||||
heartbeat_key => 'abcdefghi',
|
||||
}"
|
||||
end
|
||||
|
||||
@ -54,7 +62,8 @@ describe 'octavia::worker' do
|
||||
let :pre_condition do
|
||||
"include nova
|
||||
class { 'octavia::controller' :
|
||||
manage_ssh_access = false,
|
||||
enable_ssh_access => false,
|
||||
heartbeat_key => 'abcdefghi',
|
||||
}"
|
||||
end
|
||||
|
||||
@ -113,7 +122,8 @@ describe 'octavia::worker' do
|
||||
before do
|
||||
params.merge!({
|
||||
:manage_service => false,
|
||||
:enabled => false })
|
||||
:enabled => false
|
||||
})
|
||||
end
|
||||
|
||||
it 'does not configure octavia-worker service' do
|
||||
|
Loading…
x
Reference in New Issue
Block a user