From d6003422ec13e33e93f2a3e25017af366d33135b Mon Sep 17 00:00:00 2001 From: Hunter Haugen Date: Mon, 8 Jul 2013 17:05:58 -0700 Subject: [PATCH] Add rspec-system tests for src_range/dst_range --- spec/system/params_spec.rb | 39 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) 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 -- 2.45.2