Projet

Général

Profil

Paste
Télécharger au format
Statistiques
| Branche: | Révision:

root / spec / classes / bridges_spec.rb @ 9d02e9f8

Historique | Voir | Annoter | Télécharger (1,33 ko)

1
# frozen_string_literal: true
2

    
3
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
      context 'with bridge interfaces br0 and br1-2' do
11
        let(:facts) do
12
          os_facts.tap { |x| x.delete('networking') }.merge(
13
            networking:
14
              { interfaces:
15
                {
16
                  'lo' => {},
17
                  'br0' => {},
18
                  'br1-2' => {},
19
                  'br1-2:1' => {},
20
                } }
21
          )
22
        end
23

    
24
        it { is_expected.to compile }
25
        it { is_expected.not_to contain_nftables__rule('default_fwd-bridge_lo_lo') }
26

    
27
        it {
28
          expect(subject).to contain_nftables__rule('default_fwd-bridge_br0_br0').with(
29
            order: '08',
30
            content: 'iifname br0 oifname br0 accept'
31
          )
32
        }
33

    
34
        it {
35
          expect(subject).to contain_nftables__rule('default_fwd-bridge_br1_2_br1_2').with(
36
            order: '08',
37
            content: 'iifname br1-2 oifname br1-2 accept'
38
          )
39
        }
40

    
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
      end
48
    end
49
  end
50
end