]> review.fuel-infra Code Review - puppet-modules/puppetlabs-firewall.git/commitdiff
Add IPv6 NAT tests for Linux 3.7+ and update existing test to be for Linux 2.6
authorNathan Ward <nathan@primoris.co.nz>
Sun, 1 Nov 2015 03:29:05 +0000 (16:29 +1300)
committerNathan Ward <nathan@primoris.co.nz>
Sun, 1 Nov 2015 03:29:05 +0000 (16:29 +1300)
spec/unit/puppet/type/firewallchain_spec.rb

index e627603982ee3878fbdfdd847a1fa6a9426b4784..965a715d3c3d93325cefccb1e5d8b8ae13b810e0 100755 (executable)
@@ -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'