:month_days, :week_days, :date_start, :date_stop, :time_contiguous, :kernel_timezone,
:src_cc, :dst_cc, :hashlimit_upto, :hashlimit_above, :hashlimit_name, :hashlimit_burst,
:hashlimit_mode, :hashlimit_srcmask, :hashlimit_dstmask, :hashlimit_htable_size,
- :hashlimit_htable_max, :hashlimit_htable_expire, :hashlimit_htable_gcinterval, :bytecode, :ipvs, :zone, :helper, :cgroup,
- :hashlimit_htable_max, :hashlimit_htable_expire, :hashlimit_htable_gcinterval, :bytecode, :ipvs, :zone, :helper, :rpfilter, :name, :notrack,
+ :hashlimit_htable_max, :hashlimit_htable_expire, :hashlimit_htable_gcinterval, :bytecode, :ipvs, :zone, :helper, :cgroup, :rpfilter, :name, :notrack
]
def insert
describe 'attributes test' do
before(:all) do
+ notrack_manifest = "jump => 'CT', notrack => true"
+ notrack_manifest = "jump => 'NOTRACK'" if os[:family] == 'redhat' && [5, 6].include?(os[:release].to_i)
+
pp = <<-PUPPETCODE
class { '::firewall': }
firewall { '004 - log_level and log_prefix':
chain => 'OUTPUT',
table => 'mangle',
}
+ firewall { '004 do not track UDP connections to port 53':
+ chain => 'PREROUTING',
+ table => 'raw',
+ proto => 'udp',
+ dport => 53,
+ #{notrack_manifest}
+ }
PUPPETCODE
idempotent_apply(pp)
end
it 'jump is set' do
expect(result.stdout).to match(%r{-A INPUT -p tcp -m comment --comment "567 - jump" -j TEST})
end
+ it 'notrack is set' do
+ notrack_rule = '-A PREROUTING -p udp -m multiport --dports 53 -m comment --comment "004 do not track UDP connections to port 53" -j CT --notrack'
+ notrack_rule = '-A PREROUTING -p udp -m multiport --dports 53 -m comment --comment "004 do not track UDP connections to port 53" -j NOTRACK' if os[:family] == 'redhat' && [5, 6].include?(os[:release].to_i)
+ expect(result.stdout).to match(%r{#{notrack_rule}})
+ end
end
end
package { 'iptables':
ensure => 'latest',
}
+<<<<<<< HEAD
PUPPETCODE
+=======
+ PUPPETCODE
+>>>>>>> 7163c3a... Add acceptance and unit test for notrack parameter
LitmusHelper.instance.apply_manifest(pp)
LitmusHelper.instance.run_shell('update-alternatives --set iptables /usr/sbin/iptables-legacy', expect_failures: true)
LitmusHelper.instance.run_shell('update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy', expect_failures: true)
end
+<<<<<<< HEAD
+=======
+ pp = <<-PUPPETCODE
+ package { 'conntrack-tools':
+ ensure => 'latest',
+ }
+ PUPPETCODE
+ LitmusHelper.instance.apply_manifest(pp)
+>>>>>>> 7163c3a... Add acceptance and unit test for notrack parameter
end
end