1 require 'spec_helper_acceptance'
3 describe 'rabbitmq clustering' do
4 context 'rabbitmq::wipe_db_on_cookie_change => false' do
5 it 'runs 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 $facts['os']['family'] == '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 { is_expected.not_to contain 'TESTCOOKIE' }
27 context 'rabbitmq::wipe_db_on_cookie_change => true' do
28 it 'runs successfully' do
31 config_cluster => true,
32 cluster_nodes => ['rabbit1', 'rabbit2'],
33 cluster_node_type => 'ram',
34 erlang_cookie => 'TESTCOOKIE',
35 wipe_db_on_cookie_change => true,
37 if $facts['os']['family'] == 'RedHat' {
38 class { 'erlang': epel_enable => true}
39 Class['erlang'] -> Class['rabbitmq']
43 apply_manifest(pp, catch_failures: true)
46 describe file('/etc/rabbitmq/rabbitmq.config') do
47 it { is_expected.to be_file }
48 it { is_expected.to contain 'cluster_nodes' }
49 it { is_expected.to contain 'rabbit@rabbit1' }
50 it { is_expected.to contain 'rabbit@rabbit2' }
51 it { is_expected.to contain 'ram' }
54 describe file('/var/lib/rabbitmq/.erlang.cookie') do
55 it { is_expected.to be_file }
56 it { is_expected.to contain 'TESTCOOKIE' }