]> review.fuel-infra Code Review - puppet-modules/puppetlabs-firewall.git/commitdiff
remove unused test, simplify os logic
authortphoney <tp@puppet.com>
Tue, 19 Feb 2019 15:37:42 +0000 (15:37 +0000)
committertphoney <tp@puppet.com>
Tue, 19 Feb 2019 15:37:42 +0000 (15:37 +0000)
spec/acceptance/firewall_clusterip_spec.rb [deleted file]
spec/acceptance/firewall_spec.rb
spec/acceptance/resource_cmd_spec.rb

diff --git a/spec/acceptance/firewall_clusterip_spec.rb b/spec/acceptance/firewall_clusterip_spec.rb
deleted file mode 100644 (file)
index a3c71ce..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-
-# These tests have been commented out, as there are suspicions that the clusterIP ipt module is causing system reboots.
-
-# require 'spec_helper_acceptance'
-
-# describe 'firewall type', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
-
-#   before(:all) do
-#     shell('iptables --flush; iptables -t nat --flush; iptables -t mangle --flush')
-#     shell('ip6tables --flush; ip6tables -t nat --flush; ip6tables -t mangle --flush')
-#   end
-
-#   # SLES doesn't have the CLUSTERIP module
-#   if default['platform'] !~ /sles/
-#     describe 'clusterip' do
-#       context 'cluster ipv4 test' do
-#         it 'applies' do
-#           pending("MODULES-2124 should be resolved for clusterip RHEL7 support") if default['platform'] =~ /el-7/
-#           pp = <<-EOS
-#             class { '::firewall': }
-#             firewall {
-#               '830 - clusterip test':
-#                 chain                 => 'FORWARD',
-#                 jump                  => 'CLUSTERIP',
-#                 destination           => '1.1.1.1',
-#                 iniface               => 'eth0',
-#                 clusterip_new         => true,
-#                 clusterip_hashmode    => "sourceip",
-#                 clusterip_clustermac  => "01:00:5E:00:00:00",
-#                 clusterip_total_nodes => "2",
-#                 clusterip_local_node  => "1",
-#                 clusterip_hash_init   => "1337",
-#             }
-#           EOS
-
-#           apply_manifest(pp, :catch_failures => true)
-#         end
-
-#         it 'should contain the rule' do
-#           pending("MODULES-2124 should be resolved for clusterip RHEL7 support") if default['platform'] =~ /el-7/
-#           shell('iptables-save') do |r|
-#             expect(r.stdout).to match(/-A FORWARD -d (1.1.1.1\/32|1.1.1.1) -i eth0 -p tcp -m comment --comment "830 - clusterip test" -j CLUSTERIP --new --hashmode sourceip --clustermac 01:00:5E:00:00:00 --total-nodes 2 --local-node 1 --hash-init 1337/) # rubocop:disable Metrics/LineLength : Cannot reduce length to required size
-#           end
-#         end
-#       end
-#     end
-#   end
-# end
index df8294137cefc586601eec53fa0dbb1f24b1b255..4f77048cbc853c402ac46eb7adc2f08d579a3036 100644 (file)
@@ -599,8 +599,7 @@ describe 'firewall basics', docker: true do
         end
       end
 
