1 require 'spec_helper_acceptance'
3 describe 'rabbitmq binding:' do
6 context "create binding and queue resources when rabbit using default management port" do
7 it 'should run successfully' do
9 if $::osfamily == 'RedHat' {
10 class { 'erlang': epel_enable => true }
11 Class['erlang'] -> Class['::rabbitmq']
14 service_manage => true,
16 delete_guest_user => true,
20 rabbitmq_user { 'dan':
23 tags => ['monitoring', 'tag1'],
26 rabbitmq_user_permissions { 'dan@host1':
27 configure_permission => '.*',
28 read_permission => '.*',
29 write_permission => '.*',
32 rabbitmq_vhost { 'host1':
36 rabbitmq_exchange { 'exchange1@host1':
43 rabbitmq_queue { 'queue1@host1':
51 rabbitmq_binding { 'exchange1@queue1@host1':
54 destination_type => 'queue',
61 apply_manifest(pp, :catch_failures => true)
62 apply_manifest(pp, :catch_changes => true)
65 it 'should have the binding' do
66 shell('rabbitmqctl list_bindings -q -p host1') do |r|
67 expect(r.stdout).to match(/exchange1\sexchange\squeue1\squeue\s#/)
68 expect(r.exit_code).to be_zero
72 it 'should have the queue' do
73 shell('rabbitmqctl list_queues -q -p host1') do |r|
74 expect(r.stdout).to match(/queue1/)
75 expect(r.exit_code).to be_zero
81 context "create binding and queue resources when rabbit using a non-default management port" do
82 it 'should run successfully' do
84 if $::osfamily == 'RedHat' {
85 class { 'erlang': epel_enable => true }
86 Class['erlang'] -> Class['::rabbitmq']
89 service_manage => true,
91 management_port => '11111',
92 delete_guest_user => true,
96 rabbitmq_user { 'dan':
99 tags => ['monitoring', 'tag1'],
102 rabbitmq_user_permissions { 'dan@host2':
103 configure_permission => '.*',
104 read_permission => '.*',
105 write_permission => '.*',
108 rabbitmq_vhost { 'host2':
112 rabbitmq_exchange { 'exchange2@host2':
119 rabbitmq_queue { 'queue2@host2':
123 auto_delete => false,
127 rabbitmq_binding { 'exchange2@queue2@host2':
130 destination_type => 'queue',
137 apply_manifest(pp, :catch_failures => true)
138 apply_manifest(pp, :catch_changes => true)
141 it 'should have the binding' do
142 shell('rabbitmqctl list_bindings -q -p host2') do |r|
143 expect(r.stdout).to match(/exchange2\sexchange\squeue2\squeue\s#/)
144 expect(r.exit_code).to be_zero
148 it 'should have the queue' do
149 shell('rabbitmqctl list_queues -q -p host2') do |r|
150 expect(r.stdout).to match(/queue2/)
151 expect(r.exit_code).to be_zero