root / spec / classes / bridges_spec.rb @ 7937a13b
Historique | Voir | Annoter | Télécharger (1,17 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 | 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 | 432af5d3 | Nacho Barrientos | it { is_expected.to contain_nftables__rule('default_fwd-bridge_br1_2_br1_2') }
|
34 | c82b960a | Steve Traylen | |
35 | 300b7382 | Steve Traylen | it { |
36 | 432af5d3 | Nacho Barrientos | expect(subject).to contain_nftables__rule('default_fwd-bridge_br1_2_br1_2').with(
|
37 | 300b7382 | Steve Traylen | order: '08', |
38 | 432af5d3 | Nacho Barrientos | content: 'iifname br1-2 oifname br1-2 accept' |
39 | 300b7382 | Steve Traylen | ) |
40 | } |
||
41 | end
|
||
42 | fd0eaeca | tr | end
|
43 | end
|
||
44 | end |