it 'should contain the rule' do
shell('iptables-save') do |r|
- expect(r.stdout).to match(/-A INPUT -p tcp -m multiport --dports 22 -m comment --comment "500 - test" -m connlimit --connlimit-above 10 --connlimit-mask 32 -j REJECT --reject-with icmp-port-unreachable/)
+ #connlimit-saddr is added in Ubuntu 14.04.
+ expect(r.stdout).to match(/-A INPUT -p tcp -m multiport --dports 22 -m comment --comment "500 - test" -m connlimit --connlimit-above 10 --connlimit-mask 32 (--connlimit-saddr )?-j REJECT --reject-with icmp-port-unreachable/)
end
end
end
class { '::firewall': }
firewall { '501 - test':
proto => tcp,
- dport => '22',
- connlimit_above => '10',
- connlimit_mask => '24',
+ dport => '22',
+ connlimit_above => '10',
+ connlimit_mask => '24',
action => reject,
}
EOS
it 'should contain the rule' do
shell('iptables-save') do |r|
- expect(r.stdout).to match(/-A INPUT -p tcp -m multiport --dports 22 -m comment --comment "501 - test" -m connlimit --connlimit-above 10 --connlimit-mask 24 -j REJECT --reject-with icmp-port-unreachable/)
+ #connlimit-saddr is added in Ubuntu 14.04.
+ expect(r.stdout).to match(/-A INPUT -p tcp -m multiport --dports 22 -m comment --comment "501 - test" -m connlimit --connlimit-above 10 --connlimit-mask 24 (--connlimit-saddr )?-j REJECT --reject-with icmp-port-unreachable/)
end
end
end
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 comment --comment "597 - test" -m recent --set --name list1 --rdest/)
+ # 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 comment --comment "597 - test" -m recent --set --name list1 (--mask 255.255.255.255 )?--rdest/)
end
end
end
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 comment --comment "598 - test" -m recent --rcheck --seconds 60 --hitcount 5 --rttl --name list1 --rsource/)
+ expect(r.stdout).to match(/-A INPUT -d 30.0.0.0\/(8|255\.0\.0\.0) -m comment --comment "598 - test" -m recent --rcheck --seconds 60 --hitcount 5 --rttl --name list1 (--mask 255.255.255.255 )?--rsource/)
end
end
end
--- /dev/null
+HOSTS:
+ ubuntu-server-1404-x64:
+ roles:
+ - master
+ platform: ubuntu-14.04-64
+ box: puppetlabs/ubuntu-14.04-64-nocm
+ hypervisor : vagrant
+CONFIG:
+ type: foss
end
end
-unless ENV['RS_PROVISION'] == 'no'
- hosts.each do |host|
- # Install Puppet
- if host.is_pe?
- install_pe
- else
- install_package host, 'rubygems'
- on host, 'gem install puppet --no-ri --no-rdoc'
- on host, "mkdir -p #{host['distmoduledir']}"
- end
+unless ENV['RS_PROVISION'] == 'no' or ENV['BEAKER_provision'] == 'no'
+ if hosts.first.is_pe?
+ install_pe
+ else
+ install_puppet
end
+ on hosts, "mkdir -p #{host['distmoduledir']}"
end
RSpec.configure do |c|