b843ac64155560c83814cff207b6a1158cb14828
[mirror/dsa-puppet.git] / 3rdparty / modules / glance / spec / classes / glance_backend_rbd_spec.rb
1 require 'spec_helper'
2
3 describe 'glance::backend::rbd' do
4   let :facts do
5     {
6       :osfamily => 'Debian'
7     }
8   end
9
10   describe 'when defaults with rbd_store_user' do
11     let :params do
12       {
13         :rbd_store_user  => 'glance',
14       }
15     end
16
17     it { should contain_glance_api_config('glance_store/default_store').with_value('rbd') }
18     it { should contain_glance_api_config('glance_store/rbd_store_pool').with_value('images') }
19     it { should contain_glance_api_config('glance_store/rbd_store_ceph_conf').with_value('/etc/ceph/ceph.conf') }
20     it { should contain_glance_api_config('glance_store/rbd_store_chunk_size').with_value('8') }
21
22
23     it { should contain_package('python-ceph').with(
24         :name   => 'python-ceph',
25         :ensure => 'present'
26       )
27     }
28   end
29
30   describe 'when passing params' do
31     let :params do
32       {
33         :rbd_store_user        => 'user',
34         :rbd_store_chunk_size  => '2',
35         :package_ensure        => 'latest',
36       }
37     end
38     it { should contain_glance_api_config('glance_store/rbd_store_user').with_value('user') }
39     it { should contain_glance_api_config('glance_store/rbd_store_chunk_size').with_value('2') }
40     it { should contain_package('python-ceph').with(
41         :name   => 'python-ceph',
42         :ensure => 'latest'
43       )
44     }
45   end
46 end