-      context 'when LOCAL --limit-iface-in', unless: (fact('operatingsystem') == 'RedHat' && fact('operatingsystemmajrelease') <= '5') ||
-                                                     (fact('operatingsystem') == 'CentOS' && fact('operatingsystemmajrelease') <= '5') do
+      context 'when LOCAL --limit-iface-in', unless: (fact('osfamily') == 'RedHat' && fact('operatingsystemmajrelease') <= '5') do
         pp97 = <<-PUPPETCODE
             class { '::firewall': }
             firewall { '613 - test':
@@ -620,8 +619,7 @@ describe 'firewall basics', docker: true do
         end
       end
 
-      context 'when LOCAL --limit-iface-in fail', if: (fact('operatingsystem') == 'RedHat' && fact('operatingsystemmajrelease') <= '5') ||
-                                                      (fact('operatingsystem') == 'CentOS' && fact('operatingsystemmajrelease') <= '5') do
+      context 'when LOCAL --limit-iface-in fail', if: (fact('osfamily') == 'RedHat' && fact('operatingsystemmajrelease') <= '5') do
         pp98 = <<-PUPPETCODE
             class { '::firewall': }
             firewall { '614 - test':
@@ -643,8 +641,7 @@ describe 'firewall basics', docker: true do
         end
       end
 
-      context 'when duplicated LOCAL', unless: (fact('operatingsystem') == 'RedHat' && fact('operatingsystemmajrelease') <= '5') ||
-                                               (fact('operatingsystem') == 'CentOS' && fact('operatingsystemmajrelease') <= '5') do
+      context 'when duplicated LOCAL', unless: (fact('osfamily') == 'RedHat' && fact('operatingsystemmajrelease') <= '5') do
         pp99 = <<-PUPPETCODE
             class { '::firewall': }
             firewall { '615 - test':
@@ -666,8 +663,7 @@ describe 'firewall basics', docker: true do
         end
       end
 
-      context 'when multiple addrtype', unless: (fact('operatingsystem') == 'RedHat' && fact('operatingsystemmajrelease') <= '5') ||
-                                                (fact('operatingsystem') == 'CentOS' && fact('operatingsystemmajrelease') <= '5') do
+      context 'when multiple addrtype', unless: (fact('osfamily') == 'RedHat' && fact('operatingsystemmajrelease') <= '5') do
         pp100 = <<-PUPPETCODE
             class { '::firewall': }
             firewall { '616 - test':
@@ -687,8 +683,7 @@ describe 'firewall basics', docker: true do
         end
       end
 
-      context 'when multiple addrtype fail', if: (fact('operatingsystem') == 'RedHat' && fact('operatingsystemmajrelease') <= '5') ||
-                                                 (fact('operatingsystem') == 'CentOS' && fact('operatingsystemmajrelease') <= '5') do
+      context 'when multiple addrtype fail', if: (fact('osfamily') == 'RedHat' && fact('operatingsystemmajrelease') <= '5') do
         pp101 = <<-PUPPETCODE
             class { '::firewall': }
             firewall { '616 - test':
@@ -1672,8 +1667,7 @@ describe 'firewall basics', docker: true do
             end
           end
 
-          context 'when LOCAL --limit-iface-in', unless: (fact('operatingsystem') == 'RedHat' && fact('operatingsystemmajrelease') <= '5') ||
-                                                         (fact('operatingsystem') == 'CentOS' && fact('operatingsystemmajrelease') <= '5') do
+          context 'when LOCAL --limit-iface-in', unless: (fact('osfamily') == 'RedHat' && fact('operatingsystemmajrelease') <= '5') do
             pp102 = <<-PUPPETCODE
                 class { '::firewall': }
                 firewall { '617 - test':
@@ -1693,8 +1687,7 @@ describe 'firewall basics', docker: true do
             end
           end
 
-          context 'when LOCAL --limit-iface-in fail', if: (fact('operatingsystem') == 'RedHat' && fact('operatingsystemmajrelease') <= '5') ||
-                                                          (fact('operatingsystem') == 'CentOS' && fact('operatingsystemmajrelease') <= '5') do
+          context 'when LOCAL --limit-iface-in fail', if: (fact('osfamily') == 'RedHat' && fact('operatingsystemmajrelease') <= '5') do
             pp103 = <<-PUPPETCODE
                 class { '::firewall': }
                 firewall { '618 - test':
@@ -1716,8 +1709,7 @@ describe 'firewall basics', docker: true do
             end
           end
 
-          context 'when duplicated LOCAL', unless: (fact('operatingsystem') == 'RedHat' && fact('operatingsystemmajrelease') <= '5') ||
-                                                   (fact('operatingsystem') == 'CentOS' && fact('operatingsystemmajrelease') <= '5') do
+          context 'when duplicated LOCAL', unless: (fact('osfamily') == 'RedHat' && fact('operatingsystemmajrelease') <= '5') do
             pp104 = <<-PUPPETCODE
                 class { '::firewall': }
                 firewall { '619 - test':
@@ -1740,8 +1732,7 @@ describe 'firewall basics', docker: true do
             end
           end
 
-          context 'when multiple addrtype', unless: (fact('operatingsystem') == 'RedHat' && fact('operatingsystemmajrelease') <= '5') ||
-                                                    (fact('operatingsystem') == 'CentOS' && fact('operatingsystemmajrelease') <= '5') do
+          context 'when multiple addrtype', unless: (fact('osfamily') == 'RedHat' && fact('operatingsystemmajrelease') <= '5') do
             pp105 = <<-PUPPETCODE
                 class { '::firewall': }
                 firewall { '620 - test':
@@ -1762,8 +1753,7 @@ describe 'firewall basics', docker: true do
             end
           end
 
-          context 'when multiple addrtype fail', if: (fact('operatingsystem') == 'RedHat' && fact('operatingsystemmajrelease') <= '5') ||
-                                                     (fact('operatingsystem') == 'CentOS' && fact('operatingsystemmajrelease') <= '5') do
+          context 'when multiple addrtype fail', if: (fact('osfamily') == 'RedHat' && fact('operatingsystemmajrelease') <= '5') do
             pp106 = <<-PUPPETCODE
                 class { '::firewall': }
                 firewall { '616 - test':
index c9462c01b30514bee115a713c3d89f7a509ca57d..7dca994353ec6a22dbc8eafaa1cbdc154a58984f 100644 (file)
@@ -64,8 +64,7 @@ describe 'puppet resource firewall command' do
     end
   end
 
-  context 'when accepts rules with multiple comments', unless: (fact('operatingsystem') == 'RedHat' && fact('operatingsystemmajrelease') <= '5') ||
-                                                               (fact('operatingsystem') == 'CentOS' && fact('operatingsystemmajrelease') <= '5') do
+  context 'when accepts rules with multiple comments', unless: (fact('osfamily') == 'RedHat' && fact('operatingsystemmajrelease') <= '5') do
     before(:all) do
       iptables_flush_all_tables
       shell('iptables -A INPUT -j ACCEPT -p tcp --dport 80 -m comment --comment "http" -m comment --comment "http"')