# existing ruleset scenarios. This will give the parsing capabilities of the
# code a good work out.
describe 'puppet resource firewall command:', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
+ before(:all) do
+ # In order to properly check stderr for anomalies we need to fix the deprecation warnings from puppet.conf.
+ config = shell('puppet config print config').stdout
+ shell("sed -i -e \'s/^templatedir.*$//\' #{config}")
+ end
+
context 'make sure it returns no errors when executed on a clean machine' do
it do
shell('puppet resource firewall') do |r|
r.exit_code.should be_zero
# don't check stdout, some boxes come with rules, that is normal
- # don't check stderr, puppet throws deprecation warnings
+ r.stderr.should be_empty
end
end
end
shell('puppet resource firewall') do |r|
r.exit_code.should be_zero
# don't check stdout, testing preexisting rules, output is normal
- # don't check stderr, puppet throws deprecation warnings
+ r.stderr.should be_empty
end
end
end
shell('puppet resource firewall') do |r|
r.exit_code.should be_zero
# don't check stdout, testing preexisting rules, output is normal
- # don't check stderr, puppet throws deprecation warnings
+ r.stderr.should be_empty
end
end
end
shell('puppet resource firewall') do |r|
r.exit_code.should be_zero
# don't check stdout, testing preexisting rules, output is normal
- # don't check stderr, puppet throws deprecation warnings
+ r.stderr.should be_empty
end
end
end
shell('puppet resource firewall') do |r|
r.exit_code.should be_zero
# don't check stdout, testing preexisting rules, output is normal
- # don't check stderr, puppet throws deprecation warnings
+ r.stderr.should be_empty
end
end
end
shell('puppet resource firewall') do |r|
r.exit_code.should be_zero
# don't check stdout, testing preexisting rules, output is normal
- # don't check stderr, puppet throws deprecation warnings
+ r.stderr.should be_empty
end
end
end
shell('puppet resource firewall') do |r|
r.exit_code.should be_zero
# don't check stdout, testing preexisting rules, output is normal
- # don't check stderr, puppet throws deprecation warnings
+ r.stderr.should be_empty
end
end
end
if default['platform'] !~ /el-5/
context 'dport/sport with ip6tables' do
before :all do
+ if fact('osfamily') == 'Debian'
+ shell('echo "iptables-persistent iptables-persistent/autosave_v4 boolean false" | debconf-set-selections')
+ shell('echo "iptables-persistent iptables-persistent/autosave_v6 boolean false" | debconf-set-selections')
+ shell('apt-get install iptables-persistent -y')
+ end
ip6tables_flush_all_tables
- shell('ip6tables -A INPUT -d fe80::/64 -p udp -m udp --dport 546 --sport 547 -j ACCEPT')
+ shell('ip6tables -A INPUT -d fe80::/64 -p tcp -m tcp --dport 546 --sport 547 -j ACCEPT -m comment --comment 000-foobar')
end
it do
shell('puppet resource firewall \'000-foobar\' provider=ip6tables') do |r|