# Tests that are common to all possible configurations
def generic_tests(options = {})
java_opts = options.fetch(:java_opts, '')
- odl_bind_ip = options.fetch(:odl_bind_ip, '127.0.0.1')
+ odl_bind_ip = options.fetch(:odl_bind_ip, '0.0.0.0')
+ inactivity_probe = options.fetch(:inactivity_probe, :undef)
# Confirm that module compiles
it { should compile }
should contain_file_line('Karaf Java Options').with(
'ensure' => 'present',
'path' => '/opt/opendaylight/bin/karaf',
- 'line' => "EXTRA_JAVA_OPTS=#{java_options}",
+ 'line' => "EXTRA_JAVA_OPTS=\"#{java_options}\"",
'match' => '^EXTRA_JAVA_OPTS=.*$',
'after' => '^PROGNAME=.*$'
)
}
+ it {
+ should contain_file('org.opendaylight.ovsdb.library.cfg').with(
+ 'ensure' => 'file',
+ 'path' => '/opt/opendaylight/etc/org.opendaylight.ovsdb.library.cfg',
+ 'owner' => 'odl',
+ 'group' => 'odl',
+ 'content' => /ovsdb-listener-ip = #{odl_bind_ip}/
+ )
+ }
+
+ it {
+ should contain_file('default-openflow-connection-config.xml').with(
+ 'ensure' => 'file',
+ 'path' => '/opt/opendaylight/etc/opendaylight/datastore/initial/config/default-openflow-connection-config.xml',
+ 'owner' => 'odl',
+ 'group' => 'odl',
+ 'content' => /<address>#{odl_bind_ip}<\/address>/
+ )
+ }
+
+ unless inactivity_probe == :undef
+ it {
+ should contain_file('Configure inactivity probe timer').with(
+ 'ensure' => 'file',
+ 'path' => '/opt/opendaylight/etc/opendaylight/datastore/initial/config/netvirt-elanmanager-config.xml',
+ 'owner' => 'odl',
+ 'group' => 'odl',
+ 'content' => /<controller-inactivity-probe>#{inactivity_probe}<\/controller-inactivity-probe>/
+ )
+ }
+ end
+
end
# Shared tests that specialize in testing log file size and rollover
log_max_size = options.fetch(:log_max_size, '10GB')
log_max_rollover = options.fetch(:log_max_rollover, 2)
log_rollover_fileindex = options.fetch(:log_rollover_fileindex, 'min')
+ log_pattern = options.fetch(:log_pattern, '%d{ISO8601} | %-5p | %-16t | %-60c{6} | %m%n')
log_mechanism = options.fetch(:log_mechanism, 'file')
if log_mechanism == 'console'
)
}
end
+ it {
+ should contain_file_line('logpattern').with(
+ 'path' => '/opt/opendaylight/etc/org.ops4j.pax.logging.cfg',
+ 'line' => "log4j2.pattern = #{log_pattern}",
+ 'match' => '^log4j2.pattern.*$',
+ )
+ }
end
# Shared tests that specialize in testing Karaf feature installs
'group' => 'odl',
)
should contain_file('org.opendaylight.ovsdb.library.cfg').with(
- 'ensure' => 'file',
- 'path' => '/opt/opendaylight/etc/org.opendaylight.ovsdb.library.cfg',
- 'owner' => 'odl',
- 'group' => 'odl',
- 'source' => 'puppet:///modules/opendaylight/org.opendaylight.ovsdb.library.cfg'
+ 'ensure' => 'file',
+ 'path' => '/opt/opendaylight/etc/org.opendaylight.ovsdb.library.cfg',
+ 'owner' => 'odl',
+ 'group' => 'odl',
+ 'content' => /use-ssl = true/
)
should contain_file('/opt/opendaylight/configuration/ssl').with(
'ensure' => 'directory',
'match' => '^is-statistics-polling-on=.*$',
)
}
-end
\ No newline at end of file
+end