Révision 3ccc62ae
Add spec tests for default chains
spec/classes/filter_spec.rb | ||
---|---|---|
30 | 30 |
it { is_expected.to contain_file('/etc/nftables/puppet/filter-input-chains-50-default_in.nft').with_content( |
31 | 31 |
/^jump default_in$/ |
32 | 32 |
)} |
33 |
|
|
34 |
it { is_expected.to contain_concat('nftables-chain-filter-default_in').with( |
|
35 |
:path => "/etc/nftables/puppet/filter-chains-default_in.nft", |
|
36 |
:owner => 'root', |
|
37 |
:group => 'root', |
|
38 |
:mode => '0644', |
|
39 |
:ensure_newline => true, |
|
40 |
)} |
|
41 |
it { is_expected.to contain_concat__fragment('filter@default_in-header').with( |
|
42 |
:target => 'nftables-chain-filter-default_in', |
|
43 |
:content => /^chain default_in {$/, |
|
44 |
:order => '00', |
|
45 |
)} |
|
46 |
it { is_expected.to contain_concat__fragment('filter@default_in-footer').with( |
|
47 |
:target => 'nftables-chain-filter-default_in', |
|
48 |
:content => /^}$/, |
|
49 |
:order => '99', |
|
50 |
)} |
|
33 | 51 |
end |
34 | 52 |
|
35 | 53 |
context "chain forward" do |
... | ... | |
42 | 60 |
it { is_expected.to contain_file('/etc/nftables/puppet/filter-forward-chains-50-default_fwd.nft').with_content( |
43 | 61 |
/^jump default_fwd$/ |
44 | 62 |
)} |
63 |
|
|
64 |
it { is_expected.to contain_concat('nftables-chain-filter-default_fwd').with( |
|
65 |
:path => "/etc/nftables/puppet/filter-chains-default_fwd.nft", |
|
66 |
:owner => 'root', |
|
67 |
:group => 'root', |
|
68 |
:mode => '0644', |
|
69 |
:ensure_newline => true, |
|
70 |
)} |
|
71 |
it { is_expected.to contain_concat__fragment('filter@default_fwd-header').with( |
|
72 |
:target => 'nftables-chain-filter-default_fwd', |
|
73 |
:content => /^chain default_fwd {$/, |
|
74 |
:order => '00', |
|
75 |
)} |
|
76 |
it { is_expected.to contain_concat__fragment('filter@default_fwd-footer').with( |
|
77 |
:target => 'nftables-chain-filter-default_fwd', |
|
78 |
:content => /^}$/, |
|
79 |
:order => '99', |
|
80 |
)} |
|
45 | 81 |
end |
46 | 82 |
|
47 | 83 |
context "chain output" do |
... | ... | |
54 | 90 |
it { is_expected.to contain_file('/etc/nftables/puppet/filter-output-chains-50-default_out.nft').with_content( |
55 | 91 |
/^jump default_out$/ |
56 | 92 |
)} |
93 |
|
|
94 |
it { is_expected.to contain_concat('nftables-chain-filter-default_out').with( |
|
95 |
:path => "/etc/nftables/puppet/filter-chains-default_out.nft", |
|
96 |
:owner => 'root', |
|
97 |
:group => 'root', |
|
98 |
:mode => '0644', |
|
99 |
:ensure_newline => true, |
|
100 |
)} |
|
101 |
it { is_expected.to contain_concat__fragment('filter@default_out-header').with( |
|
102 |
:target => 'nftables-chain-filter-default_out', |
|
103 |
:content => /^chain default_out {$/, |
|
104 |
:order => '00', |
|
105 |
)} |
|
106 |
it { is_expected.to contain_concat__fragment('filter@default_out-footer').with( |
|
107 |
:target => 'nftables-chain-filter-default_out', |
|
108 |
:content => /^}$/, |
|
109 |
:order => '99', |
|
110 |
)} |
|
57 | 111 |
end |
58 | 112 |
end |
59 | 113 |
end |
Formats disponibles : Unified diff