Projet

Général

Profil

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

root / spec / classes / rules / activemq_spec.rb @ cc9fc807

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

1
# frozen_string_literal: true
2

    
3
require 'spec_helper'
4

    
5
describe 'nftables::rules::activemq' do
6
  on_supported_os.each do |os, os_facts|
7
    context "on #{os}" do
8
      let(:facts) { os_facts }
9

    
10
      context 'default options' do
11
        it { is_expected.to compile }
12
        it { is_expected.to contain_nftables__rule('default_in-activemq_tcp').with_content('tcp dport 61616 accept') }
13
        it { is_expected.to contain_nftables__rule('default_in-activemq_udp').with_content('udp dport 61616 accept') }
14
      end
15

    
16
      context 'with tcp set to false' do
17
        let(:params) do
18
          {
19
            tcp: false,
20
          }
21
        end
22

    
23
        it { is_expected.to compile }
24
        it { is_expected.not_to contain_nftables__rule('default_in-activemq_tcp').with_content('tcp dport 61616 accept') }
25
        it { is_expected.to contain_nftables__rule('default_in-activemq_udp').with_content('udp dport 61616 accept') }
26
      end
27

    
28
      context 'with udp set to false' do
29
        let(:params) do
30
          {
31
            udp: false,
32
          }
33
        end
34

    
35
        it { is_expected.to compile }
36
        it { is_expected.to contain_nftables__rule('default_in-activemq_tcp').with_content('tcp dport 61616 accept') }
37
        it { is_expected.not_to contain_nftables__rule('default_in-activemq_udp').with_content('udp dport 61616 accept') }
38
      end
39
    end
40
  end
41
end