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
18 # Unit tests for cinder::backends class
23 describe 'cinder::backends' do
25 let :default_params do
33 shared_examples_for 'cinder backends' do
36 default_params.merge(params)
39 context 'configure cinder with default parameters' do
42 :enabled_backends => ['lowcost', 'regular', 'premium'],
43 :default_volume_type => false
47 it 'configures cinder.conf with default params' do
48 should contain_cinder_config('DEFAULT/enabled_backends').with_value(p[:enabled_backends].join(','))
52 context 'configure cinder with a default volume type' do
55 :enabled_backends => ['foo', 'bar'],
56 :default_volume_type => 'regular'
60 it 'should fail to configure default volume type' do
61 expect { subject }.to raise_error(Puppet::Error, /The default_volume_type parameter is deprecated in this class, you should declare it in cinder::api./)
67 context 'on Debian platforms' do
69 { :osfamily => 'Debian' }
72 it_configures 'cinder backends'
75 context 'on RedHat platforms' do
77 { :osfamily => 'RedHat' }
80 it_configures 'cinder backends'