Projet

Général

Profil

Révision 316bc3f8

ID316bc3f87e381b4eeea4533f81b939af70ea27b1
Parent 3a52fb41
Enfant d38aab5b

Ajouté par Nacho Barrientos il y a plus de 4 ans

Allow IPv4 and IPv6 only rules

Voir les différences:

spec/defines/simplerule_spec.rb
71 71
          )
72 72
        }
73 73
      end
74

  
75
      describe 'only IPv4 TCP traffic' do
76
        let(:params) do
77
          {
78
            dport: 333,
79
            proto: 'tcp4',
80
          }
81
        end
82

  
83
        it { is_expected.to compile }
84
        it {
85
          is_expected.to contain_nftables__rule('default_in-my_default_rule_name').with(
86
            content: 'ip version 4 tcp dport 333 accept',
87
          )
88
        }
89
      end
90

  
91
      describe 'only IPv6 UDP traffic' do
92
        let(:params) do
93
          {
94
            dport: 33,
95
            proto: 'udp6',
96
          }
97
        end
98

  
99
        it { is_expected.to compile }
100
        it {
101
          is_expected.to contain_nftables__rule('default_in-my_default_rule_name').with(
102
            content: 'ip version 6 udp dport 33 accept',
103
          )
104
        }
105
      end
74 106
    end
75 107
  end
76 108
end

Formats disponibles : Unified diff