root / spec / defines / rules / masquerade_spec.rb @ c00bcf2d
Historique | Voir | Annoter | Télécharger (757 octets)
1 | c82b960a | Steve Traylen | # frozen_string_literal: true
|
---|---|---|---|
2 | |||
3 | 94a80621 | Steve Traylen | require 'spec_helper'
|
4 | |||
5 | describe 'nftables::rules::masquerade' 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 default parameters' do |
||
16 | it { is_expected.to compile.with_all_deps } |
||
17 | it { is_expected.to contain_nftables__rule('POSTROUTING-foobar').with_content('masquerade') } |
||
18 | end
|
||
19 | c82b960a | Steve Traylen | |
20 | 94a80621 | Steve Traylen | context 'with dport specified' do |
21 | let(:params) do |
||
22 | { |
||
23 | dport: 1000 |
||
24 | } |
||
25 | end
|
||
26 | |||
27 | it { is_expected.to contain_nftables__rule('POSTROUTING-foobar').with_content('tcp dport 1000 masquerade') } |
||
28 | end
|
||
29 | end
|
||
30 | end
|
||
31 | end |