From: Daniel Selans Date: Thu, 12 Jun 2014 02:57:04 +0000 (-0400) Subject: Added unit tests X-Git-Tag: 1.3.0~1^2~20^2~1 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=0896f5e5d681b642f204b9d341c97c4b12b2025f;p=puppet-modules%2Fpuppetlabs-firewall.git Added unit tests --- diff --git a/spec/acceptance/resource_cmd_spec.rb b/spec/acceptance/resource_cmd_spec.rb index 82b5e54..b942c55 100644 --- a/spec/acceptance/resource_cmd_spec.rb +++ b/spec/acceptance/resource_cmd_spec.rb @@ -90,6 +90,23 @@ describe 'puppet resource firewall command:', :unless => UNSUPPORTED_PLATFORMS.i end end + 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') + 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 + + it do + 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 + end + end + end + context 'accepts rules with negation' do before :all do iptables_flush_all_tables