Révision 316bc3f8
Allow IPv4 and IPv6 only rules
spec/defines/simplerule_spec.rb | ||
---|---|---|
71 | 71 |
) |
72 | 72 |
} |
73 | 73 |
end |
74 |
|
|
75 |
describe 'only IPv4 TCP traffic' do |
|
76 |
let(:params) do |
|
77 |
{ |
|
78 |
dport: 333, |
|
79 |
proto: 'tcp4', |
|
80 |
} |
|
81 |
end |
|
82 |
|
|
83 |
it { is_expected.to compile } |
|
84 |
it { |
|
85 |
is_expected.to contain_nftables__rule('default_in-my_default_rule_name').with( |
|
86 |
content: 'ip version 4 tcp dport 333 accept', |
|
87 |
) |
|
88 |
} |
|
89 |
end |
|
90 |
|
|
91 |
describe 'only IPv6 UDP traffic' do |
|
92 |
let(:params) do |
|
93 |
{ |
|
94 |
dport: 33, |
|
95 |
proto: 'udp6', |
|
96 |
} |
|
97 |
end |
|
98 |
|
|
99 |
it { is_expected.to compile } |
|
100 |
it { |
|
101 |
is_expected.to contain_nftables__rule('default_in-my_default_rule_name').with( |
|
102 |
content: 'ip version 6 udp dport 33 accept', |
|
103 |
) |
|
104 |
} |
|
105 |
end |
|
74 | 106 |
end |
75 | 107 |
end |
76 | 108 |
end |
Formats disponibles : Unified diff