root / spec / defines / rules / masquerade_spec.rb @ 9d02e9f8
Historique | Voir | Annoter | Télécharger (757 octets)
1 |
# frozen_string_literal: true
|
---|---|
2 |
|
3 |
require 'spec_helper'
|
4 |
|
5 |
describe 'nftables::rules::masquerade' do |
6 |
let(:title) { 'foobar' } |
7 |
let(:pre_condition) { 'include nftables' } |
8 |
|
9 |
on_supported_os.each do |os, facts|
|
10 |
context "on #{os}" do |
11 |
let(:facts) do |
12 |
facts |
13 |
end
|
14 |
|
15 |
context 'with default parameters' do |
16 |
it { is_expected.to compile.with_all_deps } |
17 |
it { is_expected.to contain_nftables__rule('POSTROUTING-foobar').with_content('masquerade') } |
18 |
end
|
19 |
|
20 |
context 'with dport specified' do |
21 |
let(:params) do |
22 |
{ |
23 |
dport: 1000 |
24 |
} |
25 |
end
|
26 |
|
27 |
it { is_expected.to contain_nftables__rule('POSTROUTING-foobar').with_content('tcp dport 1000 masquerade') } |
28 |
end
|
29 |
end
|
30 |
end
|
31 |
end
|