Projet

Général

Profil

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

root / spec / classes / bridges_spec.rb @ b6b5925f

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

1 fd0eaeca tr
require 'spec_helper'
2
3
describe 'nftables' do
4
  let(:pre_condition) { 'Exec{path => "/bin"}' }
5
6
  on_supported_os.each do |os, os_facts|
7
    context "on #{os}" do
8 300b7382 Steve Traylen
      context 'with bridge interfaces br0 and br1-2' do
9
        let(:facts) do
10
          os_facts.merge(
11
            networking:
12
              { interfaces:
13
                {
14
                  'lo' => {},
15
                  'br0' => {},
16
                  'br1-2' => {},
17 b6b5925f mh
                  'br1-2:1' => {},
18
                } }
19 300b7382 Steve Traylen
          )
20
        end
21 fd0eaeca tr
22 300b7382 Steve Traylen
        it { is_expected.to compile }
23
        it { is_expected.not_to contain_nftables__rule('default_fwd-bridge_lo_lo') }
24 fd0eaeca tr
25 300b7382 Steve Traylen
        it {
26
          is_expected.to contain_nftables__rule('default_fwd-bridge_br0_br0').with(
27
            order: '08',
28
            content: 'iifname br0 oifname br0 accept',
29
          )
30
        }
31
32
        it { is_expected.to contain_nftables__rule('default_fwd-bridge_br1_br1') }
33
        it {
34
          is_expected.to contain_nftables__rule('default_fwd-bridge_br1_br1').with(
35
            order: '08',
36
            content: 'iifname br1 oifname br1 accept',
37
          )
38
        }
39 b6b5925f mh
40
        it {
41
          expect(subject).to contain_nftables__rule('default_fwd-bridge_br1_2_1_br1_2_1').with(
42
            order: '08',
43
            content: 'iifname br1-2:1 oifname br1-2:1 accept'
44
          )
45
        }
46 300b7382 Steve Traylen
      end
47 fd0eaeca tr
    end
48
  end
49
end