Configure files to support QoS DSCP marking feature.
genius-itm-config.xml is configured to support this feature.
default-tunnel-tos is '0' by default and 'inherit' for DSCP
marking support.
Change-Id: If06b1dd41235fb139642a77c0f098598d6d3018b
Signed-Off-By: Janki Chhatbar <jchhatba@redhat.com>
Signed-off-by: Tim Rozet <trozet@redhat.com>
- Disable MD-SAL Trust Store
2018-05-22 Release 8.1.3
- Remove ELAN manager config for SFC
+2018-05-23 Release 8.2.0
+- Configure tos option to support QoS DSCP marking
Valid options: A password string.
+### `inherit_dscp_marking`
+
+Specifies whether DSCP marking is enabled for packets egressing out of OVS through
+VXLAN/GRE tunnels.
+
+Default: `false`
+
+Valid options: `true`, `false`
+
## Limitations
- Tested on CentOS 7 and Ubuntu 16.04.
+++ /dev/null
-<itm-config xmlns="urn:opendaylight:genius:itm:config">
- <gpe-extension-enabled>true</gpe-extension-enabled>
-</itm-config>
}
}
- # SFC Config
- if ('odl-netvirt-sfc' in $opendaylight::features) {
- file { 'genius-itm-config.xml':
+ # Config file for SFC and DSCP features
+ file { 'genius-itm-config.xml':
ensure => file,
path => '/opt/opendaylight/etc/opendaylight/datastore/initial/config/genius-itm-config.xml',
owner => 'odl',
group => 'odl',
- source => 'puppet:///modules/opendaylight/genius-itm-config.xml',
+ content => template('opendaylight/genius-itm-config.xml.erb'),
require => File['/opt/opendaylight/etc/opendaylight/datastore/initial/config'],
- }
}
#configure VPP routing node
# Optional. Defaults to undef.
# [*log_mechanism*]
# Sets logging mechanism for karaf logs
+# [*inherit_dscp_marking]
+# Sets tos option to enable QoS DSCP marking
+# Defaults to false
#
# === Deprecated Parameters
#
$tls_cert_file = $::opendaylight::params::tls_cert_file,
$tls_ca_cert_file = $::opendaylight::params::tls_ca_cert_file,
$log_mechanism = $::opendaylight::params::log_mechanism,
+ $inherit_dscp_marking = $::opendaylight::params::inherit_dscp_marking,
) inherits ::opendaylight::params {
# Validate OS family
$tls_ca_cert_file = undef
$tls_trusted_certs = []
$log_mechanism = 'file'
+ $inherit_dscp_marking = false
}
{
"name": "opendaylight-opendaylight",
- "version": "8.1.3",
+ "version": "8.2.0",
"author": "Daniel Farrell",
"summary": "Puppet module that installs and configures the OpenDaylight SDN controller",
"license": "BSD-2-Clause",
end
describe 'testing configuring SFC' do
+ context 'not using SFC feature' do
+ # Call specialized helper fn to install OpenDaylight
+ install_odl
+
+ # Call specialized helper fn for SFC config validations
+ sfc_validations
+ end
+
context 'using SFC feature' do
# Call specialized helper fn to install OpenDaylight
install_odl(extra_features: ['odl-netvirt-sfc'])
# Call specialized helper fn for SFC config validations
- sfc_validations
+ sfc_validations(extra_features: ['odl-netvirt-sfc'])
+ end
+ end
+
+ describe 'testing configuring tos value for DSCP marking' do
+ context 'not enabling DSCP marking' do
+ # Call specialized helper fn to install OpenDaylight
+ install_odl
+
+ # Call specialized helper fn for SFC config validations
+ dscp_validations
+ end
+
+ context 'enabling DSCP marking' do
+ # Call specialized helper fn to install OpenDaylight
+ install_odl(inherit_dscp_marking: true)
+
+ # Call specialized helper fn for SFC config validations
+ dscp_validations(inherit_dscp_marking: true)
end
end
osfamily = 'RedHat'
operatingsystem = 'CentOS'
operatingsystemmajrelease = '7'
+ context 'not using odl-netvirt-sfc feature' do
+ let(:facts) {{
+ :osfamily => osfamily,
+ :operatingsystem => operatingsystem,
+ :operatingsystemmajrelease => operatingsystemmajrelease,
+ }}
+
+ let(:params) {{ }}
+
+ # Run shared tests applicable to all supported OSs
+ # Note that this function is defined in spec_helper
+ generic_tests
+
+ # Run test that specialize in checking security groups
+ # Note that this function is defined in spec_helper
+ sfc_tests
+ end
+
context 'using odl-netvirt-sfc feature' do
let(:facts) {{
:osfamily => osfamily,
# Run test that specialize in checking security groups
# Note that this function is defined in spec_helper
- sfc_tests
+ sfc_tests(extra_features: ['odl-netvirt-sfc'])
+ end
+ end
+
+ # DSCP marking tests
+ describe 'DSCP marking tests' do
+ # Non-OS-type tests assume CentOS 7
+ # See issue #43 for reasoning:
+ # https://github.com/dfarrell07/puppet-opendaylight/issues/43#issue-57343159
+ osfamily = 'RedHat'
+ operatingsystem = 'CentOS'
+ operatingsystemmajrelease = '7'
+ context 'use default value' do
+ let(:facts) {{
+ :osfamily => osfamily,
+ :operatingsystem => operatingsystem,
+ :operatingsystemmajrelease => operatingsystemmajrelease,
+ }}
+
+ let(:params) {{ }}
+
+ # Run shared tests applicable to all supported OSs
+ # Note that this function is defined in spec_helper
+ generic_tests
+
+ # Run test that specialize in checking security groups
+ # Note that this function is defined in spec_helper
+ dscp_tests
+ end
+
+ context 'inherit DSCP values' do
+ let(:facts) {{
+ :osfamily => osfamily,
+ :operatingsystem => operatingsystem,
+ :operatingsystemmajrelease => operatingsystemmajrelease,
+ }}
+
+ let(:params) {{
+ :inherit_dscp_marking => :true,
+ }}
+
+ # Run shared tests applicable to all supported OSs
+ # Note that this function is defined in spec_helper
+ generic_tests
+
+ # Run test that specialize in checking security groups
+ # Note that this function is defined in spec_helper
+ dscp_tests(inherit_dscp_marking: true)
end
end
end
# Shared tests that specialize in testing SFC Config
-def sfc_tests()
+def sfc_tests(options = {})
+ extra_features = options.fetch(:extra_features, [])
+
+ if extra_features.include? 'odl-netvirt-sfc'
+ sfc_enabled = true
+ else
+ sfc_enabled = false
+ end
+
it { should contain_file('/opt/opendaylight/etc/opendaylight') }
it { should contain_file('/opt/opendaylight/etc/opendaylight/datastore')}
it { should contain_file('/opt/opendaylight/etc/opendaylight/datastore/initial')}
'path' => '/opt/opendaylight/etc/opendaylight/datastore/initial/config/genius-itm-config.xml',
'owner' => 'odl',
'group' => 'odl',
- 'source' => 'puppet:///modules/opendaylight/genius-itm-config.xml'
+ 'content' => /<gpe-extension-enabled>#{sfc_enabled}<\/gpe-extension-enabled>/
+ )
+ }
+end
+
+# Shared tests that specialize in testing DSCP marking config
+def dscp_tests(options = {})
+ inherit_dscp_marking = options.fetch(:inherit_dscp_marking, false)
+
+ if inherit_dscp_marking
+ it {
+ should contain_file('genius-itm-config.xml').with(
+ 'ensure' => 'file',
+ 'path' => '/opt/opendaylight/etc/opendaylight/datastore/initial/config/genius-itm-config.xml',
+ 'owner' => 'odl',
+ 'group' => 'odl',
+ 'content' => /<default-tunnel-tos>inherit<\/default-tunnel-tos>/
)
}
+ else
+ it {
+ should contain_file('genius-itm-config.xml').with(
+ 'ensure' => 'file',
+ 'path' => '/opt/opendaylight/etc/opendaylight/datastore/initial/config/genius-itm-config.xml',
+ 'owner' => 'odl',
+ 'group' => 'odl',
+ 'content' => /<default-tunnel-tos>0<\/default-tunnel-tos>/
+ )
+ }
+ end
end
# Shared tests that specialize in testing VPP routing node config
enable_tls = options.fetch(:enable_tls, false)
tls_keystore_password = options.fetch(:tls_keystore_password, 'dummypass')
log_mechanism = options.fetch(:log_mechanism, 'file')
+ inherit_dscp_marking = options.fetch(:inherit_dscp_marking, false)
# Build script for consumption by Puppet apply
it 'should work idempotently with no errors' do
enable_tls => #{enable_tls},
tls_keystore_password => #{tls_keystore_password},
log_mechanism => #{log_mechanism},
+ inherit_dscp_marking => #{inherit_dscp_marking},
}
EOS
end
# Shared function for validations related to SFC
-def sfc_validations()
+def sfc_validations(options = {})
# NB: This param default should match the one used by the opendaylight
# class, which is defined in opendaylight::params
# TODO: Remove this possible source of bugs^^
+ extra_features = options.fetch(:extra_features, [])
+ if extra_features.include? 'odl-netvirt-sfc'
+ sfc_enabled = true
+ else
+ sfc_enabled = false
+ end
+
describe file('/opt/opendaylight/etc/opendaylight/datastore/initial/config/genius-itm-config.xml') do
it { should be_file }
it { should be_owned_by 'odl' }
it { should be_grouped_into 'odl' }
- its(:content) { should match /<gpe-extension-enabled>true<\/gpe-extension-enabled>/ }
+ its(:content) { should match /<gpe-extension-enabled>#{sfc_enabled}<\/gpe-extension-enabled>/ }
+ end
+end
+
+# Shared function for validations related to tos value for DSCP marking
+def dscp_validations(options = {})
+ # NB: This param default should match the one used by the opendaylight
+ # class, which is defined in opendaylight::params
+ # TODO: Remove this possible source of bugs^^
+
+ inherit_dscp_marking = options.fetch(:inherit_dscp_marking, false)
+
+ if inherit_dscp_marking
+ describe file('/opt/opendaylight/etc/opendaylight/datastore/initial/config/genius-itm-config.xml') do
+ it { should be_file }
+ it { should be_owned_by 'odl' }
+ it { should be_grouped_into 'odl' }
+ its(:content) { should match /<default-tunnel-tos>inherit<\/default-tunnel-tos>/ }
+ end
end
end
--- /dev/null
+<itm-config xmlns="urn:opendaylight:genius:itm:config">
+ <def-tz-enabled>true</def-tz-enabled>
+ <def-tz-tunnel-type>vxlan</def-tz-tunnel-type>
+ <tunnel-aggregation>
+ <tunnel-type>vxlan</tunnel-type>
+ <enabled>false</enabled>
+ </tunnel-aggregation>
+ <%- if scope.lookupvar('opendaylight::inherit_dscp_marking') -%>
+ <default-tunnel-tos>inherit</default-tunnel-tos>
+ <%- else -%>
+ <default-tunnel-tos>0</default-tunnel-tos>
+ <%- end -%>
+ <%- if scope.lookupvar('opendaylight::features').include?('odl-netvirt-sfc') -%>
+ <gpe-extension-enabled>true</gpe-extension-enabled>
+ <%- else -%>
+ <gpe-extension-enabled>false</gpe-extension-enabled>
+ <%- end -%>
+</itm-config>
\ No newline at end of file