From: Nathan Ward <nathan@primoris.co.nz> Date: Sun, 1 Nov 2015 03:29:05 +0000 (+1300) Subject: Add IPv6 NAT tests for Linux 3.7+ and update existing test to be for Linux 2.6 X-Git-Tag: 1.8.0~11^2 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=1aba8fe1e72614617379d2f9dad947bce910dbf5;p=puppet-modules%2Fpuppetlabs-firewall.git Add IPv6 NAT tests for Linux 3.7+ and update existing test to be for Linux 2.6 --- diff --git a/spec/unit/puppet/type/firewallchain_spec.rb b/spec/unit/puppet/type/firewallchain_spec.rb index e627603..965a715 100755 --- a/spec/unit/puppet/type/firewallchain_spec.rb +++ b/spec/unit/puppet/type/firewallchain_spec.rb @@ -36,7 +36,13 @@ describe firewallchain do [ 'test', '$5()*&%\'"^$09):' ].each do |chainname| name = "#{chainname}:#{table}:#{protocol}" if table == 'nat' && protocol == 'IPv6' - it "should fail #{name}" do + it "should accept #{name} for Linux 3.7+" do + allow(Facter.fact(:kernelmajversion)).to receive(:value).and_return('3.7') + resource[:name] = name + resource[:name].should == name + end + it "should fail #{name} for Linux 2.6" do + allow(Facter.fact(:kernelmajversion)).to receive(:value).and_return('2.6') expect { resource[:name] = name }.to raise_error(Puppet::Error) end elsif protocol != 'ethernet' && table == 'broute'