root / spec / defines / rules / snat4_spec.rb @ 0f34454b
Historique | Voir | Annoter | Télécharger (843 octets)
1 |
# frozen_string_literal: true
|
---|---|
2 |
|
3 |
require 'spec_helper'
|
4 |
|
5 |
describe 'nftables::rules::snat4' 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 snat specified' do |
16 |
let(:params) do |
17 |
{ |
18 |
snat: 'sausage', |
19 |
} |
20 |
end
|
21 |
|
22 |
it { is_expected.to compile.with_all_deps } |
23 |
it { is_expected.to contain_nftables__rule('POSTROUTING-foobar').with_content('snat sausage') } |
24 |
|
25 |
context 'with dport specified' do |
26 |
let(:params) do |
27 |
super().merge(dport: 1234) |
28 |
end
|
29 |
|
30 |
it { is_expected.to contain_nftables__rule('POSTROUTING-foobar').with_content('tcp dport 1234 snat sausage') } |
31 |
end
|
32 |
end
|
33 |
end
|
34 |
end
|
35 |
end
|