root / spec / classes / bridges_spec.rb @ b6b5925f
Historique | Voir | Annoter | Télécharger (1,33 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 |
context 'with bridge interfaces br0 and br1-2' do |
9 |
let(:facts) do |
10 |
os_facts.merge( |
11 |
networking:
|
12 |
{ interfaces:
|
13 |
{ |
14 |
'lo' => {},
|
15 |
'br0' => {},
|
16 |
'br1-2' => {},
|
17 |
'br1-2:1' => {},
|
18 |
} } |
19 |
) |
20 |
end
|
21 |
|
22 |
it { is_expected.to compile } |
23 |
it { is_expected.not_to contain_nftables__rule('default_fwd-bridge_lo_lo') }
|
24 |
|
25 |
it { |
26 |
is_expected.to contain_nftables__rule('default_fwd-bridge_br0_br0').with(
|
27 |
order: '08', |
28 |
content: 'iifname br0 oifname br0 accept', |
29 |
) |
30 |
} |
31 |
|
32 |
it { is_expected.to contain_nftables__rule('default_fwd-bridge_br1_br1') }
|
33 |
it { |
34 |
is_expected.to contain_nftables__rule('default_fwd-bridge_br1_br1').with(
|
35 |
order: '08', |
36 |
content: 'iifname br1 oifname br1 accept', |
37 |
) |
38 |
} |
39 |
|
40 |
it { |
41 |
expect(subject).to contain_nftables__rule('default_fwd-bridge_br1_2_1_br1_2_1').with(
|
42 |
order: '08', |
43 |
content: 'iifname br1-2:1 oifname br1-2:1 accept' |
44 |
) |
45 |
} |
46 |
end
|
47 |
end
|
48 |
end
|
49 |
end
|