From: Hunter Haugen Date: Tue, 9 Jul 2013 00:05:58 +0000 (-0700) Subject: Add rspec-system tests for src_range/dst_range X-Git-Tag: list^2 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=d6003422ec13e33e93f2a3e25017af366d33135b;p=puppet-modules%2Fpuppetlabs-firewall.git Add rspec-system tests for src_range/dst_range --- diff --git a/spec/system/params_spec.rb b/spec/system/params_spec.rb index 7236d65..497a042 100644 --- a/spec/system/params_spec.rb +++ b/spec/system/params_spec.rb @@ -124,4 +124,43 @@ firewall { '#{name}': r.exit_code.should be_zero end end + + it 'test src_range rule' do + iptables_flush_all_tables + + ppm = pp({ + 'name' => '997 block src ip range', + 'chain' => 'INPUT', + 'proto' => 'all', + 'action' => 'drop', + 'src_range' => '"10.0.0.1-10.0.0.10"', + }) + puppet_apply(ppm) do |r| + r.exit_code.should == 2 + r.stderr.should be_empty + r.refresh + r.stderr.should be_empty + r.exit_code.should be_zero + end + end + + it 'test dst_range rule' do + iptables_flush_all_tables + + ppm = pp({ + 'name' => '998 block dst ip range', + 'chain' => 'INPUT', + 'proto' => 'all', + 'action' => 'drop', + 'dst_range' => '"10.0.0.2-10.0.0.20"', + }) + puppet_apply(ppm) do |r| + r.exit_code.should == 2 + r.stderr.should be_empty + r.refresh + r.stderr.should be_empty + r.exit_code.should be_zero + end + end + end