Projet

Général

Profil

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

root / spec / classes / bridges_spec.rb @ 8842a597

Historique | Voir | Annoter | Télécharger (1,17 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
                } }
20
          )
21
        end
22

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

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

    
33
        it { is_expected.to contain_nftables__rule('default_fwd-bridge_br1_2_br1_2') }
34

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