Add support for [DEFAULT] vlan_qinq

... which was added during this cycle.

Depends-on: https://review.opendev.org/937372
Change-Id: I04a290574906562e17d4687514fa2b151a5666e4
This commit is contained in:
Takashi Kajinami
2025-02-07 22:35:58 +09:00
parent 2657b15177
commit 0a1647dfb6
3 changed files with 20 additions and 17 deletions

View File

@@ -278,8 +278,14 @@
# Defaults to $facts['os_service_default'].
#
# [*vlan_transparent*]
# (optional) Allow plugins that support it to create VLAN transparent networks
# Defaults to $facts['os_service_default']
# (optional) Allow plugins that support it to create VLAN transparent
# networks.
# Defaults to $facts['os_service_default'].
#
# [*vlan_qinq*]
# (optional) Allow plugins that support it to create VLAN transparent
# networks using 0x8a88 ethertype.
# Defaults to $facts['os_service_default'].
#
class neutron (
$package_ensure = 'present',
@@ -339,6 +345,7 @@ class neutron (
$notification_retry = $facts['os_service_default'],
$max_allowed_address_pair = $facts['os_service_default'],
$vlan_transparent = $facts['os_service_default'],
$vlan_qinq = $facts['os_service_default'],
) {
include neutron::deps
@@ -380,6 +387,7 @@ class neutron (
'DEFAULT/global_physnet_mtu': value => $global_physnet_mtu;
'DEFAULT/max_allowed_address_pair': value => $max_allowed_address_pair;
'DEFAULT/vlan_transparent': value => $vlan_transparent;
'DEFAULT/vlan_qinq': value => $vlan_qinq;
'agent/root_helper': value => $root_helper;
'agent/root_helper_daemon': value => $root_helper_daemon;
'agent/report_interval': value => $report_interval;

View File

@@ -0,0 +1,4 @@
---
features:
- |
The new ``neutron::vlan_qinq`` parameter has been added.

View File

@@ -31,8 +31,7 @@ describe 'neutron' do
it_behaves_like 'with transport_url defined'
it_behaves_like 'with rootwrap daemon'
it_behaves_like 'with max_allowed_address_pair defined'
it_behaves_like 'when disabling vlan_transparent'
it_behaves_like 'when enabling vlan_transparent'
it_behaves_like 'when vlan transparent options defined'
end
shared_examples 'a neutron base installation' do
@@ -111,6 +110,7 @@ describe 'neutron' do
)
should contain_neutron_config('DEFAULT/vlan_transparent').with_value('<SERVICE DEFAULT>')
should contain_neutron_config('DEFAULT/vlan_qinq').with_value('<SERVICE DEFAULT>')
should contain_neutron_config('agent/root_helper').with_value('sudo neutron-rootwrap /etc/neutron/rootwrap.conf')
should contain_neutron_config('agent/root_helper_daemon').with_value('<SERVICE DEFAULT>')
should contain_neutron_config('agent/report_interval').with_value('<SERVICE DEFAULT>')
@@ -301,25 +301,16 @@ describe 'neutron' do
}
end
shared_examples 'when disabling vlan_transparent' do
shared_examples 'when vlan transparent options defined' do
before do
params.merge!(
:vlan_transparent => false
)
end
it do
should contain_neutron_config('DEFAULT/vlan_transparent').with_value(false)
end
end
shared_examples 'when enabling vlan_transparent' do
before do
params.merge!(
:vlan_transparent => true
:vlan_transparent => true,
:vlan_qinq => false,
)
end
it do
should contain_neutron_config('DEFAULT/vlan_transparent').with_value(true)
should contain_neutron_config('DEFAULT/vlan_qinq').with_value(false)
end
end