fuel-library/deployment/puppet/rabbitmq/spec/acceptance/class_spec.rb
Bogdan Dobrelya 507d54e4c9 Adapt rabbitmq module for Fuel
* Sync to v5.0.0 (supports Ubuntu 14.04, major SSL fixes)
* Fix deprecated in 5.0.0 params
* Reimplement waiting/retries in rabbitmq provider
  (https://tickets.puppetlabs.com/browse/MODULES-1452)
* Configure clustering with an erlang cookie hardcode. Also
  pass the cookie to the OCF script.
* Make OCF script always update an erlang cookie, if specified
  (default false)
* Add dependency module: nanliu-staging
* Add support for rabbimtq class false value for nova module
  (https://bugs.launchpad.net/puppet-nova/+bug/1407077)
* Do not use nova::rabbitmq to install and configure rabbitmq
  service anymore, install it separately.
  (TODO move it as a granular deploy step)
* Adjust other existing rabbit class calls for new 5.0.0 rabbit module
* Remove deprecated usage of rabbitmq::server class and replace it
  to ::rabbitmq (cinder, murano, openstack, zabbix, mcollective,
  nailgun)
* Remove rabbit.pub.key and do not manage repos for rabbit package
  as we have it in nailgun repos and Fuel uses these repos for offline
  installation of rabbitmq.
  (Related upstream bug https://tickets.puppetlabs.com/browse/MODULES-1631)
* Move custom rabbit OCF file from nova to openstack and remove
  OS-aware services disable from rabbit's manifests
* Make pacemaker provider HA wrapper for rabbitmq service and move
  it to pacemaker_wrappers::rabbitmq
* Fix linting
* Fix rabbitmq service name for zabbix mon
* Fix env_config for rabbitmq::nailgun, unify RABBIT_* env args.
* Use key_content, package_gpg_key, config_*, cluster_*,
  environment_* params to ensure the same rabbit configuration as
  before and make offline installation possible.
* Add cluster_partition_handling param for openstack::controller
* Del unused rabbitmq_node_ip_address and rename as node_ip_address
* Del unneeded rabbit_cluster due to it is being evaluated via
  passed rabbitmq_cluster_nodes as well
* Adjust debug log_levels for rabbit config as well
* For '$production !~ /docker/' case, remove custom init scripts
  for rabbit as non relevant anymore.
* Enable rspec tests for rabbitmq in utils
* Disable rspecs for erlang module.

Related blueprint merge-openstack-puppet-modules
Related-bug: #1377491

Change-Id: I6e631b975c5835d2d6f1984d5a070a45231fe9ab
Signed-off-by: Bogdan Dobrelya <bdobrelia@mirantis.com>
2015-01-09 16:11:28 +01:00

96 lines
2.3 KiB
Ruby

require 'spec_helper_acceptance'
describe 'rabbitmq class:' do
case fact('osfamily')
when 'RedHat'
package_name = 'rabbitmq-server'
service_name = 'rabbitmq-server'
when 'SUSE'
package_name = 'rabbitmq-server'
service_name = 'rabbitmq-server'
when 'Debian'
package_name = 'rabbitmq-server'
service_name = 'rabbitmq-server'
when 'Archlinux'
package_name = 'rabbitmq'
service_name = 'rabbitmq'
end
context "default class inclusion" do
it 'should run successfully' do
pp = <<-EOS
class { 'rabbitmq': }
if $::osfamily == 'RedHat' {
class { 'erlang': epel_enable => true}
Class['erlang'] -> Class['rabbitmq']
}
EOS
# Apply twice to ensure no errors the second time.
apply_manifest(pp, :catch_failures => true)
expect(apply_manifest(pp, :catch_changes => true).exit_code).to be_zero
end
describe package(package_name) do
it { should be_installed }
end
describe service(service_name) do
it { should be_enabled }
it { should be_running }
end
end
context "disable and stop service" do
it 'should run successfully' do
pp = <<-EOS
class { 'rabbitmq':
service_ensure => 'stopped',
}
if $::osfamily == 'RedHat' {
class { 'erlang': epel_enable => true}
Class['erlang'] -> Class['rabbitmq']
}
EOS
apply_manifest(pp, :catch_failures => true)
end
describe service(service_name) do
it { should_not be_enabled }
it { should_not be_running }
end
end
context "service is unmanaged" do
it 'should run successfully' do
pp_pre = <<-EOS
class { 'rabbitmq': }
if $::osfamily == 'RedHat' {
class { 'erlang': epel_enable => true}
Class['erlang'] -> Class['rabbitmq']
}
EOS
pp = <<-EOS
class { 'rabbitmq':
service_manage => false,
service_ensure => 'stopped',
}
if $::osfamily == 'RedHat' {
class { 'erlang': epel_enable => true}
Class['erlang'] -> Class['rabbitmq']
}
EOS
apply_manifest(pp_pre, :catch_failures => true)
apply_manifest(pp, :catch_failures => true)
end
describe service(service_name) do
it { should be_enabled }
it { should be_running }
end
end
end