57d51bbae2
commit 4832bd61b5b1bfea7c9cc985508e65cd10081652 Source: https://github.com/puppetlabs/puppetlabs-rabbitmq.git Related blueprint merge-openstack-puppet-modules Fuel-CI: disable Change-Id: I924a2a4489dc329fefbee859a4b4bde0b79e86d1 Signed-off-by: Bogdan Dobrelya <bdobrelia@mirantis.com>
86 lines
2.2 KiB
Ruby
86 lines
2.2 KiB
Ruby
require 'spec_helper_acceptance'
|
|
|
|
describe 'rabbitmq::install::rabbitmqadmin class' do
|
|
context 'does nothing if service is unmanaged' do
|
|
it 'should run successfully' do
|
|
pp = <<-EOS
|
|
class { 'rabbitmq':
|
|
admin_enable => true,
|
|
service_manage => false,
|
|
}
|
|
if $::osfamily == 'RedHat' {
|
|
class { 'erlang': epel_enable => true}
|
|
Class['erlang'] -> Class['rabbitmq']
|
|
}
|
|
EOS
|
|
|
|
shell('rm -f /var/lib/rabbitmq/rabbitmqadmin')
|
|
apply_manifest(pp, :catch_failures => true)
|
|
end
|
|
|
|
describe file('/var/lib/rabbitmq/rabbitmqadmin') do
|
|
it { should_not be_file }
|
|
end
|
|
end
|
|
|
|
context 'downloads the cli tools' do
|
|
it 'should run successfully' do
|
|
pp = <<-EOS
|
|
class { 'rabbitmq':
|
|
admin_enable => true,
|
|
service_manage => true,
|
|
}
|
|
if $::osfamily == 'RedHat' {
|
|
class { 'erlang': epel_enable => true}
|
|
Class['erlang'] -> Class['rabbitmq']
|
|
}
|
|
EOS
|
|
|
|
apply_manifest(pp, :catch_failures => true)
|
|
end
|
|
|
|
describe file('/var/lib/rabbitmq/rabbitmqadmin') do
|
|
it { should be_file }
|
|
end
|
|
end
|
|
|
|
context 'works with specified default credentials' do
|
|
it 'should run successfully' do
|
|
# make sure credential change takes effect before admin_enable
|
|
pp_pre = <<-EOS
|
|
class { 'rabbitmq':
|
|
service_manage => true,
|
|
default_user => 'foobar',
|
|
default_pass => 'bazblam',
|
|
}
|
|
if $::osfamily == 'RedHat' {
|
|
class { 'erlang': epel_enable => true}
|
|
Class['erlang'] -> Class['rabbitmq']
|
|
}
|
|
EOS
|
|
|
|
pp = <<-EOS
|
|
class { 'rabbitmq':
|
|
admin_enable => true,
|
|
service_manage => true,
|
|
default_user => 'foobar',
|
|
default_pass => 'bazblam',
|
|
}
|
|
if $::osfamily == 'RedHat' {
|
|
class { 'erlang': epel_enable => true}
|
|
Class['erlang'] -> Class['rabbitmq']
|
|
}
|
|
EOS
|
|
|
|
shell('rm -f /var/lib/rabbitmq/rabbitmqadmin')
|
|
apply_manifest(pp_pre, :catch_failures => true)
|
|
apply_manifest(pp, :catch_failures => true)
|
|
end
|
|
|
|
describe file('/var/lib/rabbitmq/rabbitmqadmin') do
|
|
it { should be_file }
|
|
end
|
|
end
|
|
|
|
end
|