root / spec / classes / bridges_spec.rb @ a1f09048
Historique | Voir | Annoter | Télécharger (1,33 ko)
1 | c82b960a | Steve Traylen | # frozen_string_literal: true
|
---|---|---|---|
2 | |||
3 | fd0eaeca | tr | require 'spec_helper'
|
4 | |||
5 | describe 'nftables' do |
||
6 | let(:pre_condition) { 'Exec{path => "/bin"}' } |
||
7 | |||
8 | on_supported_os.each do |os, os_facts|
|
||
9 | context "on #{os}" do |
||
10 | 300b7382 | Steve Traylen | context 'with bridge interfaces br0 and br1-2' do |
11 | let(:facts) do |
||
12 | 432af5d3 | Nacho Barrientos | os_facts.tap { |x| x.delete('networking') }.merge(
|
13 | 300b7382 | Steve Traylen | networking:
|
14 | { interfaces:
|
||
15 | { |
||
16 | 'lo' => {},
|
||
17 | 'br0' => {},
|
||
18 | 'br1-2' => {},
|
||
19 | cb38423a | mh | 'br1-2:1' => {},
|
20 | fa92e118 | Romain Tartière | } } |
21 | 300b7382 | Steve Traylen | ) |
22 | end
|
||
23 | fd0eaeca | tr | |
24 | 300b7382 | Steve Traylen | it { is_expected.to compile } |
25 | it { is_expected.not_to contain_nftables__rule('default_fwd-bridge_lo_lo') }
|
||
26 | fd0eaeca | tr | |
27 | 300b7382 | Steve Traylen | it { |
28 | c82b960a | Steve Traylen | expect(subject).to contain_nftables__rule('default_fwd-bridge_br0_br0').with(
|
29 | 300b7382 | Steve Traylen | order: '08', |
30 | fa92e118 | Romain Tartière | content: 'iifname br0 oifname br0 accept' |
31 | 300b7382 | Steve Traylen | ) |
32 | } |
||
33 | |||
34 | it { |
||
35 | 432af5d3 | Nacho Barrientos | expect(subject).to contain_nftables__rule('default_fwd-bridge_br1_2_br1_2').with(
|
36 | 300b7382 | Steve Traylen | order: '08', |
37 | 432af5d3 | Nacho Barrientos | content: 'iifname br1-2 oifname br1-2 accept' |
38 | 300b7382 | Steve Traylen | ) |
39 | } |
||
40 | cb38423a | mh | |
41 | it { |
||
42 | expect(subject).to contain_nftables__rule('default_fwd-bridge_br1_2_1_br1_2_1').with(
|
||
43 | order: '08', |
||
44 | content: 'iifname br1-2:1 oifname br1-2:1 accept' |
||
45 | ) |
||
46 | } |
||
47 | 300b7382 | Steve Traylen | end
|
48 | fd0eaeca | tr | end
|
49 | end
|
||
50 | end |