From: Ken Barber Date: Sat, 13 Apr 2013 20:06:46 +0000 (-0700) Subject: Merge pull request #145 from ecbypi/ticket/20096-fedora-systemd-support X-Git-Tag: 0.3.0~9 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=b2f140101764f11f24b224aa23922d436ace9360;p=puppet-modules%2Fpuppetlabs-firewall.git Merge pull request #145 from ecbypi/ticket/20096-fedora-systemd-support (20096) Support systemd on Fedora 15 and up --- b2f140101764f11f24b224aa23922d436ace9360 diff --cc spec/unit/puppet/util/firewall_spec.rb index 6345966,f8a7103..1fcba73 --- a/spec/unit/puppet/util/firewall_spec.rb +++ b/spec/unit/puppet/util/firewall_spec.rb @@@ -108,14 -119,10 +119,16 @@@ describe 'Puppet::Util::Firewall' d subject.persist_iptables(proto) end + it 'should exec for Archlinux identified from osfamily' do + Facter.fact(:osfamily).stubs(:value).returns('Archlinux') + subject.expects(:execute).with(['/bin/sh', '-c', '/usr/sbin/iptables-save > /etc/iptables/iptables.rules']) + subject.persist_iptables(proto) + end + it 'should raise a warning when exec fails' do Facter.fact(:osfamily).stubs(:value).returns('RedHat') + Facter.fact(:operatingsystem).stubs(:value).returns('RedHat') + subject.expects(:execute).with(%w{/sbin/service iptables save}). raises(Puppet::ExecutionFailure, 'some error') subject.expects(:warning).with('Unable to persist firewall rules: some error')