root / spec / classes / rules / dns_spec.rb @ c3515492
Historique | Voir | Annoter | Télécharger (891 octets)
1 |
require 'spec_helper'
|
---|---|
2 |
|
3 |
describe 'nftables::rules::dns' do |
4 |
on_supported_os.each do |os, os_facts|
|
5 |
context "on #{os}" do |
6 |
let(:facts) { os_facts }
|
7 |
|
8 |
context 'default options' do |
9 |
it { is_expected.to compile } |
10 |
it { is_expected.to contain_nftables__rule('default_in-dns_tcp').with_content('tcp dport {53} accept') } |
11 |
it { is_expected.to contain_nftables__rule('default_in-dns_udp').with_content('udp dport {53} accept') } |
12 |
end
|
13 |
|
14 |
context 'with ports set' do |
15 |
let(:params) do |
16 |
{ |
17 |
ports: [55, 60], |
18 |
} |
19 |
end
|
20 |
|
21 |
it { is_expected.to compile } |
22 |
it { is_expected.to contain_nftables__rule('default_in-dns_tcp').with_content('tcp dport {55, 60} accept') } |
23 |
it { is_expected.to contain_nftables__rule('default_in-dns_udp').with_content('udp dport {55, 60} accept') } |
24 |
end
|
25 |
end
|
26 |
end
|
27 |
end
|