root / spec / classes / rules / wireguard_spec.rb @ 2b1896c1
Historique | Voir | Annoter | Télécharger (705 octets)
1 |
# frozen_string_literal: true
|
---|---|
2 |
|
3 |
require 'spec_helper'
|
4 |
|
5 |
describe 'nftables::rules::wireguard' 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-wireguard').with_content('udp dport {51820} accept') } |
13 |
end
|
14 |
|
15 |
context 'with ports set' do |
16 |
let(:params) do |
17 |
{ |
18 |
ports: [55, 60], |
19 |
} |
20 |
end
|
21 |
|
22 |
it { is_expected.to compile } |
23 |
it { is_expected.to contain_nftables__rule('default_in-wireguard').with_content('udp dport {55, 60} accept') } |
24 |
end
|
25 |
end
|
26 |
end
|
27 |
end
|