From: Morgan Haskel Date: Thu, 9 Oct 2014 23:03:16 +0000 (-0400) Subject: Fix for resource_cmd_spec X-Git-Tag: 1.3.0~1^2~12^2 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=473fffe359a215330b9662911b1293e8010141ed;p=puppet-modules%2Fpuppetlabs-firewall.git Fix for resource_cmd_spec Was checking for empty stderr in a few places, and also setting an iptables rule that doesn't work on deb7 and ubuntu trusty. --- diff --git a/spec/acceptance/resource_cmd_spec.rb b/spec/acceptance/resource_cmd_spec.rb index b942c55..ca4837a 100644 --- a/spec/acceptance/resource_cmd_spec.rb +++ b/spec/acceptance/resource_cmd_spec.rb @@ -93,7 +93,8 @@ describe 'puppet resource firewall command:', :unless => UNSUPPORTED_PLATFORMS.i context 'accepts rules utilizing the statistic module' do before :all do iptables_flush_all_tables - shell('iptables -t nat -A POSTROUTING -d 1.2.3.4/32 -o eth0 -m statistic --mode nth --every 2 -j SNAT --to-source 2.3.4.5') + # This command doesn't work with all versions/oses, so let it fail + shell('iptables -t nat -A POSTROUTING -d 1.2.3.4/32 -o eth0 -m statistic --mode nth --every 2 -j SNAT --to-source 2.3.4.5', :acceptable_exit_codes => [0,1,2] ) shell('iptables -t nat -A POSTROUTING -d 1.2.3.4/32 -o eth0 -m statistic --mode nth --every 1 --packet 0 -j SNAT --to-source 2.3.4.6') shell('iptables -t nat -A POSTROUTING -d 1.2.3.4/32 -o eth0 -m statistic --mode random --probability 0.99 -j SNAT --to-source 2.3.4.7') end @@ -102,7 +103,7 @@ describe 'puppet resource firewall command:', :unless => UNSUPPORTED_PLATFORMS.i shell('puppet resource firewall') do |r| r.exit_code.should be_zero # don't check stdout, testing preexisting rules, output is normal - r.stderr.should be_empty + # don't check stderr, puppet throws deprecation warnings end end end @@ -121,7 +122,7 @@ describe 'puppet resource firewall command:', :unless => UNSUPPORTED_PLATFORMS.i shell('puppet resource firewall') do |r| r.exit_code.should be_zero # don't check stdout, testing preexisting rules, output is normal - r.stderr.should be_empty + # don't check stderr, puppet throws deprecation warnings end end end