forked from voxpupuli/puppet-rabbitmq
-
Notifications
You must be signed in to change notification settings - Fork 0
/
clustering_spec.rb
60 lines (53 loc) · 1.73 KB
/
clustering_spec.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
require 'spec_helper_acceptance'
describe 'rabbitmq clustering' do
context 'rabbitmq::wipe_db_on_cookie_change => false' do
it 'should run successfully' do
pp = <<-EOS
class { 'rabbitmq':
config_cluster => true,
cluster_nodes => ['rabbit1', 'rabbit2'],
cluster_node_type => 'ram',
erlang_cookie => 'TESTCOOKIE',
wipe_db_on_cookie_change => false,
}
if $::osfamily == 'RedHat' {
class { 'erlang': epel_enable => true}
Class['erlang'] -> Class['rabbitmq']
}
EOS
apply_manifest(pp, :expect_failures => true)
end
describe file('/var/lib/rabbitmq/.erlang.cookie') do
it { should_not contain 'TESTCOOKIE' }
end
end
context 'rabbitmq::wipe_db_on_cookie_change => true' do
it 'should run successfully' do
pp = <<-EOS
class { 'rabbitmq':
config_cluster => true,
cluster_nodes => ['rabbit1', 'rabbit2'],
cluster_node_type => 'ram',
erlang_cookie => 'TESTCOOKIE',
wipe_db_on_cookie_change => true,
}
if $::osfamily == 'RedHat' {
class { 'erlang': epel_enable => true}
Class['erlang'] -> Class['rabbitmq']
}
EOS
apply_manifest(pp, :catch_failures => true)
end
describe file('/etc/rabbitmq/rabbitmq.config') do
it { should be_file }
it { should contain 'cluster_nodes' }
it { should contain 'rabbit@rabbit1' }
it { should contain 'rabbit@rabbit2' }
it { should contain 'ram' }
end
describe file('/var/lib/rabbitmq/.erlang.cookie') do
it { should be_file }
it { should contain 'TESTCOOKIE' }
end
end
end