"operatingsystemrelease": [
"5",
"6",
- "7"
+ "7",
+ "8"
]
},
{
end
end
end
+ end
+ unless (os[:family] == 'redhat' && os[:release].start_with?('5', '6', '8')) || (os[:family] == 'sles')
describe 'time tests' do
context 'when set all time parameters' do
pp1 = <<-PUPPETCODE
end
end
end
+
+ unless os[:family] == 'redhat' && os[:release].start_with?('8')
+ describe 'time tests' do
+ context 'when set all time parameters' do
+ pp1 = <<-PUPPETCODE
+ class { '::firewall': }
+ firewall { '805 - time':
+ proto => tcp,
+ dport => '8080',
+ action => accept,
+ chain => 'OUTPUT',
+ date_start => '2016-01-19T04:17:07',
+ date_stop => '2038-01-19T04:17:07',
+ time_start => '6:00',
+ time_stop => '17:00:00',
+ month_days => '7',
+ week_days => 'Tue',
+ kernel_timezone => true,
+ provider => 'ip6tables',
+ }
+ PUPPETCODE
+ it 'applies' do
+ apply_manifest(pp1, catch_failures: true)
+ apply_manifest(pp1, catch_changes: do_catch_changes)
+ end
+
+ it 'contains the rule' do
+ shell('ip6tables-save') do |r|
+ expect(r.stdout).to match(
+ %r{-A OUTPUT -p tcp -m multiport --dports 8080 -m time --timestart 06:00:00 --timestop 17:00:00 --monthdays 7 --weekdays Tue --datestart 2016-01-19T04:17:07 --datestop 2038-01-19T04:17:07 --kerneltz -m comment --comment "805 - time" -j ACCEPT}, # rubocop:disable Metrics/LineLength
+ )
+ end
+ end
+ end
+ end
+ end
end
describe 'unless redhat 5 happy path', unless: (os[:family] == 'redhat' && os[:release].start_with?('5')) do
physdev_out => "eth1",
physdev_is_bridged => true,
}
- firewall { '805 - time':
- proto => tcp,
- dport => '8080',
- action => accept,
- chain => 'OUTPUT',
- date_start => '2016-01-19T04:17:07',
- date_stop => '2038-01-19T04:17:07',
- time_start => '6:00',
- time_stop => '17:00:00',
- month_days => '7',
- week_days => 'Tue',
- kernel_timezone => true,
- provider => 'ip6tables',
- }
firewall { '806 - hashlimit_above test ipv6':
chain => 'INPUT',
provider => 'ip6tables',
it 'tee_gateway is set' do
expect(result.stdout).to match(%r{-A PREROUTING -m comment --comment "811 - tee_gateway6" -j TEE --gateway 2001:db8::1})
end
- it 'when set all time parameters' do
- expect(result.stdout).to match(
- %r{-A OUTPUT -p tcp -m multiport --dports 8080 -m time --timestart 06:00:00 --timestop 17:00:00 --monthdays 7 --weekdays Tue --datestart 2016-01-19T04:17:07 --datestop 2038-01-19T04:17:07 --kerneltz -m comment --comment "805 - time" -j ACCEPT}, # rubocop:disable Metrics/LineLength
- )
- end
it 'hashlimit_above is set' do
regex_array = [%r{-A INPUT}, %r{-p tcp}, %r{--hashlimit-above 526\/sec}, %r{--hashlimit-mode srcip,dstip},
%r{--hashlimit-name above-ip6}, %r{--hashlimit-htable-gcinterval 10}, %r{-j ACCEPT}]