From afc9ba3f70947baa0edbe26a86e34ffa50958a7b Mon Sep 17 00:00:00 2001 From: tphoney Date: Tue, 4 Jul 2017 15:13:06 +0100 Subject: [PATCH] (MODULES-5173) fix regex and test on el6 --- spec/acceptance/connlimit_spec.rb | 4 ++-- spec/acceptance/firewall_spec.rb | 13 +++++++------ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/spec/acceptance/connlimit_spec.rb b/spec/acceptance/connlimit_spec.rb index 6464900..7c6168c 100644 --- a/spec/acceptance/connlimit_spec.rb +++ b/spec/acceptance/connlimit_spec.rb @@ -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 diff --git a/spec/acceptance/firewall_spec.rb b/spec/acceptance/firewall_spec.rb index a5b21a4..91d0ab1 100644 --- a/spec/acceptance/firewall_spec.rb +++ b/spec/acceptance/firewall_spec.rb @@ -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 -- 2.45.2