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