iptables integration test: split according to platform

centos puts quotes where ubuntu drops them
This commit is contained in:
Stephan Renatus 2016-02-09 19:02:39 +01:00
parent cdad6e63c3
commit 4ffc72bf93

View file

@ -1,7 +1,7 @@
# encoding: utf-8 # encoding: utf-8
case os[:family] case os[:family]
when 'ubuntu', 'rhel', 'centos', 'fedora' when 'ubuntu', 'fedora'
describe iptables do describe iptables do
it { should have_rule('-A INPUT -i eth0 -p tcp -m tcp --dport 80 -m state --state NEW -m comment --comment "http on 80" -j ACCEPT') } it { should have_rule('-A INPUT -i eth0 -p tcp -m tcp --dport 80 -m state --state NEW -m comment --comment "http on 80" -j ACCEPT') }
it { should_not have_rule('-A INPUT -i eth1 -p tcp -m tcp --dport 80 -j ACCEPT') } it { should_not have_rule('-A INPUT -i eth1 -p tcp -m tcp --dport 80 -j ACCEPT') }
@ -9,4 +9,10 @@ when 'ubuntu', 'rhel', 'centos', 'fedora'
# single-word comments have their quotes dropped # single-word comments have their quotes dropped
it { should have_rule('-A derby-cognos-web -p tcp -m tcp --dport 80 -m comment --comment derby-cognos-web -j ACCEPT') } it { should have_rule('-A derby-cognos-web -p tcp -m tcp --dport 80 -m comment --comment derby-cognos-web -j ACCEPT') }
end end
when 'rhel', 'centos'
describe iptables do
it { should have_rule('-A INPUT -i eth0 -p tcp -m tcp --dport 80 -m state --state NEW -m comment --comment "http on 80" -j ACCEPT') }
it { should_not have_rule('-A INPUT -i eth1 -p tcp -m tcp --dport 80 -j ACCEPT') }
it { should have_rule('-A derby-cognos-web -p tcp -m tcp --dport 80 -m comment --comment "derby-cognos-web" -j ACCEPT') }
end
end end