|
12 | 12 | facts |
13 | 13 | end |
14 | 14 |
|
15 | | - name = case facts[:osfamily] |
| 15 | + name = case facts[:os]['family'] |
16 | 16 | when 'Archlinux', 'OpenBSD', 'FreeBSD' |
17 | 17 | 'rabbitmq' |
18 | 18 | else |
|
29 | 29 | it { is_expected.to contain_package('rabbitmq-server-plugins') } if facts[:os]['family'] == 'Suse' |
30 | 30 |
|
31 | 31 | context 'with default params' do |
32 | | - it { is_expected.not_to contain_class('rabbitmq::repo::apt') } |
33 | | - it { is_expected.not_to contain_apt__source('rabbitmq') } |
34 | | - it { is_expected.not_to contain_class('rabbitmq::repo::rhel') } |
35 | | - it { is_expected.not_to contain_yumrepo('rabbitmq') } |
36 | | - end |
37 | | - |
38 | | - context 'with service_restart => false' do |
39 | | - let(:params) { { service_restart: false } } |
40 | | - |
41 | | - it { is_expected.not_to contain_class('rabbitmq::config').that_notifies('Class[rabbitmq::service]') } |
42 | | - end |
43 | | - |
44 | | - context 'with repos_ensure => true' do |
45 | | - let(:params) { { repos_ensure: true } } |
46 | | - |
47 | 32 | if facts[:os]['family'] == 'Debian' |
48 | 33 | it 'includes rabbitmq::repo::apt' do |
49 | 34 | is_expected.to contain_class('rabbitmq::repo::apt'). |
|
78 | 63 | end |
79 | 64 | end |
80 | 65 |
|
| 66 | + context 'with service_restart => false' do |
| 67 | + let(:params) { { service_restart: false } } |
| 68 | + |
| 69 | + it { is_expected.not_to contain_class('rabbitmq::config').that_notifies('Class[rabbitmq::service]') } |
| 70 | + end |
| 71 | + |
| 72 | + context 'with repos_ensure => false' do |
| 73 | + let(:params) { { repos_ensure: false } } |
| 74 | + |
| 75 | + it { is_expected.not_to contain_class('rabbitmq::repo::apt') } |
| 76 | + it { is_expected.not_to contain_apt__source('rabbitmq') } |
| 77 | + it { is_expected.not_to contain_class('rabbitmq::repo::rhel') } |
| 78 | + it { is_expected.not_to contain_yumrepo('rabbitmq') } |
| 79 | + end |
| 80 | + |
81 | 81 | context 'with no pin', if: facts[:os]['family'] == 'Debian' do |
82 | | - let(:params) { { repos_ensure: true, package_apt_pin: '' } } |
| 82 | + let(:params) { { package_apt_pin: '' } } |
83 | 83 |
|
84 | 84 | if Puppet.version =~ %r{^[6,7]} # https://tickets.puppetlabs.com/browse/PUP-9112 and https://tickets.puppetlabs.com/browse/PUP-9180 |
85 | 85 | let(:expected_key_apt_source_key_content) { 'nil' } |
|
99 | 99 | end |
100 | 100 |
|
101 | 101 | context 'with pin', if: facts[:os]['family'] == 'Debian' do |
102 | | - let(:params) { { repos_ensure: true, package_apt_pin: '700' } } |
| 102 | + let(:params) { { package_apt_pin: '700' } } |
103 | 103 |
|
104 | 104 | if Puppet.version =~ %r{^[6,7]} # https://tickets.puppetlabs.com/browse/PUP-9112 and https://tickets.puppetlabs.com/browse/PUP-9180 |
105 | 105 | let(:expected_key_apt_source_key_content) { 'nil' } |
|
239 | 239 | is_expected.to contain_archive('rabbitmqadmin').with_source('http://1.1.1.1:15672/cli/rabbitmqadmin') |
240 | 240 | end |
241 | 241 |
|
242 | | - it { is_expected.to contain_package('python') } if %w[RedHat Debian SUSE Archlinux].include?(facts[:os]['family']) |
| 242 | + it { is_expected.to contain_package('python') } if %w[Debian SUSE Archlinux].include?(facts[:os]['family']) |
243 | 243 | it { is_expected.to contain_package('python2') } if %w[FreeBSD OpenBSD].include?(facts[:os]['family']) |
244 | 244 | end |
245 | 245 |
|
|
250 | 250 | is_expected.to contain_class('rabbitmq::install::rabbitmqadmin') |
251 | 251 | is_expected.not_to contain_package('python') |
252 | 252 | is_expected.not_to contain_package('python2') |
| 253 | + is_expected.not_to contain_package('python3') |
253 | 254 | end |
254 | 255 | end |
255 | 256 |
|
256 | | - context 'with $management_ip_address undef and service_manage set to true', unless: facts[:osfamily] == 'Archlinux' do |
| 257 | + context 'with $management_ip_address undef and service_manage set to true', unless: facts[:os]['family'] == 'Archlinux' do |
257 | 258 | let(:params) { { admin_enable: true, management_ip_address: :undef } } |
258 | 259 |
|
259 | 260 | it 'we enable the admin interface by default' do |
|
265 | 266 | end |
266 | 267 | end |
267 | 268 |
|
268 | | - context 'with service_manage set to true, node_ip_address = undef, and default user/pass specified', unless: facts[:osfamily] == 'Archlinux' do |
| 269 | + context 'with service_manage set to true, node_ip_address = undef, and default user/pass specified', unless: facts[:os]['family'] == 'Archlinux' do |
269 | 270 | let(:params) { { admin_enable: true, default_user: 'foobar', default_pass: 'hunter2', node_ip_address: :undef } } |
270 | 271 |
|
271 | 272 | it 'we use the correct URL to rabbitmqadmin' do |
|
277 | 278 | end |
278 | 279 | end |
279 | 280 |
|
280 | | - context 'with service_manage set to true and default user/pass specified', unless: facts[:osfamily] == 'Archlinux' do |
| 281 | + context 'with service_manage set to true and default user/pass specified', unless: facts[:os]['family'] == 'Archlinux' do |
281 | 282 | let(:params) { { admin_enable: true, default_user: 'foobar', default_pass: 'hunter2', management_ip_address: '1.1.1.1' } } |
282 | 283 |
|
283 | 284 | it 'we use the correct URL to rabbitmqadmin' do |
|
0 commit comments