2 # Copyright (C) 2014 eNovance SAS <licensing@enovance.com>
4 # Author: Emilien Macchi <emilien.macchi@enovance.com>
6 # Licensed under the Apache License, Version 2.0 (the "License"); you may
7 # not use this file except in compliance with the License. You may obtain
8 # a copy of the License at
10 # http://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 # License for the specific language governing permissions and limitations
20 describe 'openstacklib::messaging::rabbitmq' do
22 let (:title) { 'nova' }
24 shared_examples 'openstacklib::messaging::rabbitmq examples' do
30 context 'with default parameters' do
31 it { should contain_rabbitmq_user('guest').with(
34 :provider => 'rabbitmqctl',
36 it { should contain_rabbitmq_user_permissions('guest@/').with(
37 :configure_permission => '.*',
38 :write_permission => '.*',
39 :read_permission => '.*',
40 :provider => 'rabbitmqctl',
42 it { should contain_rabbitmq_vhost('/').with(
43 :provider => 'rabbitmqctl',
47 context 'with custom parameters' do
51 :password => 'secrete',
52 :virtual_host => '/nova',
54 :configure_permission => '.nova',
55 :write_permission => '.nova',
56 :read_permission => '.nova'
60 it { should contain_rabbitmq_user('nova').with(
62 :password => 'secrete',
63 :provider => 'rabbitmqctl',
65 it { should contain_rabbitmq_user_permissions('nova@/nova').with(
66 :configure_permission => '.nova',
67 :write_permission => '.nova',
68 :read_permission => '.nova',
69 :provider => 'rabbitmqctl',
71 it { should contain_rabbitmq_vhost('/nova').with(
72 :provider => 'rabbitmqctl',
76 context 'when disabling vhost management' do
78 params.merge!( :manage_vhost => false )
81 it { should_not contain_rabbitmq_vhost }
86 context 'on a Debian osfamily' do
88 { :osfamily => "Debian" }
91 include_examples 'openstacklib::messaging::rabbitmq examples'
94 context 'on a RedHat osfamily' do
96 { :osfamily => 'RedHat' }
99 include_examples 'openstacklib::messaging::rabbitmq examples'