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