Révision fcb1d356
Auto fill simple table configuration
spec/defines/config_spec.rb | ||
---|---|---|
11 | 11 |
end |
12 | 12 |
|
13 | 13 |
context 'with source and content both unset' do |
14 |
it { is_expected.not_to compile } |
|
14 |
it { is_expected.to compile } |
|
15 |
it { is_expected.to contain_concat('nftables-FOO-BAR') } |
|
16 |
it { |
|
17 |
is_expected.to contain_concat('nftables-FOO-BAR').with( |
|
18 |
path: '/etc/nftables/puppet-preflight/FOO-BAR.nft', |
|
19 |
ensure_newline: true, |
|
20 |
mode: '0640', |
|
21 |
) |
|
22 |
} |
|
23 |
it { is_expected.to contain_file('/etc/nftables/puppet/FOO-BAR.nft') } |
|
24 |
it { |
|
25 |
is_expected.to contain_file('/etc/nftables/puppet/FOO-BAR.nft').with( |
|
26 |
ensure: 'file', |
|
27 |
source: '/etc/nftables/puppet-preflight/FOO-BAR.nft', |
|
28 |
mode: '0640', |
|
29 |
) |
|
30 |
} |
|
31 |
it { is_expected.to contain_concat_fragment('nftables-FOO-BAR-header') } |
|
32 |
it { |
|
33 |
is_expected.to contain_concat_fragment('nftables-FOO-BAR-header').with( |
|
34 |
target: 'nftables-FOO-BAR', |
|
35 |
order: '00', |
|
36 |
content: 'table FOO BAR {', |
|
37 |
) |
|
38 |
} |
|
39 |
it { |
|
40 |
is_expected.to contain_concat_fragment('nftables-FOO-BAR-body').with( |
|
41 |
target: 'nftables-FOO-BAR', |
|
42 |
order: '98', |
|
43 |
content: ' include "FOO-BAR-chain-*.nft"', |
|
44 |
) |
|
45 |
} |
|
15 | 46 |
end |
16 | 47 |
|
17 | 48 |
context 'with a non hyphenated title' do |
Formats disponibles : Unified diff