|
19 | 19 | } |
20 | 20 | it { |
21 | 21 | is_expected.to contain_service('netfilter-persistent').with( |
22 | | - ensure: nil, |
| 22 | + ensure: 'running', |
23 | 23 | enable: 'true', |
24 | 24 | require: 'Package[iptables-persistent]', |
25 | 25 | ) |
|
43 | 43 | } |
44 | 44 | end |
45 | 45 |
|
| 46 | + context 'with Debian 10, ensure => stopped' do |
| 47 | + let(:facts) do |
| 48 | + { |
| 49 | + osfamily: 'Debian', |
| 50 | + operatingsystem: 'Debian', |
| 51 | + operatingsystemrelease: '10.0', |
| 52 | + } |
| 53 | + end |
| 54 | + let(:params) { { ensure: 'stopped' } } |
| 55 | + |
| 56 | + it { |
| 57 | + is_expected.to contain_service('netfilter-persistent').with( |
| 58 | + ensure: 'stopped', |
| 59 | + ) |
| 60 | + } |
| 61 | + end |
| 62 | + |
46 | 63 | context 'with Debian 11' do |
47 | 64 | let(:facts) do |
48 | 65 | { |
|
59 | 76 | } |
60 | 77 | it { |
61 | 78 | is_expected.to contain_service('netfilter-persistent').with( |
62 | | - ensure: nil, |
| 79 | + ensure: 'running', |
63 | 80 | enable: 'true', |
64 | 81 | require: 'Package[iptables-persistent]', |
65 | 82 | ) |
|
83 | 100 | } |
84 | 101 | end |
85 | 102 |
|
| 103 | + context 'with Debian 11, ensure => stopped' do |
| 104 | + let(:facts) do |
| 105 | + { |
| 106 | + osfamily: 'Debian', |
| 107 | + operatingsystem: 'Debian', |
| 108 | + operatingsystemrelease: '10.0', |
| 109 | + } |
| 110 | + end |
| 111 | + let(:params) { { ensure: 'stopped' } } |
| 112 | + |
| 113 | + it { |
| 114 | + is_expected.to contain_service('netfilter-persistent').with( |
| 115 | + ensure: 'stopped', |
| 116 | + ) |
| 117 | + } |
| 118 | + end |
| 119 | + |
86 | 120 | context 'with Debian unstable' do |
87 | 121 | let(:facts) do |
88 | 122 | { |
|
99 | 133 | } |
100 | 134 | it { |
101 | 135 | is_expected.to contain_service('netfilter-persistent').with( |
102 | | - ensure: nil, |
| 136 | + ensure: 'running', |
103 | 137 | enable: 'true', |
104 | 138 | require: 'Package[netfilter-persistent]', |
105 | 139 | ) |
106 | 140 | } |
107 | 141 | end |
| 142 | + |
| 143 | + context 'with Debian unstable, enable => false' do |
| 144 | + let(:facts) do |
| 145 | + { |
| 146 | + osfamily: 'Debian', |
| 147 | + operatingsystem: 'Debian', |
| 148 | + operatingsystemrelease: 'unstable', |
| 149 | + } |
| 150 | + end |
| 151 | + let(:params) { { enable: 'false' } } |
| 152 | + |
| 153 | + it { |
| 154 | + is_expected.to contain_service('netfilter-persistent').with( |
| 155 | + enable: 'false', |
| 156 | + ) |
| 157 | + } |
| 158 | + end |
| 159 | + |
| 160 | + context 'with Debian unstable, ensure => stopped' do |
| 161 | + let(:facts) do |
| 162 | + { |
| 163 | + osfamily: 'Debian', |
| 164 | + operatingsystem: 'Debian', |
| 165 | + operatingsystemrelease: '10.0', |
| 166 | + } |
| 167 | + end |
| 168 | + let(:params) { { ensure: 'stopped' } } |
| 169 | + |
| 170 | + it { |
| 171 | + is_expected.to contain_service('netfilter-persistent').with( |
| 172 | + ensure: 'stopped', |
| 173 | + ) |
| 174 | + } |
| 175 | + end |
108 | 176 | end |
0 commit comments