Skip to content

Commit 48d379f

Browse files
committed
Swap order of rabbitmqadmin tests
On Ubuntu, the rabbitmq-server package will automatically start the service, but the 'does nothing if service is unmanaged' will change the rabbitmq config file without restarting the service. The following test, 'downloads the cli tools' will also not refresh the service because the config file has not changed since the last test, but the server will not be listening on the right port and the staging resource fill fail. This patch swaps the order of the tests so that the service will be listening correctly on the first test, but then will correctly do nothing on the second test.
1 parent d019865 commit 48d379f

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

spec/acceptance/rabbitmqadmin_spec.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,46 @@
11
require 'spec_helper_acceptance'
22

33
describe 'rabbitmq::install::rabbitmqadmin class' do
4-
context 'does nothing if service is unmanaged' do
4+
context 'downloads the cli tools' do
55
it 'should run successfully' do
66
pp = <<-EOS
77
class { 'rabbitmq':
88
admin_enable => true,
9-
service_manage => false,
9+
service_manage => true,
1010
}
1111
if $::osfamily == 'RedHat' {
1212
class { 'erlang': epel_enable => true}
1313
Class['erlang'] -> Class['rabbitmq']
1414
}
1515
EOS
1616

17-
shell('rm -f /var/lib/rabbitmq/rabbitmqadmin')
1817
apply_manifest(pp, :catch_failures => true)
1918
end
2019

2120
describe file('/var/lib/rabbitmq/rabbitmqadmin') do
22-
it { should_not be_file }
21+
it { should be_file }
2322
end
2423
end
2524

26-
context 'downloads the cli tools' do
25+
context 'does nothing if service is unmanaged' do
2726
it 'should run successfully' do
2827
pp = <<-EOS
2928
class { 'rabbitmq':
3029
admin_enable => true,
31-
service_manage => true,
30+
service_manage => false,
3231
}
3332
if $::osfamily == 'RedHat' {
3433
class { 'erlang': epel_enable => true}
3534
Class['erlang'] -> Class['rabbitmq']
3635
}
3736
EOS
3837

38+
shell('rm -f /var/lib/rabbitmq/rabbitmqadmin')
3939
apply_manifest(pp, :catch_failures => true)
4040
end
4141

4242
describe file('/var/lib/rabbitmq/rabbitmqadmin') do
43-
it { should be_file }
43+
it { should_not be_file }
4444
end
4545
end
4646

0 commit comments

Comments
 (0)