Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/puppet_x/puppetlabs/firewall/utility.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ def self.persist_iptables(context, name, protocol)
case protocol
when 'IPv4', 'iptables'
['/bin/sh', '-c', '/usr/sbin/iptables-save > /etc/sysconfig/iptables']
when 'IPv6', 'ip6tables'
['/bin/sh', '-c', '/usr/sbin/ip6tables-save > /etc/sysconfig/ip6tables']
end
else
# Catch unsupported OSs
Expand Down
4 changes: 2 additions & 2 deletions spec/acceptance/firewall_attributes_ipv6_exceptions_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
end
end

describe 'standard attributes', unless: os[:family] == 'sles' do
describe 'standard attributes' do
describe 'dst_range' do
context 'when 2001::db8::1-2001:db8::ff' do
pp = <<-PUPPETCODE
Expand Down Expand Up @@ -381,7 +381,7 @@ class { '::firewall': }
end
end

describe 'ishasmorefrags/islastfrag/isfirstfrag', unless: os[:family] == 'sles' do
describe 'ishasmorefrags/islastfrag/isfirstfrag' do
shared_examples 'is idempotent' do |values, line_match|
pp2 = <<-PUPPETCODE
class { '::firewall': }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

require 'spec_helper_acceptance'

describe 'firewall attribute testing, happy path', unless: (os[:family] == 'sles') do
describe 'firewall attribute testing, happy path' do
before :all do
iptables_flush_all_tables
ip6tables_flush_all_tables
Expand Down
7 changes: 7 additions & 0 deletions spec/unit/puppet_x/puppetlabs/firewall/utility_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,13 @@

utility.persist_iptables(context, 'test', proto)
end

it 'and OS family is Suse' do
allow(Facter.fact('os')).to receive(:value).and_return({ 'family' => 'Suse' })
expect(Puppet::Provider).to receive(:execute).with(['/bin/sh', '-c', '/usr/sbin/ip6tables-save > /etc/sysconfig/ip6tables'])

utility.persist_iptables(context, 'test', proto)
end
end
end

Expand Down
Loading