Allow full customization of ODL RPM repo
[integration/packaging/puppet-opendaylight.git] / spec / classes / opendaylight_spec.rb
index 2d3d6eb1b66bff240d821bc57d69ce7de6b7a35b..79c62086e808bb89d168783cf34b85f531a89048 100644 (file)
@@ -11,7 +11,7 @@ describe 'opendaylight' do
         operatingsystem = 'Fedora'
 
         # All tests for supported versions of Fedora
-        ['24', '25'].each do |operatingsystemmajrelease|
+        ['25', '26'].each do |operatingsystemmajrelease|
           context "#{operatingsystemmajrelease}" do
             let(:facts) {{
               :osfamily => osfamily,
@@ -46,6 +46,11 @@ describe 'opendaylight' do
             # NB: Only testing defaults here, specialized enabling HA tests elsewhere
             # Note that this function is defined in spec_helper
             enable_ha_tests
+
+            # Run tests that specialize in checking log file settings
+            # NB: Only testing defaults here, specialized log file settings tests elsewhere
+            # Note that this function is defined in spec_helper
+            log_file_settings
           end
         end
 
@@ -105,6 +110,11 @@ describe 'opendaylight' do
             # NB: Only testing defaults here, specialized enabling HA tests elsewhere
             # Note that this function is defined in spec_helper
             enable_ha_tests
+
+            # Run tests that specialize in checking log file settings
+            # NB: Only testing defaults here, specialized log file settings tests elsewhere
+            # Note that this function is defined in spec_helper
+            log_file_settings
           end
         end
 
@@ -174,6 +184,11 @@ describe 'opendaylight' do
             # NB: Only testing defaults here, specialized enabling HA tests elsewhere
             # Note that this function is defined in spec_helper
             enable_ha_tests
+
+            # Run tests that specialize in checking log file settings
+            # NB: Only testing defaults here, specialized log file settings tests elsewhere
+            # Note that this function is defined in spec_helper
+            log_file_settings
           end
         end
 
@@ -336,7 +351,7 @@ describe 'opendaylight' do
       odl_rest_port_tests
     end
 
-    context 'overriding default REST port' do
+    context 'overriding default REST and IP port' do
       let(:facts) {{
         :osfamily => osfamily,
         :operatingsystem => operatingsystem,
@@ -345,6 +360,7 @@ describe 'opendaylight' do
 
       let(:params) {{
         :odl_rest_port => 7777,
+        :odl_bind_ip => '127.0.0.1'
       }}
 
       # Run shared tests applicable to all supported OSs
@@ -353,7 +369,7 @@ describe 'opendaylight' do
 
       # Run test that specialize in checking ODL REST port config
       # Note that this function is defined in spec_helper
-      odl_rest_port_tests(odl_rest_port: 7777)
+      odl_rest_port_tests(odl_rest_port: 7777, odl_bind_ip: '127.0.0.1')
     end
   end
 
@@ -429,6 +445,91 @@ describe 'opendaylight' do
     end
   end
 
+  # All custom log file size and rollover tests
+  describe 'log file size and rollover' 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'
+    context 'using default size and rollover' 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 file settings
+      log_file_settings
+    end
+
+    context 'customizing size' do
+      let(:facts) {{
+        :osfamily => osfamily,
+        :operatingsystem => operatingsystem,
+        :operatingsystemmajrelease => operatingsystemmajrelease,
+      }}
+
+      let(:params) {{
+        :log_max_size => '1GB',
+      }}
+
+      # Run shared tests applicable to all supported OSs
+      # Note that this function is defined in spec_helper
+      generic_tests
+
+      # Run test specific to log file settings
+      log_file_settings(log_max_size: '1GB')
+    end
+
+    context 'customizing rollover' do
+      let(:facts) {{
+        :osfamily => osfamily,
+        :operatingsystem => operatingsystem,
+        :operatingsystemmajrelease => operatingsystemmajrelease,
+      }}
+
+      let(:params) {{
+        :log_max_rollover => 3,
+      }}
+
+      # Run shared tests applicable to all supported OSs
+      # Note that this function is defined in spec_helper
+      generic_tests
+
+      # Run test specific to log file settings
+      log_file_settings(log_max_rollover: 3)
+    end
+
+    context 'customizing size and rollover' do
+      let(:facts) {{
+        :osfamily => osfamily,
+        :operatingsystem => operatingsystem,
+        :operatingsystemmajrelease => operatingsystemmajrelease,
+      }}
+
+      let(:params) {{
+        :log_max_size => '1GB',
+        :log_max_rollover => 3,
+      }}
+
+      # Run shared tests applicable to all supported OSs
+      # Note that this function is defined in spec_helper
+      generic_tests
+
+      # Run test specific to log file settings
+      log_file_settings(log_max_size: '1GB',
+                        log_max_rollover: 3)
+    end
+  end
+
   # All OVSDB HA enable/disable tests
   describe 'OVSDB HA enable/disable tests' do
     # Non-OS-type tests assume CentOS 7
@@ -496,6 +597,28 @@ describe 'opendaylight' do
         # Note that this function is defined in spec_helper
         enable_ha_tests(enable_ha: true, ha_node_ips: ['0.0.0.0', '127.0.0.1'])
       end
+
+      context 'using custom modules for sharding' do
+        let(:facts) {{
+          :osfamily => osfamily,
+          :operatingsystem => operatingsystem,
+          :operatingsystemmajrelease => operatingsystemmajrelease,
+        }}
+
+        let(:params) {{
+          :enable_ha => true,
+          :ha_node_ips => ['0.0.0.0', '127.0.0.1'],
+          :ha_db_modules => {'default' => false, 'topology' => 'urn:opendaylight:topology'}
+        }}
+
+        # Run shared tests applicable to all supported OSs
+        # Note that this function is defined in spec_helper
+        generic_tests
+
+        # Run test that specialize in checking ODL OVSDB HA config
+        # Note that this function is defined in spec_helper
+        enable_ha_tests(enable_ha: true, ha_node_ips: ['0.0.0.0', '127.0.0.1'])
+      end
     end
   end
 
@@ -513,7 +636,7 @@ describe 'opendaylight' do
       operatingsystemrelease = '7.0'
       operatingsystemmajrelease = '7'
 
-      context 'installing default RPM' do
+      context 'installing from default repo' do
         let(:facts) {{
           :osfamily => osfamily,
           :operatingsystem => operatingsystem,
@@ -529,8 +652,8 @@ describe 'opendaylight' do
         rpm_install_tests
       end
 
-      context 'installing Beryllium RPM' do
-        rpm_repo = 'opendaylight-40-release'
+      context 'installing from Nexus repo' do
+        rpm_repo = 'https://nexus.opendaylight.org/content/repositories/opendaylight-oxygen-epel-7-$basearch-devel'
         let(:facts) {{
           :osfamily => osfamily,
           :operatingsystem => operatingsystem,
@@ -581,8 +704,8 @@ describe 'opendaylight' do
         deb_install_tests
       end
 
-      context 'installing Boron Deb' do
-        deb_repo = 'ppa:odl-team/boron'
+      context 'installing Carbon Deb' do
+        deb_repo = 'ppa:odl-team/carbon'
         let(:facts) {{
           :osfamily => osfamily,
           :operatingsystem => operatingsystem,
@@ -608,28 +731,25 @@ describe 'opendaylight' do
         deb_install_tests(deb_repo: deb_repo)
       end
     end
-
   end
 
-  # Security Group Tests
-  describe 'security group tests' do
-    # Non-OS-type tests assume CentOS 7
+  # SNAT Mechanism tests
+  describe 'SNAT mechanism tests' do
+    # Non-OS-type tests assume CentO
     #   See issue #43 for reasoning:
     #   https://github.com/dfarrell07/puppet-opendaylight/issues/43#issue-57343159
     osfamily = 'RedHat'
     operatingsystem = 'CentOS'
     operatingsystemmajrelease = '7'
-    context 'using supported stateful' do
+    context 'using controller' do
       let(:facts) {{
         :osfamily => osfamily,
         :operatingsystem => operatingsystem,
         :operatingsystemmajrelease => operatingsystemmajrelease,
-        :operatingsystemrelease => '7.3',
       }}
 
       let(:params) {{
-        :security_group_mode => 'stateful',
-        :extra_features      => ['odl-netvirt-openstack'],
+        :extra_features => ['odl-netvirt-openstack'],
       }}
 
       # Run shared tests applicable to all supported OSs
@@ -638,20 +758,19 @@ describe 'opendaylight' do
 
       # Run test that specialize in checking security groups
       # Note that this function is defined in spec_helper
-      enable_sg_tests('stateful', '7.3')
+      snat_mechanism_tests
     end
 
-    context 'using unsupported stateful' do
+    context 'using conntrack' do
       let(:facts) {{
         :osfamily => osfamily,
         :operatingsystem => operatingsystem,
         :operatingsystemmajrelease => operatingsystemmajrelease,
-        :operatingsystemrelease => '7.2.1511',
       }}
 
       let(:params) {{
-        :security_group_mode => 'stateful',
-        :extra_features      => ['odl-netvirt-openstack'],
+        :snat_mechanism => 'conntrack',
+        :extra_features => ['odl-netvirt-openstack'],
       }}
 
       # Run shared tests applicable to all supported OSs
@@ -660,20 +779,27 @@ describe 'opendaylight' do
 
       # Run test that specialize in checking security groups
       # Note that this function is defined in spec_helper
-      enable_sg_tests('stateful', '7.2.1511')
+      snat_mechanism_tests('conntrack')
     end
+  end
 
-    context 'using transparent with unsupported stateful' do
+  # SFC tests
+  describe 'SFC tests' do
+    # Non-OS-type tests assume CentO
+    #   See issue #43 for reasoning:
+    #   https://github.com/dfarrell07/puppet-opendaylight/issues/43#issue-57343159
+    osfamily = 'RedHat'
+    operatingsystem = 'CentOS'
+    operatingsystemmajrelease = '7'
+    context 'using odl-netvirt-sfc feature' do
       let(:facts) {{
         :osfamily => osfamily,
         :operatingsystem => operatingsystem,
         :operatingsystemmajrelease => operatingsystemmajrelease,
-        :operatingsystemrelease => '7.2.1511',
       }}
 
       let(:params) {{
-        :security_group_mode => 'transparent',
-        :extra_features      => ['odl-netvirt-openstack'],
+        :extra_features => ['odl-netvirt-sfc'],
       }}
 
       # Run shared tests applicable to all supported OSs
@@ -682,7 +808,7 @@ describe 'opendaylight' do
 
       # Run test that specialize in checking security groups
       # Note that this function is defined in spec_helper
-      enable_sg_tests('transparent', '7.2.1511')
+      sfc_tests
     end
   end
 
@@ -780,5 +906,4 @@ describe 'opendaylight' do
       username_password_tests('test', 'test')
     end
   end
-
 end