Skip to content

Commit

Permalink
Fix for resource_cmd_spec
Browse files Browse the repository at this point in the history
Was checking for empty stderr in a few places, and also setting an
iptables rule that doesn't work on deb7 and ubuntu trusty.
  • Loading branch information
Morgan Haskel committed Oct 9, 2014
1 parent 955024e commit 473fffe
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions spec/acceptance/resource_cmd_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@
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
Expand All @@ -102,7 +103,7 @@
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
Expand All @@ -121,7 +122,7 @@
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
Expand Down

0 comments on commit 473fffe

Please sign in to comment.