aboutsummaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorTim Meusel <tim@bastelfreak.de>2021-07-16 19:31:42 +0200
committerTim Meusel <tim@bastelfreak.de>2021-07-16 20:04:33 +0200
commite13e6c1ae0e1848051892d0306030a528b01524a (patch)
tree4c99f442b4373ce4e299e2efcf6da1612a4b8c2e /spec
parente44c8acf0cca889307db0d745ee72cc0b2574dca (diff)
downloadpuppet-ferm-e13e6c1ae0e1848051892d0306030a528b01524a.tar.gz
puppet-ferm-e13e6c1ae0e1848051892d0306030a528b01524a.tar.bz2
delete legacy `policy` param in ferm::rule
Diffstat (limited to 'spec')
-rw-r--r--spec/defines/rule_spec.rb36
1 files changed, 2 insertions, 34 deletions
diff --git a/spec/defines/rule_spec.rb b/spec/defines/rule_spec.rb
index f2601c6..7529fce 100644
--- a/spec/defines/rule_spec.rb
+++ b/spec/defines/rule_spec.rb
@@ -11,7 +11,7 @@ describe 'ferm::rule', type: :define do
'include ferm'
end
- context 'without policy or action' do
+ context 'without action' do
let(:title) { 'filter-ssh' }
let :params do
{
@@ -22,39 +22,7 @@ describe 'ferm::rule', type: :define do
}
end
- it { is_expected.to compile.and_raise_error(%r{Exactly one of "action" or the deprecated "policy" param is required}) }
- end
-
- context 'with both policy and action' do
- let(:title) { 'filter-ssh' }
- let :params do
- {
- chain: 'INPUT',
- policy: 'ACCEPT',
- action: 'ACCEPT',
- proto: 'tcp',
- dport: 22,
- saddr: '127.0.0.1'
- }
- end
-
- it { is_expected.to compile.and_raise_error(%r{Cannot specify both policy and action}) }
- end
-
- context 'without a specific interface using legacy policy param' do
- let(:title) { 'filter-ssh' }
- let :params do
- {
- chain: 'INPUT',
- policy: 'ACCEPT',
- proto: 'tcp',
- dport: 22,
- saddr: '127.0.0.1'
- }
- end
-
- it { is_expected.to compile.with_all_deps }
- it { is_expected.to contain_concat__fragment('INPUT-filter-ssh').with_content("mod comment comment 'filter-ssh' proto tcp dport 22 saddr @ipfilter((127.0.0.1)) ACCEPT;\n") }
+ it { is_expected.not_to compile }
end
context 'without a specific interface' do