Binds OpenFlow and OVSDB IPs
[integration/packaging/puppet-opendaylight.git] / spec / spec_helper.rb
index 06dbf1cb5d474f427ae418c0dfacf41078164e77..1000321d4bbe2c898cf54cc04b1de7d38de2ccf4 100644 (file)
@@ -15,7 +15,7 @@ RSpec::Puppet::Coverage.filters.push(*custom_filters)
 # 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')
 
   # Confirm that module compiles
   it { should compile }
@@ -79,6 +79,26 @@ def generic_tests(options = {})
     )
   }
 
+  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>/
+    )
+  }
+
 end
 
 # Shared tests that specialize in testing log file size and rollover
@@ -587,11 +607,11 @@ def odl_tls_tests(options = {})
         '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',
@@ -651,4 +671,4 @@ def stats_polling_enablement_tests(options = {})
       'match'  => '^is-statistics-polling-on=.*$',
     )
   }
-end
\ No newline at end of file
+end