Révision c82b960a
rubocop:auto_correct results
spec/classes/rules/icmp_spec.rb | ||
---|---|---|
1 |
# frozen_string_literal: true |
|
2 |
|
|
1 | 3 |
require 'spec_helper' |
2 | 4 |
|
3 | 5 |
describe 'nftables::rules::icmp' do |
... | ... | |
7 | 9 |
|
8 | 10 |
context 'default options' do |
9 | 11 |
it { is_expected.to compile } |
12 |
|
|
10 | 13 |
it { |
11 |
is_expected.to contain_nftables__rule('default_in-accept_icmpv4').with(
|
|
14 |
expect(subject).to contain_nftables__rule('default_in-accept_icmpv4').with(
|
|
12 | 15 |
content: 'ip protocol icmp accept', |
13 | 16 |
order: '10' |
14 | 17 |
) |
15 | 18 |
} |
19 |
|
|
16 | 20 |
it { |
17 |
is_expected.to contain_nftables__rule('default_in-accept_icmpv6').with(
|
|
21 |
expect(subject).to contain_nftables__rule('default_in-accept_icmpv6').with(
|
|
18 | 22 |
content: 'ip6 nexthdr ipv6-icmp accept', |
19 | 23 |
order: '10' |
20 | 24 |
) |
... | ... | |
29 | 33 |
end |
30 | 34 |
|
31 | 35 |
it { is_expected.to compile } |
36 |
|
|
32 | 37 |
it { |
33 |
is_expected.to contain_nftables__rule('default_in-accept_icmpv4_echo_request').with(
|
|
38 |
expect(subject).to contain_nftables__rule('default_in-accept_icmpv4_echo_request').with(
|
|
34 | 39 |
content: 'ip protocol icmp icmp type echo-request limit rate 4/second accept', |
35 | 40 |
order: '10' |
36 | 41 |
) |
37 | 42 |
} |
43 |
|
|
38 | 44 |
it { |
39 |
is_expected.to contain_nftables__rule('default_in-accept_icmpv4_echo_reply').with(
|
|
45 |
expect(subject).to contain_nftables__rule('default_in-accept_icmpv4_echo_reply').with(
|
|
40 | 46 |
content: 'ip protocol icmp icmp type echo-reply accept', |
41 | 47 |
order: '10' |
42 | 48 |
) |
43 | 49 |
} |
50 |
|
|
44 | 51 |
it { |
45 |
is_expected.to contain_nftables__rule('default_in-accept_icmpv6').with(
|
|
52 |
expect(subject).to contain_nftables__rule('default_in-accept_icmpv6').with(
|
|
46 | 53 |
content: 'ip6 nexthdr ipv6-icmp accept', |
47 | 54 |
order: '10' |
48 | 55 |
) |
... | ... | |
53 | 60 |
let(:params) do |
54 | 61 |
{ |
55 | 62 |
v4_types: ['echo-request limit rate 4/second', 'echo-reply'], |
56 |
v6_types: ['echo-reply', 'nd-router-advert'],
|
|
63 |
v6_types: %w[echo-reply nd-router-advert],
|
|
57 | 64 |
} |
58 | 65 |
end |
59 | 66 |
|
60 | 67 |
it { is_expected.to compile } |
68 |
|
|
61 | 69 |
it { |
62 |
is_expected.to contain_nftables__rule('default_in-accept_icmpv4_echo_request').with(
|
|
70 |
expect(subject).to contain_nftables__rule('default_in-accept_icmpv4_echo_request').with(
|
|
63 | 71 |
content: 'ip protocol icmp icmp type echo-request limit rate 4/second accept', |
64 | 72 |
order: '10' |
65 | 73 |
) |
66 | 74 |
} |
75 |
|
|
67 | 76 |
it { |
68 |
is_expected.to contain_nftables__rule('default_in-accept_icmpv4_echo_reply').with(
|
|
77 |
expect(subject).to contain_nftables__rule('default_in-accept_icmpv4_echo_reply').with(
|
|
69 | 78 |
content: 'ip protocol icmp icmp type echo-reply accept', |
70 | 79 |
order: '10' |
71 | 80 |
) |
72 | 81 |
} |
82 |
|
|
73 | 83 |
it { |
74 |
is_expected.to contain_nftables__rule('default_in-accept_icmpv6_echo_reply').with(
|
|
84 |
expect(subject).to contain_nftables__rule('default_in-accept_icmpv6_echo_reply').with(
|
|
75 | 85 |
content: 'ip6 nexthdr ipv6-icmp icmpv6 type echo-reply accept', |
76 | 86 |
order: '10' |
77 | 87 |
) |
78 | 88 |
} |
89 |
|
|
79 | 90 |
it { |
80 |
is_expected.to contain_nftables__rule('default_in-accept_icmpv6_nd_router_advert').with(
|
|
91 |
expect(subject).to contain_nftables__rule('default_in-accept_icmpv6_nd_router_advert').with(
|
|
81 | 92 |
content: 'ip6 nexthdr ipv6-icmp icmpv6 type nd-router-advert accept', |
82 | 93 |
order: '10' |
83 | 94 |
) |
Formats disponibles : Unified diff