1 require 'spec_helper_acceptance'
3 describe 'rabbitmq clustering' do
4 context 'rabbitmq::wipe_db_on_cookie_change => false' do
5 it 'should run successfully' do
8 config_cluster => true,
9 cluster_nodes => ['rabbit1', 'rabbit2'],
10 cluster_node_type => 'ram',
11 erlang_cookie => 'TESTCOOKIE',
12 wipe_db_on_cookie_change => false,
14 if $::osfamily == 'RedHat' {
15 class { 'erlang': epel_enable => true}
16 Class['erlang'] -> Class['rabbitmq']
20 apply_manifest(pp, :expect_failures => true)
23 describe file('/var/lib/rabbitmq/.erlang.cookie') do
24 it { should_not contain 'TESTCOOKIE' }
28 context 'rabbitmq::wipe_db_on_cookie_change => true' do
29 it 'should run successfully' do
32 config_cluster => true,
33 cluster_nodes => ['rabbit1', 'rabbit2'],
34 cluster_node_type => 'ram',
35 erlang_cookie => 'TESTCOOKIE',
36 wipe_db_on_cookie_change => true,
38 if $::osfamily == 'RedHat' {
39 class { 'erlang': epel_enable => true}
40 Class['erlang'] -> Class['rabbitmq']
44 apply_manifest(pp, :catch_failures => true)
47 describe file('/etc/rabbitmq/rabbitmq.config') do
49 it { should contain 'cluster_nodes' }
50 it { should contain 'rabbit@rabbit1' }
51 it { should contain 'rabbit@rabbit2' }
52 it { should contain 'ram' }
55 describe file('/var/lib/rabbitmq/.erlang.cookie') do
57 it { should contain 'TESTCOOKIE' }