Révision 3a52fb41
Richer dport
spec/defines/simplerule_spec.rb | ||
---|---|---|
14 | 14 |
it { |
15 | 15 |
is_expected.to contain_nftables__rule('default_in-my_default_rule_name').with( |
16 | 16 |
content: 'accept', |
17 |
order: 50,
|
|
17 |
order: '50',
|
|
18 | 18 |
) |
19 | 19 |
} |
20 | 20 |
end |
... | ... | |
35 | 35 |
it { |
36 | 36 |
is_expected.to contain_nftables__rule('default_out-my_big_rule').with( |
37 | 37 |
content: 'udp dport 333 comment "this is my rule" accept', |
38 |
order: 50, |
|
38 |
order: '50', |
|
39 |
) |
|
40 |
} |
|
41 |
end |
|
42 |
|
|
43 |
describe 'port range' do |
|
44 |
let(:params) do |
|
45 |
{ |
|
46 |
dport: '333-334', |
|
47 |
proto: 'tcp', |
|
48 |
} |
|
49 |
end |
|
50 |
|
|
51 |
it { is_expected.to compile } |
|
52 |
it { |
|
53 |
is_expected.to contain_nftables__rule('default_in-my_default_rule_name').with( |
|
54 |
content: 'tcp dport 333-334 accept', |
|
55 |
) |
|
56 |
} |
|
57 |
end |
|
58 |
|
|
59 |
describe 'port array' do |
|
60 |
let(:params) do |
|
61 |
{ |
|
62 |
dport: [333, 335], |
|
63 |
proto: 'tcp', |
|
64 |
} |
|
65 |
end |
|
66 |
|
|
67 |
it { is_expected.to compile } |
|
68 |
it { |
|
69 |
is_expected.to contain_nftables__rule('default_in-my_default_rule_name').with( |
|
70 |
content: 'tcp dport {333, 335} accept', |
|
39 | 71 |
) |
40 | 72 |
} |
41 | 73 |
end |
Formats disponibles : Unified diff