aboutsummaryrefslogtreecommitdiff
path: root/spec/defines/rule_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/defines/rule_spec.rb')
-rw-r--r--spec/defines/rule_spec.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/defines/rule_spec.rb b/spec/defines/rule_spec.rb
index ef20e17..33ce169 100644
--- a/spec/defines/rule_spec.rb
+++ b/spec/defines/rule_spec.rb
@@ -114,6 +114,25 @@ describe 'ferm::rule', type: :define do
it { is_expected.to contain_concat__fragment('INPUT-eth0-zzz').with_content("}\n") }
end
+ context 'without a specific interface using array for proto' do
+ let(:title) { 'filter-consul' }
+ let :params do
+ {
+ chain: 'INPUT',
+ action: 'ACCEPT',
+ proto: %w[tcp udp],
+ dport: '(8301 8302)',
+ saddr: '127.0.0.1'
+ }
+ end
+
+ it { is_expected.to compile.with_all_deps }
+ it { is_expected.to contain_concat__fragment('INPUT-filter-consul').with_content("mod comment comment 'filter-consul' proto (tcp udp) dport (8301 8302) saddr @ipfilter((127.0.0.1)) ACCEPT;\n") }
+ it { is_expected.to contain_concat__fragment('filter-INPUT-config-include') }
+ it { is_expected.to contain_concat__fragment('filter-FORWARD-config-include') }
+ it { is_expected.to contain_concat__fragment('filter-OUTPUT-config-include') }
+ end
+
context 'with jumping to custom chains' do
# create custom chain
let(:pre_condition) do