|
29 | 29 | context 'with default params' do |
30 | 30 | it { is_expected.not_to contain_class('rabbitmq::repo::apt') } |
31 | 31 | it { is_expected.not_to contain_apt__source('rabbitmq') } |
32 | | - it { is_expected.not_to contain_class('rabbitmq::repo::rhel') } |
33 | | - it { is_expected.not_to contain_yumrepo('rabbitmq') } |
| 32 | + if facts[:os]['family'] == 'RedHat' && facts[:os]['release']['major'] == '8' |
| 33 | + it { is_expected.to contain_class('rabbitmq::repo::rhel') } |
| 34 | + it { is_expected.to contain_yumrepo('rabbitmq') } |
| 35 | + else |
| 36 | + it { is_expected.not_to contain_class('rabbitmq::repo::rhel') } |
| 37 | + it { is_expected.not_to contain_yumrepo('rabbitmq') } |
| 38 | + end |
34 | 39 | end |
35 | 40 |
|
36 | 41 | context 'with service_restart => false' do |
|
185 | 190 |
|
186 | 191 | context 'with service_manage set to true' do |
187 | 192 | let(:params) { { admin_enable: true, management_ip_address: '1.1.1.1', service_manage: true } } |
| 193 | + let(:python_package) do |
| 194 | + if %w[Debian SUSE].include?(facts[:os]['family']) |
| 195 | + 'python' |
| 196 | + elsif %w[FreeBSD OpenBSD].include?(facts[:os]['family']) |
| 197 | + 'python2' |
| 198 | + elsif facts[:os]['family'] == 'RedHat' |
| 199 | + if facts[:os]['release']['major'] == '8' |
| 200 | + 'python3' |
| 201 | + else |
| 202 | + 'python' |
| 203 | + end |
| 204 | + end |
| 205 | + end |
188 | 206 |
|
189 | 207 | context 'with rabbitmqadmin_package set to blub' do |
190 | 208 | let(:params) { { rabbitmqadmin_package: 'blub' } } |
|
206 | 224 | is_expected.to contain_archive('rabbitmqadmin').with_source('http://1.1.1.1:15672/cli/rabbitmqadmin') |
207 | 225 | end |
208 | 226 | end |
209 | | - if %w[RedHat Debian SUSE].include?(facts[:os]['family']) |
210 | | - it { is_expected.to contain_package('python') } |
211 | | - end |
212 | | - if %w[FreeBSD OpenBSD].include?(facts[:os]['family']) |
213 | | - it { is_expected.to contain_package('python2') } |
214 | | - end |
| 227 | + it { is_expected.to contain_package(python_package) if python_package } |
215 | 228 | end |
216 | 229 | context 'with manage_python false' do |
217 | 230 | let(:params) { { manage_python: false } } |
|
220 | 233 | is_expected.to contain_class('rabbitmq::install::rabbitmqadmin') |
221 | 234 | is_expected.not_to contain_package('python') |
222 | 235 | is_expected.not_to contain_package('python2') |
| 236 | + is_expected.not_to contain_package('python3') |
223 | 237 | end |
224 | 238 | end |
225 | 239 |
|
|
0 commit comments