]> review.fuel-infra Code Review - puppet-modules/puppetlabs-firewall.git/commitdiff
(MODULES-5173) fix regex and test on el6
authortphoney <tp@puppet.com>
Tue, 4 Jul 2017 14:13:06 +0000 (15:13 +0100)
committertphoney <tp@puppet.com>
Tue, 4 Jul 2017 15:00:51 +0000 (16:00 +0100)
spec/acceptance/connlimit_spec.rb
spec/acceptance/firewall_spec.rb

index 64649003c414024e5c4110d7c2132b25f50b7c1d..7c6168c628d5cf3a3e184653fa626266011d5208 100644 (file)
@@ -27,7 +27,7 @@ describe 'connlimit property' do
         it 'should contain the rule' do
           shell('iptables-save') do |r|
             #connlimit-saddr is added in Ubuntu 14.04.
-            expect(r.stdout).to match(/-A INPUT -p tcp -m multiport --dports 2222 -m connlimit --connlimit-above 10 --connlimit-mask 32 (--connlimit-saddr)? -m comment --comment "500 - test" -j REJECT --reject-with icmp-port-unreachable/)
+            expect(r.stdout).to match(/-A INPUT -p tcp -m multiport --dports 2222 -m connlimit --connlimit-above 10 --connlimit-mask 32 (--connlimit-saddr )?-m comment --comment "500 - test" -j REJECT --reject-with icmp-port-unreachable/)
           end
         end
       end
@@ -54,7 +54,7 @@ describe 'connlimit property' do
         it 'should contain the rule' do
           shell('iptables-save') do |r|
             #connlimit-saddr is added in Ubuntu 14.04.
-            expect(r.stdout).to match(/-A INPUT -p tcp -m multiport --dports 2222 -m connlimit --connlimit-above 10 --connlimit-mask 24 (--connlimit-saddr)? -m comment --comment "501 - test" -j REJECT --reject-with icmp-port-unreachable/)
+            expect(r.stdout).to match(/-A INPUT -p tcp -m multiport --dports 2222 -m connlimit --connlimit-above 10 --connlimit-mask 24 (--connlimit-saddr )?-m comment --comment "501 - test" -j REJECT --reject-with icmp-port-unreachable/)
           end
         end
       end
index a5b21a4ecaea22e24b7a1b323084072e45373ac9..91d0ab11e824a4826d63d5dc191d26371ce03f03 100644 (file)
@@ -954,8 +954,9 @@ describe 'firewall basics', docker: true do
     end
   end
 
-  #iptables version 1.3.5 is not suppored by the ip6tables provider
-  if default['platform'] !~ /el-5/ and default['platform'] !~ /sles-10/
+  # iptables version 1.3.5 is not suppored by the ip6tables provider
+  # iptables version 1.4.7 fails for multiple hl entries
+  if default['platform'] !~ /(el-5|el-6)/ and default['platform'] !~ /sles-10/
     describe 'hop_limit' do
       context '5' do
         it 'applies' do
@@ -2121,7 +2122,7 @@ describe 'firewall basics', docker: true do
       it 'should contain the rule' do
         shell('iptables-save') do |r|
           # Mask added as of Ubuntu 14.04.
-          expect(r.stdout).to match(/-A INPUT -d 30.0.0.0\/(8|255\.0\.0\.0) -m recent --set --name list1 (--mask 255.255.255.255)? --rdest -m comment --comment "597 - test"/)
+          expect(r.stdout).to match(/-A INPUT -d 30.0.0.0\/(8|255\.0\.0\.0) -m recent --set --name list1 (--mask 255.255.255.255 )?--rdest -m comment --comment "597 - test"/)
         end
       end
     end
@@ -2150,7 +2151,7 @@ describe 'firewall basics', docker: true do
 
       it 'should contain the rule' do
         shell('iptables-save') do |r|
-          expect(r.stdout).to match(/-A INPUT -d 30.0.0.0\/(8|255\.0\.0\.0) -m recent --rcheck --seconds 60 --hitcount 5 --rttl --name list1 (--mask 255.255.255.255)? --rsource -m comment --comment "598 - test"/)
+          expect(r.stdout).to match(/-A INPUT -d 30.0.0.0\/(8|255\.0\.0\.0) -m recent --rcheck --seconds 60 --hitcount 5 --rttl --name list1 (--mask 255.255.255.255 )?--rsource -m comment --comment "598 - test"/)
         end
       end
     end
@@ -2174,7 +2175,7 @@ describe 'firewall basics', docker: true do
 
       it 'should contain the rule' do
         shell('iptables-save') do |r|
-          expect(r.stdout).to match(/-A INPUT -d 30.0.0.0\/(8|255\.0\.0\.0) -m recent --update --name DEFAULT (--mask 255.255.255.255)? --rsource -m comment --comment "599 - test"/)
+          expect(r.stdout).to match(/-A INPUT -d 30.0.0.0\/(8|255\.0\.0\.0) -m recent --update --name DEFAULT (--mask 255.255.255.255 )?--rsource -m comment --comment "599 - test"/)
         end
       end
     end
@@ -2198,7 +2199,7 @@ describe 'firewall basics', docker: true do
 
       it 'should contain the rule' do
         shell('iptables-save') do |r|
-          expect(r.stdout).to match(/-A INPUT -d 30.0.0.0\/(8|255\.0\.0\.0) -m recent --remove --name DEFAULT (--mask 255.255.255.255)? --rsource -m comment --comment "600 - test"/)
+          expect(r.stdout).to match(/-A INPUT -d 30.0.0.0\/(8|255\.0\.0\.0) -m recent --remove --name DEFAULT (--mask 255.255.255.255 )?--rsource -m comment --comment "600 - test"/)
         end
       end
     end