Révision c82b960a
rubocop:auto_correct results
spec/defines/set_spec.rb | ||
---|---|---|
1 |
# frozen_string_literal: true |
|
2 |
|
|
1 | 3 |
require 'spec_helper' |
2 | 4 |
|
3 | 5 |
describe 'nftables::set' do |
... | ... | |
17 | 19 |
end |
18 | 20 |
|
19 | 21 |
it { is_expected.to compile } |
22 |
|
|
20 | 23 |
it { |
21 |
is_expected.to contain_concat__fragment('nftables-inet-filter-set-my_set').with(
|
|
22 |
target: 'nftables-inet-filter',
|
|
24 |
expect(subject).to contain_concat__fragment('nftables-inet-filter-set-my_set').with(
|
|
25 |
target: 'nftables-inet-filter', |
|
23 | 26 |
content: %r{^ set my_set \{\n type ipv4_addr\n \}$}m, |
24 |
order: '10'
|
|
27 |
order: '10' |
|
25 | 28 |
) |
26 | 29 |
} |
27 | 30 |
end |
... | ... | |
68 | 71 |
end |
69 | 72 |
|
70 | 73 |
it { is_expected.to compile } |
74 |
|
|
71 | 75 |
it { |
72 |
is_expected.to contain_concat__fragment('nftables-inet-filter-set-my_set').with(
|
|
73 |
target: 'nftables-inet-filter',
|
|
76 |
expect(subject).to contain_concat__fragment('nftables-inet-filter-set-my_set').with(
|
|
77 |
target: 'nftables-inet-filter', |
|
74 | 78 |
content: %r{^ set my_set \{\n type ipv6_addr\n elements = \{ 2001:1458::/32, 2001:1458:1::/48 \}\n \}$}m, |
75 |
order: '10'
|
|
79 |
order: '10' |
|
76 | 80 |
) |
77 | 81 |
} |
78 | 82 |
end |
... | ... | |
88 | 92 |
end |
89 | 93 |
|
90 | 94 |
it { is_expected.to compile } |
95 |
|
|
91 | 96 |
it { |
92 |
is_expected.to contain_concat__fragment('nftables-inet-filter-set-my_set').with(
|
|
93 |
target: 'nftables-inet-filter',
|
|
97 |
expect(subject).to contain_concat__fragment('nftables-inet-filter-set-my_set').with(
|
|
98 |
target: 'nftables-inet-filter', |
|
94 | 99 |
content: %r{^ set my_set \{\n type ipv4_addr\n flags interval, timeout\n elements = \{ 192.168.0.1/24 \}\n auto-merge\n \}$}m, |
95 |
order: '10'
|
|
100 |
order: '10' |
|
96 | 101 |
) |
97 | 102 |
} |
98 | 103 |
end |
... | ... | |
107 | 112 |
end |
108 | 113 |
|
109 | 114 |
it { is_expected.to compile } |
115 |
|
|
110 | 116 |
it { |
111 |
is_expected.to contain_concat__fragment('nftables-inet-filter-set-my_set').with(
|
|
112 |
target: 'nftables-inet-filter',
|
|
117 |
expect(subject).to contain_concat__fragment('nftables-inet-filter-set-my_set').with(
|
|
118 |
target: 'nftables-inet-filter', |
|
113 | 119 |
content: %r{^ set my_set \{\n type ether_addr\n elements = \{ aa:bb:cc:dd:ee:ff \}\n policy memory\n \}$}m, |
114 |
order: '10'
|
|
120 |
order: '10' |
|
115 | 121 |
) |
116 | 122 |
} |
117 | 123 |
end |
... | ... | |
124 | 130 |
end |
125 | 131 |
|
126 | 132 |
it { is_expected.to compile } |
133 |
|
|
127 | 134 |
it { |
128 |
is_expected.to contain_concat__fragment('nftables-inet-filter-set-my_set').with(
|
|
129 |
target: 'nftables-inet-filter',
|
|
135 |
expect(subject).to contain_concat__fragment('nftables-inet-filter-set-my_set').with(
|
|
136 |
target: 'nftables-inet-filter', |
|
130 | 137 |
content: ' set my_set { }', |
131 |
order: '10'
|
|
138 |
order: '10' |
|
132 | 139 |
) |
133 | 140 |
} |
134 | 141 |
end |
... | ... | |
146 | 153 |
end |
147 | 154 |
|
148 | 155 |
it { is_expected.to compile } |
156 |
|
|
149 | 157 |
it { |
150 |
is_expected.to contain_concat__fragment('nftables-inet-filter-set-my-set').with(
|
|
151 |
target: 'nftables-inet-filter',
|
|
158 |
expect(subject).to contain_concat__fragment('nftables-inet-filter-set-my-set').with(
|
|
159 |
target: 'nftables-inet-filter', |
|
152 | 160 |
content: %r{^ set my-set \{\n type ether_addr\n \}$}m, |
153 |
order: '10'
|
|
161 |
order: '10' |
|
154 | 162 |
) |
155 | 163 |
} |
156 | 164 |
end |
... | ... | |
165 | 173 |
end |
166 | 174 |
|
167 | 175 |
it { is_expected.to compile } |
176 |
|
|
168 | 177 |
it { |
169 |
is_expected.to contain_concat__fragment('nftables-ip-nat-set-my_set').with(
|
|
170 |
target: 'nftables-ip-nat',
|
|
178 |
expect(subject).to contain_concat__fragment('nftables-ip-nat-set-my_set').with(
|
|
179 |
target: 'nftables-ip-nat', |
|
171 | 180 |
content: %r{^ set my_set \{\n type ipv6_addr\n elements = \{ 2001:1458::1, 2001:1458:1::2 \}\n \}$}m, |
172 |
order: '10'
|
|
181 |
order: '10' |
|
173 | 182 |
) |
174 | 183 |
} |
175 | 184 |
end |
... | ... | |
191 | 200 |
{ |
192 | 201 |
type: 'ipv6_addr', |
193 | 202 |
elements: ['2001:1458::1', '2001:1458:1::2'], |
194 |
table: ['inet-filter', 'ip-nat']
|
|
203 |
table: %w[inet-filter ip-nat]
|
|
195 | 204 |
} |
196 | 205 |
end |
197 | 206 |
|
198 | 207 |
it { is_expected.to compile } |
208 |
|
|
199 | 209 |
it { |
200 |
is_expected.to contain_concat__fragment('nftables-inet-filter-set-my_set').with(
|
|
201 |
target: 'nftables-inet-filter',
|
|
210 |
expect(subject).to contain_concat__fragment('nftables-inet-filter-set-my_set').with(
|
|
211 |
target: 'nftables-inet-filter', |
|
202 | 212 |
content: %r{^ set my_set \{\n type ipv6_addr\n elements = \{ 2001:1458::1, 2001:1458:1::2 \}\n \}$}m, |
203 |
order: '10'
|
|
213 |
order: '10' |
|
204 | 214 |
) |
205 |
is_expected.to contain_concat__fragment('nftables-ip-nat-set-my_set').with(
|
|
206 |
target: 'nftables-ip-nat',
|
|
215 |
expect(subject).to contain_concat__fragment('nftables-ip-nat-set-my_set').with(
|
|
216 |
target: 'nftables-ip-nat', |
|
207 | 217 |
content: %r{^ set my_set \{\n type ipv6_addr\n elements = \{ 2001:1458::1, 2001:1458:1::2 \}\n \}$}m, |
208 |
order: '10'
|
|
218 |
order: '10' |
|
209 | 219 |
) |
210 | 220 |
} |
211 | 221 |
end |
Formats disponibles : Unified diff