- Configure tos option to support QoS DSCP marking
2018-06-28 Release 8.2.1
- Bind karaf shell to ODL bind IP
+2018-07-16 Release 8.3.0
+- Disable regular polling of OF statistics
Valid options: `true`, `false`
+### `stats_polling_enabled`
+
+Enables statistics polling of OpenFlow entities like table, groups.
+
+Default: `false`
+
+Valid options: `true`, `false`
+
## Limitations
- Tested on CentOS 7 and Ubuntu 16.04.
password => $::opendaylight::password,
before => Service['opendaylight'],
}
+
+ # Configure OpenFlow entities' statistics polling
+ file { 'openflowplugin.cfg':
+ ensure => file,
+ path => '/opt/opendaylight/etc/org.opendaylight.openflowplugin.cfg',
+ # Set user:group owners
+ owner => 'odl',
+ group => 'odl',
+ }
+ file_line { 'stats-polling':
+ ensure => present,
+ path => '/opt/opendaylight/etc/org.opendaylight.openflowplugin.cfg',
+ line => "is-statistics-polling-on=${::opendaylight::stats_polling_enabled}",
+ match => '^is-statistics-polling-on=.*$',
+ }
}
# Optional. Defaults to undef.
# [*log_mechanism*]
# Sets logging mechanism for karaf logs
-# [*inherit_dscp_marking]
+# [*inherit_dscp_marking*]
# Sets tos option to enable QoS DSCP marking
# Defaults to false
-#
+# [*stats_polling_enabled*]
+# Enables statistics polling of OpenFlow entities like table, groups.
+# Defaults to false
# === Deprecated Parameters
#
# [*ha_node_index*]
$tls_ca_cert_file = $::opendaylight::params::tls_ca_cert_file,
$log_mechanism = $::opendaylight::params::log_mechanism,
$inherit_dscp_marking = $::opendaylight::params::inherit_dscp_marking,
+ $stats_polling_enabled = $::opendaylight::params::stats_polling_enabled,
) inherits ::opendaylight::params {
# Validate OS family
$tls_trusted_certs = []
$log_mechanism = 'file'
$inherit_dscp_marking = false
+ $stats_polling_enabled = false
}
{
"name": "opendaylight-opendaylight",
- "version": "8.2.1",
+ "version": "8.3.0",
"author": "Daniel Farrell",
"summary": "Puppet module that installs and configures the OpenDaylight SDN controller",
"license": "BSD-2-Clause",
tls_validations(enable_tls: true, tls_keystore_password: '123456')
end
end
+
+ describe 'testing stats polling enablement' do
+ context 'with polling enabled' do
+ # Call specialized helper fn to install OpenDaylight
+ install_odl(stats_polling_enabled: true)
+
+ # Call specialized helper fn for polling enablement validations
+ stats_polling_validations(stats_polling_enabled: true)
+ end
+
+ context 'with polling disabled' do
+ # Call specialized helper fn to install OpenDaylight
+ install_odl
+
+ # Call specialized helper fn for polling enablement validations
+ stats_polling_validations
+ end
+
+ end
end
odl_tls_tests(enable_tls:true, tls_keystore_password:'123456')
end
end
+
+ describe 'polling enablement settings' 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'
+
+ # Default statistics polling off
+ context 'do not poll ovs statistics' 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 specific to log settings
+ stats_polling_enablement_tests
+ end
+
+ # Default statistics polling on
+ context 'poll ovs statistics' do
+ let(:facts) {{
+ :osfamily => osfamily,
+ :operatingsystem => operatingsystem,
+ :operatingsystemmajrelease => operatingsystemmajrelease,
+ }}
+
+ let(:params) {{
+ :stats_polling_enabled => true,
+ }}
+
+ # Run shared tests applicable to all supported OSs
+ # Note that this function is defined in spec_helper
+ generic_tests
+
+ # Run test specific to log settings
+ stats_polling_enablement_tests(stats_polling_enabled:true)
+ end
+ end
end
}
end
end
+
+def stats_polling_enablement_tests(options = {})
+ # Extract params
+ # NB: This default value should be the same as one in opendaylight::params
+ # TODO: Remove this possible source of bugs^^
+ stats_polling_enabled = options.fetch(:stats_polling_enabled, false)
+ # Confirm properties of ODL REST port config file
+ # NB: These hashes don't work with Ruby 1.8.7, but we
+ # don't support 1.8.7 so that's okay. See issue #36.
+ it {
+ should contain_file('openflowplugin.cfg').with(
+ 'ensure' => 'file',
+ 'path' => '/opt/opendaylight/etc/org.opendaylight.openflowplugin.cfg',
+ 'owner' => 'odl',
+ 'group' => 'odl',
+ )
+ should contain_file_line('stats-polling').with(
+ 'ensure' => 'present',
+ 'path' => '/opt/opendaylight/etc/org.opendaylight.openflowplugin.cfg',
+ 'line' => "is-statistics-polling-on=#{stats_polling_enabled}",
+ 'match' => '^is-statistics-polling-on=.*$',
+ )
+ }
+end
\ No newline at end of file
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)
+ stats_polling_enabled = options.fetch(:stats_polling_enabled, false)
# Build script for consumption by Puppet apply
it 'should work idempotently with no errors' do
tls_keystore_password => #{tls_keystore_password},
log_mechanism => #{log_mechanism},
inherit_dscp_marking => #{inherit_dscp_marking},
+ stats_polling_enabled => #{stats_polling_enabled},
}
EOS
its(:content) { should match /<Property name="jetty.secure.port" default="#{odl_rest_port}" \/>/ }
end
end
+
+# Shared function for validations related to OVS statistics polling
+def stats_polling_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^^
+
+ stats_polling_enabled = options.fetch(:stats_polling_enabled, false)
+ describe file('/opt/opendaylight/etc/org.opendaylight.openflowplugin.cfg') do
+ it { should be_file }
+ it { should be_owned_by 'odl' }
+ it { should be_grouped_into 'odl' }
+ its(:content) { should match /is-statistics-polling-on=#{stats_polling_enabled}/ }
+ end
+end