Update ODL to Beryllium ERP RC2.2
[integration/packaging/puppet-opendaylight.git] / spec / spec_helper.rb
index c82ec7e1242458061a6665b9370aa3d76897f552..80cd929c3fb91d2a102685cd9fe766b7cea68a8c 100644 (file)
@@ -91,6 +91,7 @@ def karaf_feature_tests(options = {})
 
   # The order of this list concat matters
   features = default_features + extra_features
+  features_csv = features.join(',')
 
   # Confirm properties of Karaf features config file
   # NB: These hashes don't work with Ruby 1.8.7, but we
@@ -101,7 +102,13 @@ def karaf_feature_tests(options = {})
       'path'        => '/opt/opendaylight/etc/org.apache.karaf.features.cfg',
       'owner'   => 'odl',
       'group'   => 'odl',
-      'content'     => /^featuresBoot=#{features.join(",")}/
+    )
+  }
+  it {
+    should contain_file_line('featuresBoot').with(
+      'path'  => '/opt/opendaylight/etc/org.apache.karaf.features.cfg',
+      'line'  => "featuresBoot=#{features_csv}",
+      'match' => '^featuresBoot=.*$',
     )
   }
 end
@@ -181,18 +188,50 @@ def log_level_tests(options = {})
           'path'        => '/opt/opendaylight/etc/org.ops4j.pax.logging.cfg',
           'owner'   => 'odl',
           'group'   => 'odl',
-          'content'     => /log4j.logger.#{logger} = #{level}/
+          'content'     => /^log4j.logger.#{logger} = #{level}/
         )
       }
     end
   end
 end
 
+# Shared tests that specialize in testing enabling L3 via ODL OVSDB
+def enable_l3_tests(options = {})
+  # Extract params
+  # NB: This default value should be the same as one in opendaylight::params
+  # TODO: Remove this possible source of bugs^^
+  enable_l3 = options.fetch(:enable_l3, 'no')
+
+  if [true, 'yes'].include? enable_l3
+    # Confirm ODL OVSDB L3 is enabled
+    it {
+      should contain_file('custom.properties').with(
+        'ensure'      => 'file',
+        'path'        => '/opt/opendaylight/etc/custom.properties',
+        'owner'   => 'odl',
+        'group'   => 'odl',
+        'content'     => /^ovsdb.l3.fwd.enabled=yes/
+      )
+    }
+  elsif [false, 'no'].include? enable_l3
+    # Confirm ODL OVSDB L3 is disabled
+    it {
+      should contain_file('custom.properties').with(
+        'ensure'      => 'file',
+        'path'        => '/opt/opendaylight/etc/custom.properties',
+        'owner'   => 'odl',
+        'group'   => 'odl',
+        'content'     => /^ovsdb.l3.fwd.enabled=no/
+      )
+    }
+  end
+end
+
 def tarball_install_tests(options = {})
   # Extract params
   # NB: These default values should be the same as ones in opendaylight::params
   # TODO: Remove this possible source of bugs^^
-  tarball_url = options.fetch(:tarball_url, 'https://nexus.opendaylight.org/content/repositories/staging/org/opendaylight/integration/distribution-karaf/0.4.0-Beryllium-RC1/distribution-karaf-0.4.0-Beryllium-RC1.tar.gz')
+  tarball_url = options.fetch(:tarball_url, 'https://nexus.opendaylight.org/content/repositories/staging/org/opendaylight/integration/distribution-karaf/0.4.0-Beryllium-RC2.2/distribution-karaf-0.4.0-Beryllium-RC2.2.tar.gz')
   unitfile_url = options.fetch(:unitfile_url, 'https://github.com/dfarrell07/opendaylight-systemd/archive/master/opendaylight-unitfile.tar.gz')
   osfamily = options.fetch(:osfamily, 'RedHat')