Révision c82b960a
rubocop:auto_correct results
spec/defines/simplerule_spec.rb | ||
---|---|---|
1 |
# frozen_string_literal: true |
|
2 |
|
|
1 | 3 |
require 'spec_helper' |
2 | 4 |
|
3 | 5 |
describe 'nftables::simplerule' do |
... | ... | |
11 | 13 |
|
12 | 14 |
describe 'minimum instantiation' do |
13 | 15 |
it { is_expected.to compile } |
16 |
|
|
14 | 17 |
it { |
15 |
is_expected.to contain_nftables__rule('default_in-my_default_rule_name').with(
|
|
18 |
expect(subject).to contain_nftables__rule('default_in-my_default_rule_name').with(
|
|
16 | 19 |
content: 'accept', |
17 | 20 |
order: '50' |
18 | 21 |
) |
... | ... | |
56 | 59 |
end |
57 | 60 |
|
58 | 61 |
it { is_expected.to compile } |
62 |
|
|
59 | 63 |
it { |
60 |
is_expected.to contain_nftables__rule('default_out-my_big_rule').with(
|
|
64 |
expect(subject).to contain_nftables__rule('default_out-my_big_rule').with(
|
|
61 | 65 |
content: 'udp sport {444} udp dport {333} ip6 saddr 2001:145c::/32 ip6 daddr 2001:1458::/32 counter accept comment "this is my rule"', |
62 | 66 |
order: '50' |
63 | 67 |
) |
... | ... | |
74 | 78 |
end |
75 | 79 |
|
76 | 80 |
it { is_expected.to compile } |
81 |
|
|
77 | 82 |
it { |
78 |
is_expected.to contain_nftables__rule('default_in-my_default_rule_name').with(
|
|
83 |
expect(subject).to contain_nftables__rule('default_in-my_default_rule_name').with(
|
|
79 | 84 |
content: 'tcp sport {1-2} tcp dport {333-334} accept' |
80 | 85 |
) |
81 | 86 |
} |
... | ... | |
91 | 96 |
end |
92 | 97 |
|
93 | 98 |
it { is_expected.to compile } |
99 |
|
|
94 | 100 |
it { |
95 |
is_expected.to contain_nftables__rule('default_in-my_default_rule_name').with(
|
|
101 |
expect(subject).to contain_nftables__rule('default_in-my_default_rule_name').with(
|
|
96 | 102 |
content: 'tcp sport {433, 435} tcp dport {333, 335} accept' |
97 | 103 |
) |
98 | 104 |
} |
... | ... | |
107 | 113 |
end |
108 | 114 |
|
109 | 115 |
it { is_expected.to compile } |
116 |
|
|
110 | 117 |
it { |
111 |
is_expected.to contain_nftables__rule('default_in-my_default_rule_name').with(
|
|
118 |
expect(subject).to contain_nftables__rule('default_in-my_default_rule_name').with(
|
|
112 | 119 |
content: 'tcp sport {555} accept' |
113 | 120 |
) |
114 | 121 |
} |
... | ... | |
123 | 130 |
end |
124 | 131 |
|
125 | 132 |
it { is_expected.to compile } |
133 |
|
|
126 | 134 |
it { |
127 |
is_expected.to contain_nftables__rule('default_in-my_default_rule_name').with(
|
|
135 |
expect(subject).to contain_nftables__rule('default_in-my_default_rule_name').with(
|
|
128 | 136 |
content: 'ip version 4 tcp dport {333} accept' |
129 | 137 |
) |
130 | 138 |
} |
... | ... | |
139 | 147 |
end |
140 | 148 |
|
141 | 149 |
it { is_expected.to compile } |
150 |
|
|
142 | 151 |
it { |
143 |
is_expected.to contain_nftables__rule('default_in-my_default_rule_name').with(
|
|
152 |
expect(subject).to contain_nftables__rule('default_in-my_default_rule_name').with(
|
|
144 | 153 |
content: 'ip6 version 6 udp dport {33} accept' |
145 | 154 |
) |
146 | 155 |
} |
... | ... | |
155 | 164 |
end |
156 | 165 |
|
157 | 166 |
it { is_expected.to compile } |
167 |
|
|
158 | 168 |
it { |
159 |
is_expected.to contain_nftables__rule('default_in-my_default_rule_name').with(
|
|
169 |
expect(subject).to contain_nftables__rule('default_in-my_default_rule_name').with(
|
|
160 | 170 |
content: 'ip6 version 6 tcp dport {35} accept' |
161 | 171 |
) |
162 | 172 |
} |
... | ... | |
172 | 182 |
end |
173 | 183 |
|
174 | 184 |
it { is_expected.to compile } |
185 |
|
|
175 | 186 |
it { |
176 |
is_expected.to contain_nftables__rule('default_in-my_default_rule_name').with(
|
|
187 |
expect(subject).to contain_nftables__rule('default_in-my_default_rule_name').with(
|
|
177 | 188 |
content: 'tcp dport {33} ip daddr 192.168.0.1/24 accept' |
178 | 189 |
) |
179 | 190 |
} |
... | ... | |
187 | 198 |
end |
188 | 199 |
|
189 | 200 |
it { is_expected.to compile } |
201 |
|
|
190 | 202 |
it { |
191 |
is_expected.to contain_nftables__rule('default_in-my_default_rule_name').with(
|
|
203 |
expect(subject).to contain_nftables__rule('default_in-my_default_rule_name').with(
|
|
192 | 204 |
content: 'ip6 daddr 2001:1458::1 accept' |
193 | 205 |
) |
194 | 206 |
} |
... | ... | |
202 | 214 |
end |
203 | 215 |
|
204 | 216 |
it { is_expected.to compile } |
217 |
|
|
205 | 218 |
it { |
206 |
is_expected.to contain_nftables__rule('default_in-my_default_rule_name').with(
|
|
219 |
expect(subject).to contain_nftables__rule('default_in-my_default_rule_name').with(
|
|
207 | 220 |
content: 'ip6 saddr 2001:1458:0000:0000:0000:0000:0000:0003 accept' |
208 | 221 |
) |
209 | 222 |
} |
... | ... | |
217 | 230 |
end |
218 | 231 |
|
219 | 232 |
it { is_expected.to compile } |
233 |
|
|
220 | 234 |
it { |
221 |
is_expected.to contain_nftables__rule('default_in-my_default_rule_name').with(
|
|
235 |
expect(subject).to contain_nftables__rule('default_in-my_default_rule_name').with(
|
|
222 | 236 |
content: 'ip saddr 172.16.1.5 accept' |
223 | 237 |
) |
224 | 238 |
} |
... | ... | |
232 | 246 |
end |
233 | 247 |
|
234 | 248 |
it { is_expected.to compile } |
249 |
|
|
235 | 250 |
it { |
236 |
is_expected.to contain_nftables__rule('default_in-my_default_rule_name').with(
|
|
251 |
expect(subject).to contain_nftables__rule('default_in-my_default_rule_name').with(
|
|
237 | 252 |
content: 'ip6 daddr @my6_set accept' |
238 | 253 |
) |
239 | 254 |
} |
... | ... | |
248 | 263 |
end |
249 | 264 |
|
250 | 265 |
it { is_expected.to compile } |
266 |
|
|
251 | 267 |
it { |
252 |
is_expected.to contain_nftables__rule('default_in-my_default_rule_name').with(
|
|
268 |
expect(subject).to contain_nftables__rule('default_in-my_default_rule_name').with(
|
|
253 | 269 |
content: 'ip daddr @my4_set accept' |
254 | 270 |
) |
255 | 271 |
} |
... | ... | |
264 | 280 |
end |
265 | 281 |
|
266 | 282 |
it { is_expected.to compile } |
283 |
|
|
267 | 284 |
it { |
268 |
is_expected.to contain_nftables__rule('default_in-my_default_rule_name').with(
|
|
285 |
expect(subject).to contain_nftables__rule('default_in-my_default_rule_name').with(
|
|
269 | 286 |
content: 'ip6 saddr @my6_set accept' |
270 | 287 |
) |
271 | 288 |
} |
... | ... | |
279 | 296 |
end |
280 | 297 |
|
281 | 298 |
it { is_expected.to compile } |
299 |
|
|
282 | 300 |
it { |
283 |
is_expected.to contain_nftables__rule('default_in-my_default_rule_name').with(
|
|
301 |
expect(subject).to contain_nftables__rule('default_in-my_default_rule_name').with(
|
|
284 | 302 |
content: 'counter accept' |
285 | 303 |
) |
286 | 304 |
} |
... | ... | |
297 | 315 |
end |
298 | 316 |
|
299 | 317 |
it { is_expected.to compile } |
318 |
|
|
300 | 319 |
it { |
301 |
is_expected.to contain_nftables__rule('default_in-my_default_rule_name').with(
|
|
320 |
expect(subject).to contain_nftables__rule('default_in-my_default_rule_name').with(
|
|
302 | 321 |
content: 'tcp sport {80} counter continue' |
303 | 322 |
) |
304 | 323 |
} |
Formats disponibles : Unified diff