# NB: These param defaults should match the ones used by the opendaylight
# class, which are defined in opendaylight::params
- # TODO: Remove this possible source of bugs^^
# Extract params if given, defaulting to odl class defaults if not
extra_features = options.fetch(:extra_features, ['odl-restconf'])
default_features = options.fetch(:default_features, ['standard', 'wrap', 'ssh'])
ha_db_modules = options.fetch(:ha_db_modules, { 'default' => false })
username = options.fetch(:username, 'admin')
password = options.fetch(:password, 'admin')
- log_max_size = options.fetch(:log_max_size, '10GB')
- log_max_rollover = options.fetch(:log_max_rollover, 2)
+ log_max_size = options.fetch(:log_max_size, '500MB')
+ log_max_rollover = options.fetch(:log_max_rollover, 4)
+ log_pattern = options.fetch(:log_pattern, '%d{ISO8601} | %-5p | %-16t | %-60c{6} | %m%n')
log_rollover_fileindex = options.fetch(:log_rollover_fileindex, 'min')
+ enable_paxosgi_logger = options.fetch(:enable_paxosgi_logger, false)
snat_mechanism = options.fetch(:snat_mechanism, 'controller')
enable_tls = options.fetch(:enable_tls, false)
tls_keystore_password = options.fetch(:tls_keystore_password, 'dummypass')
password => #{password},
log_max_size => '#{log_max_size}',
log_max_rollover => #{log_max_rollover},
+ log_pattern => '#{log_pattern}',
log_rollover_fileindex => #{log_rollover_fileindex},
+ enable_paxosgi_logger => #{enable_paxosgi_logger},
snat_mechanism => #{snat_mechanism},
enable_tls => #{enable_tls},
tls_keystore_password => #{tls_keystore_password},
# Shared function for validations related to log file settings
def log_settings_validations(options = {})
# Should contain log level config file with correct file size and rollover values
- log_max_size = options.fetch(:log_max_size, '10GB')
- log_max_rollover = options.fetch(:log_max_rollover, 2)
+ log_max_size = options.fetch(:log_max_size, '500MB')
+ log_max_rollover = options.fetch(:log_max_rollover, 4)
+ log_pattern = options.fetch(:log_pattern, '%d{ISO8601} | %-5p | %-16t | %-60c{6} | %m%n')
log_rollover_fileindex = options.fetch(:log_rollover_fileindex, 'min')
log_mechanism = options.fetch(:log_mechanism, 'file')
+ enable_paxosgi_logger = options.fetch(:enable_paxosgi_logger, false)
if log_mechanism == 'console'
describe file('/opt/opendaylight/etc/org.ops4j.pax.logging.cfg') do
its(:content) { should match /^log4j2.appender.rolling.strategy.fileIndex = #{log_rollover_fileindex}/ }
end
end
+ describe file('/opt/opendaylight/etc/org.ops4j.pax.logging.cfg') do
+ its(:content) { should match /^log4j2.pattern = #{log_pattern}/ }
+ if enable_paxosgi_logger == true
+ its(:content) { should match /^log4j2.rootLogger.appenderRef.PaxOsgi.ref = PaxOsgi/ }
+ its(:content) { should match /^# OSGi appender/ }
+ its(:content) { should match /^log4j2.appender.osgi.type = PaxOsgi/ }
+ its(:content) { should match /^log4j2.appender.osgi.name = PaxOsgi/ }
+ its(:content) { should match /^log4j2.appender.osgi.filter = */ }
+ else
+ its(:content) { should_not match /^log4j2.rootLogger.appenderRef.PaxOsgi.ref = PaxOsgi/ }
+ its(:content) { should_not match /^# OSGi appender/ }
+ its(:content) { should_not match /^log4j2.appender.osgi.type = PaxOsgi/ }
+ its(:content) { should_not match /^log4j2.appender.osgi.name = PaxOsgi/ }
+ its(:content) { should_not match /^log4j2.appender.osgi.filter = */ }
+ end
+ end
end
# Shared function for validations related to the Karaf config file
def karaf_config_validations(options = {})
# NB: These param defaults should match the ones used by the opendaylight
# class, which are defined in opendaylight::params
- # TODO: Remove this possible source of bugs^^
extra_features = options.fetch(:extra_features, [])
default_features = options.fetch(:default_features, ['standard', 'wrap', 'ssh'])
def port_config_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^^
odl_rest_port = options.fetch(:odl_rest_port, 8181)
describe file('/opt/opendaylight/etc/jetty.xml') do
def odl_bind_ip_validation(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^^
odl_bind_ip = options.fetch(:odl_bind_ip, '0.0.0.0')
if odl_bind_ip != '0.0.0.0'
def log_level_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^^
log_levels = options.fetch(:log_levels, {})
if log_levels.empty?
def enable_ha_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^^
enable_ha = options.fetch(:enable_ha, false)
ha_node_ips = options.fetch(:ha_node_ips, [])
odl_bind_ip = options.fetch(:odl_bind_ip, '0.0.0.0')
def username_password_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^^
odl_username = options.fetch(:username, 'admin')
odl_password = options.fetch(:password, 'admin')
odl_check_url = 'http://127.0.0.1:8181/restconf'
def snat_mechanism_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^^
snat_mechanism = options.fetch(:snat_mechanism, 'controller')
describe file('/opt/opendaylight/etc/opendaylight/datastore/initial/config/netvirt-natservice-config.xml') do
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'
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)
def websocket_address_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^^
odl_bind_ip = options.fetch(:odl_bind_ip, '0.0.0.0')
if not odl_bind_ip.eql? '0.0.0.0'
def tls_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^^
tls_keystore_password = options.fetch(:tls_keystore_password)
odl_rest_port = options.fetch(:odl_rest_port, 8181)
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
def inactivity_probe_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^^
inactivity_probe = options.fetch(:inactivity_probe, :undef)
unless inactivity_probe == :undef