root / spec / defines / simplerule_spec.rb @ 83382bb5
Historique | Voir | Annoter | Télécharger (1,06 ko)
1 | 83382bb5 | Nacho Barrientos | require 'spec_helper'
|
---|---|---|---|
2 | |||
3 | describe 'nftables::simplerule' do |
||
4 | let(:pre_condition) { 'include nftables' } |
||
5 | |||
6 | let(:title) { 'my_default_rule_name' } |
||
7 | |||
8 | on_supported_os.each do |os, os_facts|
|
||
9 | context "on #{os}" do |
||
10 | let(:facts) { os_facts }
|
||
11 | |||
12 | describe 'minimum instantiation' do |
||
13 | it { is_expected.to compile } |
||
14 | it { |
||
15 | is_expected.to contain_nftables__rule('default_in-my_default_rule_name').with(
|
||
16 | content: 'accept', |
||
17 | order: 50, |
||
18 | ) |
||
19 | } |
||
20 | end
|
||
21 | |||
22 | describe 'all parameters provided' do |
||
23 | let(:title) { 'my_big_rule' } |
||
24 | let(:params) do |
||
25 | { |
||
26 | action: 'accept', |
||
27 | comment: 'this is my rule', |
||
28 | dport: 333, |
||
29 | proto: 'udp', |
||
30 | chain: 'default_out', |
||
31 | } |
||
32 | end
|
||
33 | |||
34 | it { is_expected.to compile } |
||
35 | it { |
||
36 | is_expected.to contain_nftables__rule('default_out-my_big_rule').with(
|
||
37 | content: 'udp dport 333 comment "this is my rule" accept', |
||
38 | order: 50, |
||
39 | ) |
||
40 | } |
||
41 | end
|
||
42 | end
|
||
43 | end
|
||
44 | end |