root / spec / classes / bridges_spec.rb @ 6c2f0f10
Historique | Voir | Annoter | Télécharger (1,12 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 | os_facts.merge( |
||
13 | networking:
|
||
14 | { interfaces:
|
||
15 | { |
||
16 | 'lo' => {},
|
||
17 | 'br0' => {},
|
||
18 | 'br1-2' => {},
|
||
19 | fa92e118 | Romain Tartière | } } |
20 | 300b7382 | Steve Traylen | ) |
21 | end
|
||
22 | fd0eaeca | tr | |
23 | 300b7382 | Steve Traylen | it { is_expected.to compile } |
24 | it { is_expected.not_to contain_nftables__rule('default_fwd-bridge_lo_lo') }
|
||
25 | fd0eaeca | tr | |
26 | 300b7382 | Steve Traylen | it { |
27 | c82b960a | Steve Traylen | expect(subject).to contain_nftables__rule('default_fwd-bridge_br0_br0').with(
|
28 | 300b7382 | Steve Traylen | order: '08', |
29 | fa92e118 | Romain Tartière | content: 'iifname br0 oifname br0 accept' |
30 | 300b7382 | Steve Traylen | ) |
31 | } |
||
32 | |||
33 | it { is_expected.to contain_nftables__rule('default_fwd-bridge_br1_br1') }
|
||
34 | c82b960a | Steve Traylen | |
35 | 300b7382 | Steve Traylen | it { |
36 | c82b960a | Steve Traylen | expect(subject).to contain_nftables__rule('default_fwd-bridge_br1_br1').with(
|
37 | 300b7382 | Steve Traylen | order: '08', |
38 | fa92e118 | Romain Tartière | content: 'iifname br1 oifname br1 accept' |
39 | 300b7382 | Steve Traylen | ) |
40 | } |
||
41 | end
|
||
42 | fd0eaeca | tr | end
|
43 | end
|
||
44 | end |