Add support for octavia_* parameters

Change-Id: I2e64b0864bed786d1c3f2912a3fddb7bdc7c9176
This commit is contained in:
Takashi Kajinami 2021-11-15 22:00:01 +09:00
parent 411dffea5d
commit 5ab004c528
4 changed files with 84 additions and 0 deletions

View File

@ -41,6 +41,7 @@ class rally::settings (
include rally::settings::manila
include rally::settings::murano
include rally::settings::nova
include rally::settings::octavia
include rally::settings::sahara
include rally::settings::swift
include rally::settings::tempest

View File

@ -0,0 +1,32 @@
# == Class: rally::settings::octavia
#
# Configure Rally benchmarking settings for Octavia
#
# === Parameters
#
# [*create_loadbalancer_timeout*]
# (Optional) Octavia create loadbalancer timeout.
# Defaults to $::os_service_default
#
# [*delete_loadbalancer_timeout*]
# (Optional) Octavia delete loadbalancer timeout.
# Defaults to $::os_service_default
#
# [*create_loadbalancer_poll_interval*]
# (Optional) Octavia create loadbalancer pool interval.
# Defaults to $::os_service_default
#
class rally::settings::octavia (
$create_loadbalancer_timeout = $::os_service_default,
$delete_loadbalancer_timeout = $::os_service_default,
$create_loadbalancer_poll_interval = $::os_service_default,
) {
include rally::deps
rally_config {
'openstack/octavia_create_loadbalancer_timeout': value => $create_loadbalancer_timeout;
'openstack/octavia_delete_loadbalancer_timeout': value => $delete_loadbalancer_timeout;
'openstack/octavia_create_loadbalancer_poll_interval': value => $create_loadbalancer_poll_interval;
}
}

View File

@ -0,0 +1,4 @@
---
features:
- |
The new ``rally::settings::octavia`` class has been added.

View File

@ -0,0 +1,47 @@
require 'spec_helper'
describe 'rally::settings::octavia' do
let :params do
{
}
end
let :rally_octavia_params do
{
:create_loadbalancer_timeout => 500,
:delete_loadbalancer_timeout => 50,
:create_loadbalancer_poll_interval => 2,
}
end
shared_examples_for 'with default parameters' do
it 'configures rally octavia settings with default parameters' do
is_expected.to contain_rally_config('openstack/octavia_create_loadbalancer_timeout').with(:value => '<SERVICE DEFAULT>')
is_expected.to contain_rally_config('openstack/octavia_delete_loadbalancer_timeout').with(:value => '<SERVICE DEFAULT>')
is_expected.to contain_rally_config('openstack/octavia_create_loadbalancer_poll_interval').with(:value => '<SERVICE DEFAULT>')
end
end
shared_examples_for 'with all parameters' do
before { params.merge!( rally_octavia_params ) }
it 'configures rally-settings-octavia settings with all parameters' do
is_expected.to contain_rally_config('openstack/octavia_create_loadbalancer_timeout').with(:value => 500)
is_expected.to contain_rally_config('openstack/octavia_delete_loadbalancer_timeout').with(:value => 50)
is_expected.to contain_rally_config('openstack/octavia_create_loadbalancer_poll_interval').with(:value => 2)
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 'with default parameters'
it_behaves_like 'with all parameters'
end
end
end