memcached (openstack) is no longer in use
[mirror/dsa-puppet.git] / 3rdparty / modules / cinder / spec / defines / cinder_backend_glusterfs_spec.rb
1 require 'spec_helper'
2
3 describe 'cinder::backend::glusterfs' do
4
5   shared_examples_for 'glusterfs volume driver' do
6     let(:title) {'mygluster'}
7
8     let :params do
9       {
10         :glusterfs_shares           => ['10.10.10.10:/volumes', '10.10.10.11:/volumes'],
11         :glusterfs_shares_config    => '/etc/cinder/other_shares.conf',
12         :glusterfs_sparsed_volumes  => true,
13         :glusterfs_mount_point_base => '/cinder_mount_point',
14       }
15     end
16
17     it 'configures glusterfs volume driver' do
18       should contain_cinder_config('mygluster/volume_driver').with_value(
19         'cinder.volume.drivers.glusterfs.GlusterfsDriver')
20       should contain_cinder_config('mygluster/glusterfs_shares_config').with_value(
21         '/etc/cinder/other_shares.conf')
22       should contain_cinder_config('mygluster/glusterfs_sparsed_volumes').with_value(
23         true)
24       should contain_cinder_config('mygluster/glusterfs_mount_point_base').with_value(
25         '/cinder_mount_point')
26       should contain_file('/etc/cinder/other_shares.conf').with(
27         :content => "10.10.10.10:/volumes\n10.10.10.11:/volumes\n",
28         :require => 'Package[cinder]',
29         :notify  => 'Service[cinder-volume]'
30       )
31     end
32
33     context "with an parameter which has been removed" do
34       before do
35         params.merge!({
36           :glusterfs_disk_util => 'foo',
37         })
38       end
39       it 'should fails' do
40         expect { subject }.to raise_error(Puppet::Error, /glusterfs_disk_util is removed in Icehouse./)
41       end
42     end
43   end
44
45   context 'on Debian platforms' do
46     let :facts do
47       { :osfamily => 'Debian' }
48     end
49
50     it_configures 'glusterfs volume driver'
51   end
52
53   context 'on RedHat platforms' do
54     let :facts do
55       { :osfamily => 'RedHat' }
56     end
57
58     it_configures 'glusterfs volume driver'
59   end
60
61 end