Merge "networking-sfc: Support [quota] parameters"

This commit is contained in:
Zuul 2022-04-14 08:59:59 +00:00 committed by Gerrit Code Review
commit 03396ad2fb
3 changed files with 110 additions and 0 deletions

44
manifests/quota/sfc.pp Normal file
View File

@ -0,0 +1,44 @@
# == Class: neutron::quta::sfc
#
# Setups neutron quota for networking-sfc.
#
# === Parameters
#
# [*quota_port_chain*]
# (Optional) Maximum number of port chain per tenant.
# Defaults to $::os_service_default.
#
# [*quota_port_pair_group*]
# (Optional) Maximum number of port pair group per tenant.
# Defaults to $::os_service_default.
#
# [*quota_port_pair*]
# (Optional) Maximum number of port pair per tenant.
# Defaults to $::os_service_default.
#
# [*quota_service_graphs*]
# (Optional) Maximum number of Service Graphs per tenant.
# Defaults to $::os_service_default.
#
# [*quota_flow_classifier*]
# (Optional) Maximum number of Flow Classifiers per tenant.
# Defaults to $::os_service_default.
#
class neutron::quota::sfc (
$quota_port_chain = $::os_service_default,
$quota_port_pair_group = $::os_service_default,
$quota_port_pair = $::os_service_default,
$quota_service_graphs = $::os_service_default,
$quota_flow_classifier = $::os_service_default
) {
include neutron::deps
neutron_config {
'quota/quota_port_chain': value => $quota_port_chain;
'quota/quota_port_pair_group': value => $quota_port_pair_group;
'quota/quota_port_pair': value => $quota_port_pair;
'quota/quota_service_graphs': value => $quota_service_graphs;
'quota/quota_flow_classifier': value => $quota_flow_classifier;
}
}

View File

@ -0,0 +1,5 @@
---
features:
- |
The new ``neutron::quota::sfc`` class has been added. This class manages
the ``[quota]`` parameters for the ``networking-sfc`` plugin.

View File

@ -0,0 +1,61 @@
require 'spec_helper'
describe 'neutron::quota::sfc' do
let :params do
{}
end
let :default_params do
{
:quota_port_chain => '<SERVICE DEFAULT>',
:quota_port_pair_group => '<SERVICE DEFAULT>',
:quota_port_pair => '<SERVICE DEFAULT>',
:quota_service_graphs => '<SERVICE DEFAULT>',
:quota_flow_classifier => '<SERVICE DEFAULT>',
}
end
shared_examples 'neutron::quota::sfc test' do
let :params_hash do
default_params.merge(params)
end
it 'configures quota in neutron.conf' do
params_hash.each_pair do |config,value|
should contain_neutron_config("quotas/#{config}").with_value( value )
end
end
end
shared_examples 'neutron::quota::sfc' do
context 'with default' do
it_behaves_like 'neutron::quota::sfc test'
end
context 'with provided parameters' do
before do
params.merge!({
:quota_port_chain => 10,
:quota_port_pair_group => 11,
:quota_port_pair => 100,
:quota_service_graphs => 12,
:quota_flow_classifier => 101,
})
end
it_behaves_like 'neutron::quota::sfc test'
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 'neutron::quota::sfc'
end
end
end