- ' {rabbitmq_auth_backend_ldap, [', ' {other_bind, as_user},',
- ' {servers, ["ldap.example.com"]},',
- ' {use_ssl, false},',
- ' {port, 389},', ' {foo, bar},', ' {log, true}'])
- content = catalogue.resource('file', 'rabbitmq.config').send(:parameters)[:content]
- expect(content).not_to include 'user_dn_pattern'
- end
- end
-
- describe 'configuring auth_backends' do
- let :params do
- { auth_backends: ['{baz, foo}', 'bar'] }
- end
-
- it 'contains auth_backends' do
- verify_contents(catalogue, 'rabbitmq.config',
- [' {auth_backends, [{baz, foo}, bar]},'])
- end
- end
-
- describe 'auth_backends overrides ldap_auth' do
- let :params do
- { auth_backends: ['{baz, foo}', 'bar'],
- ldap_auth: true }
- end
-
- it 'contains auth_backends' do
- verify_contents(catalogue, 'rabbitmq.config',
- [' {auth_backends, [{baz, foo}, bar]},'])
- end
- end
-
- describe 'configuring shovel plugin' do
- let :params do
- {
- config_shovel: true
- }
- end
-
- it { is_expected.to contain_rabbitmq_plugin('rabbitmq_shovel') }
-
- it { is_expected.to contain_rabbitmq_plugin('rabbitmq_shovel_management') }
-
- describe 'with admin_enable false' do
- let :params do
- {
- config_shovel: true,
- admin_enable: false
- }
- end
-
- it { is_expected.not_to contain_rabbitmq_plugin('rabbitmq_shovel_management') }
- end
-
- describe 'with static shovels' do
- let :params do
- {
- config_shovel: true,
- config_shovel_statics: {
- 'shovel_first' => '{sources,[{broker,"amqp://"}]},
- {destinations,[{broker,"amqp://site1.example.com"}]},
- {queue,<<"source_one">>}',
- 'shovel_second' => '{sources,[{broker,"amqp://"}]},
- {destinations,[{broker,"amqp://site2.example.com"}]},
- {queue,<<"source_two">>}'
- }
- }
- end
-
- it 'generates correct configuration' do
- verify_contents(catalogue, 'rabbitmq.config', [
- ' {rabbitmq_shovel,',
- ' [{shovels,[',
- ' {shovel_first,[{sources,[{broker,"amqp://"}]},',
- ' {destinations,[{broker,"amqp://site1.example.com"}]},',
- ' {queue,<<"source_one">>}]},',
- ' {shovel_second,[{sources,[{broker,"amqp://"}]},',
- ' {destinations,[{broker,"amqp://site2.example.com"}]},',
- ' {queue,<<"source_two">>}]}',
- ' ]}]}'
- ])
- end
- end
- end
-
- describe 'configuring shovel plugin' do
- let :params do
- {
- config_shovel: true
- }
- end
-
- it { is_expected.to contain_rabbitmq_plugin('rabbitmq_shovel') }
-
- it { is_expected.to contain_rabbitmq_plugin('rabbitmq_shovel_management') }
-
- describe 'with admin_enable false' do
- let :params do
- {
- config_shovel: true,
- admin_enable: false
- }
- end
-
- it { is_expected.not_to contain_rabbitmq_plugin('rabbitmq_shovel_management') }
- end
-
- describe 'with static shovels' do
- let :params do
- {
- config_shovel: true,
- config_shovel_statics: {
- 'shovel_first' => '{sources,[{broker,"amqp://"}]},
- {destinations,[{broker,"amqp://site1.example.com"}]},
- {queue,<<"source_one">>}',
- 'shovel_second' => '{sources,[{broker,"amqp://"}]},
- {destinations,[{broker,"amqp://site2.example.com"}]},
- {queue,<<"source_two">>}'
- }
- }
- end
-
- it 'generates correct configuration' do
- verify_contents(catalogue, 'rabbitmq.config', [
- ' {rabbitmq_shovel,',
- ' [{shovels,[',
- ' {shovel_first,[{sources,[{broker,"amqp://"}]},',
- ' {destinations,[{broker,"amqp://site1.example.com"}]},',
- ' {queue,<<"source_one">>}]},',
- ' {shovel_second,[{sources,[{broker,"amqp://"}]},',
- ' {destinations,[{broker,"amqp://site2.example.com"}]},',
- ' {queue,<<"source_two">>}]}',
- ' ]}]}'
- ])
- end