Révision 7e5b657a
rubocop:auto_correct fixes
spec/classes/inet_filter_spec.rb | ||
---|---|---|
441 | 441 |
end |
442 | 442 |
|
443 | 443 |
context 'custom log prefix with variable substitution' do |
444 |
let(:pre_condition) { 'class{\'nftables\': log_prefix => " bar [%<chain>s] "}' } # rubocop:disable Style/FormatStringToken
|
|
444 |
let(:pre_condition) { 'class{\'nftables\': log_prefix => " bar [%<chain>s] "}' } |
|
445 | 445 |
|
446 | 446 |
it { |
447 | 447 |
is_expected.to contain_concat__fragment('nftables-inet-filter-chain-INPUT-rule-log_discarded').with( |
spec/classes/nftables_spec.rb | ||
---|---|---|
177 | 177 |
|
178 | 178 |
context 'with no nftables fact' do |
179 | 179 |
it { |
180 |
is_expected.to contain_systemd__dropin_file('puppet_nft.conf') |
|
181 |
.with_content(%r{^ExecReload.*flush ruleset; include.*$})
|
|
180 |
is_expected.to contain_systemd__dropin_file('puppet_nft.conf').
|
|
181 |
with_content(%r{^ExecReload.*flush ruleset; include.*$}) |
|
182 | 182 |
} |
183 | 183 |
it { is_expected.to contain_file('/etc/nftables/puppet-preflight.nft').with_content(%r{^flush ruleset$}) } |
184 | 184 |
end |
... | ... | |
189 | 189 |
end |
190 | 190 |
|
191 | 191 |
it { |
192 |
is_expected.to contain_systemd__dropin_file('puppet_nft.conf') |
|
193 |
.with_content(%r{^ExecReload.*flush table inet abc; include.*$})
|
|
192 |
is_expected.to contain_systemd__dropin_file('puppet_nft.conf').
|
|
193 |
with_content(%r{^ExecReload.*flush table inet abc; include.*$}) |
|
194 | 194 |
} |
195 | 195 |
it { |
196 |
is_expected.to contain_file('/etc/nftables/puppet-preflight.nft') |
|
197 |
.with_content(%r{^flush table inet abc$})
|
|
196 |
is_expected.to contain_file('/etc/nftables/puppet-preflight.nft').
|
|
197 |
with_content(%r{^flush table inet abc$}) |
|
198 | 198 |
} |
199 | 199 |
end |
200 | 200 |
context 'with nftables fact not matching' do |
... | ... | |
203 | 203 |
end |
204 | 204 |
|
205 | 205 |
it { |
206 |
is_expected.to contain_systemd__dropin_file('puppet_nft.conf') |
|
207 |
.with_content(%r{^ExecReload.*flush table inet abc; flush table inet ijk; include.*$})
|
|
206 |
is_expected.to contain_systemd__dropin_file('puppet_nft.conf').
|
|
207 |
with_content(%r{^ExecReload.*flush table inet abc; flush table inet ijk; include.*$}) |
|
208 | 208 |
} |
209 | 209 |
it { |
210 |
is_expected.to contain_file('/etc/nftables/puppet-preflight.nft') |
|
211 |
.with_content(%r{^flush table inet abc; flush table inet ijk$})
|
|
210 |
is_expected.to contain_file('/etc/nftables/puppet-preflight.nft').
|
|
211 |
with_content(%r{^flush table inet abc; flush table inet ijk$}) |
|
212 | 212 |
} |
213 | 213 |
end |
214 | 214 |
end |
spec/defines/set_spec.rb | ||
---|---|---|
81 | 81 |
let(:params) do |
82 | 82 |
{ |
83 | 83 |
type: 'ipv4_addr', |
84 |
flags: ['interval', 'timeout'],
|
|
84 |
flags: %w[interval timeout],
|
|
85 | 85 |
elements: ['192.168.0.1/24'], |
86 | 86 |
auto_merge: true, |
87 | 87 |
} |
spec/unit/facter/nftables_spec.rb | ||
---|---|---|
1 | 1 |
require 'spec_helper' |
2 | 2 |
|
3 | 3 |
describe 'nftables' do |
4 |
before(:each) do
|
|
4 |
before do |
|
5 | 5 |
Facter.clear |
6 | 6 |
Process.stubs(:uid).returns(0) |
7 | 7 |
Facter::Util::Resolution.stubs(:which).with('nft').returns('/usr/sbin/nft') |
Formats disponibles : Unified diff