From 1aba8fe1e72614617379d2f9dad947bce910dbf5 Mon Sep 17 00:00:00 2001 From: Nathan Ward Date: Sun, 1 Nov 2015 16:29:05 +1300 Subject: [PATCH] Add IPv6 NAT tests for Linux 3.7+ and update existing test to be for Linux 2.6 --- spec/unit/puppet/type/firewallchain_spec.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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' -- 2.45.2