aboutsummaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorTim Meusel <tim@bastelfreak.de>2020-06-22 16:41:05 +0200
committerGitHub <noreply@github.com>2020-06-22 16:41:05 +0200
commit87c586fd8a92d1b92fc6e5529f24264c39978448 (patch)
tree3fb08c91a1163524254be077e749b13b4b7f861f /spec
parent8d967c7b915fec97846b1d6b567489646b3096a3 (diff)
parent8bca772e35c437ec1b750d2bc5fb332cc5d09db6 (diff)
downloadpuppet-ferm-87c586fd8a92d1b92fc6e5529f24264c39978448.tar.gz
puppet-ferm-87c586fd8a92d1b92fc6e5529f24264c39978448.tar.bz2
Merge pull request #112 from foxxx0/add-multiport-support
implement multiport support for dport/sport / drop string support for sport/dport
Diffstat (limited to 'spec')
-rw-r--r--spec/acceptance/ferm_spec.rb4
-rw-r--r--spec/defines/rule_spec.rb20
2 files changed, 12 insertions, 12 deletions
diff --git a/spec/acceptance/ferm_spec.rb b/spec/acceptance/ferm_spec.rb
index f8f0ef4..eee01fa 100644
--- a/spec/acceptance/ferm_spec.rb
+++ b/spec/acceptance/ferm_spec.rb
@@ -126,14 +126,14 @@ describe 'ferm' do
chain => 'INPUT',
action => 'HTTP',
proto => 'tcp',
- dport => '80',
+ dport => 80,
require => Ferm::Chain['check-http'],
}
ferm::rule { 'allow_http_localhost':
chain => 'HTTP',
action => 'ACCEPT',
proto => 'tcp',
- dport => '80',
+ dport => 80,
saddr => '127.0.0.1',
require => Ferm::Chain['check-http'],
}
diff --git a/spec/defines/rule_spec.rb b/spec/defines/rule_spec.rb
index 5e4ad69..f1887b6 100644
--- a/spec/defines/rule_spec.rb
+++ b/spec/defines/rule_spec.rb
@@ -17,7 +17,7 @@ describe 'ferm::rule', type: :define do
{
chain: 'INPUT',
proto: 'tcp',
- dport: '22',
+ dport: 22,
saddr: '127.0.0.1'
}
end
@@ -33,7 +33,7 @@ describe 'ferm::rule', type: :define do
policy: 'ACCEPT',
action: 'ACCEPT',
proto: 'tcp',
- dport: '22',
+ dport: 22,
saddr: '127.0.0.1'
}
end
@@ -48,7 +48,7 @@ describe 'ferm::rule', type: :define do
chain: 'INPUT',
policy: 'ACCEPT',
proto: 'tcp',
- dport: '22',
+ dport: 22,
saddr: '127.0.0.1'
}
end
@@ -64,7 +64,7 @@ describe 'ferm::rule', type: :define do
chain: 'INPUT',
action: 'ACCEPT',
proto: 'tcp',
- dport: '22',
+ dport: 22,
saddr: '127.0.0.1'
}
end
@@ -83,7 +83,7 @@ describe 'ferm::rule', type: :define do
chain: 'INPUT',
action: 'ACCEPT',
proto: 'tcp',
- dport: '22',
+ dport: 22,
saddr: '127.0.0.1',
interface: 'eth0'
}
@@ -102,7 +102,7 @@ describe 'ferm::rule', type: :define do
chain: 'INPUT',
action: 'ACCEPT',
proto: 'tcp',
- dport: '22',
+ dport: 22,
daddr: ['127.0.0.1', '123.123.123.123', ['10.0.0.1', '10.0.0.2']],
interface: 'eth0'
}
@@ -121,13 +121,13 @@ describe 'ferm::rule', type: :define do
chain: 'INPUT',
action: 'ACCEPT',
proto: %w[tcp udp],
- dport: '(8301 8302)',
+ 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('INPUT-filter-consul').with_content("mod comment comment 'filter-consul' proto (tcp udp) dports (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') }
@@ -149,7 +149,7 @@ describe 'ferm::rule', type: :define do
chain: 'INPUT',
action: 'SSH',
proto: 'tcp',
- dport: '22'
+ dport: 22
}
end
@@ -184,7 +184,7 @@ describe 'ferm::rule', type: :define do
chain: 'SSH',
action: 'ACCEPT',
proto: 'tcp',
- dport: '22',
+ dport: 22,
saddr: '127.0.0.1'
}
end