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