root / spec / classes / bridges_spec.rb @ fd0eaeca
Historique | Voir | Annoter | Télécharger (1,86 ko)
1 |
require 'spec_helper'
|
---|---|
2 |
|
3 |
describe 'nftables' do |
4 |
let(:pre_condition) { 'Exec{path => "/bin"}' } |
5 |
|
6 |
on_supported_os.each do |os, os_facts|
|
7 |
context "on #{os}" do |
8 |
let(:facts) { os_facts }
|
9 |
|
10 |
it { is_expected.to compile } |
11 |
|
12 |
it { |
13 |
is_expected.to contain_concat('nftables-inet-filter-chain-default_fwd').with(
|
14 |
path: '/etc/nftables/puppet/inet-filter-chain-default_fwd.nft', |
15 |
owner: 'root', |
16 |
group: 'root', |
17 |
mode: '0640', |
18 |
ensure_newline: true, |
19 |
) |
20 |
} |
21 |
it { |
22 |
is_expected.to contain_concat__fragment('nftables-inet-filter-chain-default_fwd-header').with(
|
23 |
target: 'nftables-inet-filter-chain-default_fwd', |
24 |
content: %r{^chain default_fwd \{$}, |
25 |
order: '00', |
26 |
) |
27 |
} |
28 |
it { |
29 |
is_expected.to contain_concat__fragment('nftables-inet-filter-chain-default_fwd-rule-bridge_br0_br0').with(
|
30 |
target: 'nftables-inet-filter-chain-default_fwd', |
31 |
content: %r{^ iifname br0 oifname br0 accept$}, |
32 |
order: '08', |
33 |
) |
34 |
} |
35 |
it { |
36 |
is_expected.to contain_concat__fragment('nftables-inet-filter-chain-default_fwd-rule-bridge_br1_br1').with(
|
37 |
target: 'nftables-inet-filter-chain-default_fwd', |
38 |
content: %r{^ iifname br1 oifname br1 accept$}, |
39 |
order: '08', |
40 |
) |
41 |
} |
42 |
it { is_expected.not_to contain_concat__fragment('nftables-inet-filter-chain-default_fwd-bridge_br0_br1') }
|
43 |
it { is_expected.not_to contain_concat__fragment('nftables-inet-filter-chain-default_fwd-bridge_br1_br0') }
|
44 |
it { |
45 |
is_expected.to contain_concat__fragment('nftables-inet-filter-chain-default_fwd-footer').with(
|
46 |
target: 'nftables-inet-filter-chain-default_fwd', |
47 |
content: %r{^\}$}, |
48 |
order: '99', |
49 |
) |
50 |
} |
51 |
end
|
52 |
end
|
53 |
end
|