From: Ken Barber Date: Thu, 23 May 2013 02:05:31 +0000 (+0100) Subject: Add more log param tests X-Git-Tag: 0.3.1~7^2 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=08c0c135ecd90cb553044c0e9fb7caac27beabcc;p=puppet-modules%2Fpuppetlabs-firewall.git Add more log param tests Signed-off-by: Ken Barber --- diff --git a/spec/system/params_spec.rb b/spec/system/params_spec.rb index 33a71ad..29fba22 100644 --- a/spec/system/params_spec.rb +++ b/spec/system/params_spec.rb @@ -68,4 +68,46 @@ firewall { '#{name}': end end + it 'test log rule - changing names' do + iptables_flush_all_tables + + ppm1 = pp({ + 'name' => '004 log all INVALID packets', + 'chain' => 'INPUT', + 'proto' => 'all', + 'state' => 'INVALID', + 'jump' => 'LOG', + 'log_level' => 'debug', + }) + + ppm2 = pp({ + 'name' => '003 log all INVALID packets', + 'chain' => 'INPUT', + 'proto' => 'all', + 'state' => 'INVALID', + 'jump' => 'LOG', + 'log_level' => 'debug', + }) + + puppet_apply(ppm1) do |r| + r.stderr.should == '' + r.exit_code.should == 2 + end + + puppet_apply(ppm1) do |r| + r.stderr.should == '' + r.exit_code.should == 0 + end + + # check idempotency + ppm = <<-EOS + "\n" + ppm2 + resources { 'firewall': + purge => true, + } + EOS + puppet_apply(ppm) do |r| + r.stderr.should == '' + r.exit_code.should == 2 + end + end end