From 750675333fdbe6c40b63c75b53e360151780fa24 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Wed, 19 Dec 2018 09:48:29 +0100 Subject: Implement logging to kernel log --- spec/defines/chain_spec.rb | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'spec') diff --git a/spec/defines/chain_spec.rb b/spec/defines/chain_spec.rb index 7c4e80b..d3ab857 100644 --- a/spec/defines/chain_spec.rb +++ b/spec/defines/chain_spec.rb @@ -12,7 +12,8 @@ describe 'ferm::chain', type: :define do let :params do { policy: 'DROP', - disable_conntrack: false + disable_conntrack: false, + log_dropped_packets: true } end @@ -21,6 +22,10 @@ describe 'ferm::chain', type: :define do is_expected.to contain_concat__fragment('INPUT-policy'). \ with_content(%r{ESTABLISHED RELATED}) end + it do + is_expected.to contain_concat__fragment('INPUT-footer'). \ + with_content(%r{LOG log-prefix 'INPUT: ';}) + end it { is_expected.to contain_concat('/etc/ferm.d/chains/INPUT.conf') } it { is_expected.to contain_ferm__chain('INPUT') } end @@ -29,7 +34,8 @@ describe 'ferm::chain', type: :define do let :params do { policy: 'DROP', - disable_conntrack: true + disable_conntrack: true, + log_dropped_packets: false } end @@ -39,6 +45,10 @@ describe 'ferm::chain', type: :define do is_expected.not_to contain_concat__fragment('INPUT-policy'). \ with_content(%r{ESTABLISHED RELATED}) end + it do + is_expected.not_to contain_concat__fragment('INPUT-footer'). \ + with_content(%r{LOG log-prefix 'INPUT: ';}) + end end end end -- cgit v1.2.3