root / spec / classes / rules / dns_spec.rb @ 6c2f0f10
Historique | Voir | Annoter | Télécharger (922 octets)
1 | c82b960a | Steve Traylen | # frozen_string_literal: true
|
---|---|---|---|
2 | |||
3 | 94a80621 | Steve Traylen | require 'spec_helper'
|
4 | |||
5 | describe 'nftables::rules::dns' 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-dns_tcp').with_content('tcp dport {53} accept') } |
||
13 | it { is_expected.to contain_nftables__rule('default_in-dns_udp').with_content('udp dport {53} accept') } |
||
14 | end
|
||
15 | |||
16 | context 'with ports set' do |
||
17 | let(:params) do |
||
18 | { |
||
19 | ports: [55, 60], |
||
20 | } |
||
21 | end
|
||
22 | |||
23 | it { is_expected.to compile } |
||
24 | it { is_expected.to contain_nftables__rule('default_in-dns_tcp').with_content('tcp dport {55, 60} accept') } |
||
25 | it { is_expected.to contain_nftables__rule('default_in-dns_udp').with_content('udp dport {55, 60} accept') } |
||
26 | end
|
||
27 | end
|
||
28 | end
|
||
29 | end |