root / spec / defines / rules / snat4_spec.rb @ fcb79d73
Historique | Voir | Annoter | Télécharger (811 octets)
1 | 94a80621 | Steve Traylen | require 'spec_helper'
|
---|---|---|---|
2 | |||
3 | describe 'nftables::rules::snat4' do |
||
4 | let(:title) { 'foobar' } |
||
5 | fcb79d73 | Ben Morrice | let(:pre_condition) { 'include nftables' } |
6 | 94a80621 | Steve Traylen | |
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 |