bc7906f6dbfdf1fa10ead4b9c3d17ca3f4333891
[mirror/dsa-puppet.git] / 3rdparty / modules / cinder / spec / defines / cinder_backend_nfs_spec.rb
1 require 'spec_helper'
2
3 describe 'cinder::backend::nfs' do
4
5   let(:title) {'hippo'}
6
7   let :params do
8     {
9       :nfs_servers          => ['10.10.10.10:/shares', '10.10.10.10:/shares2'],
10       :nfs_mount_options    => 'vers=3',
11       :nfs_shares_config    => '/etc/cinder/other_shares.conf',
12       :nfs_disk_util        => 'du',
13       :nfs_sparsed_volumes  => true,
14       :nfs_mount_point_base => '/cinder_mount_point',
15       :nfs_used_ratio       => '0.7',
16       :nfs_oversub_ratio    => '0.9'
17     }
18   end
19
20   describe 'nfs volume driver' do
21
22     it 'configures nfs volume driver' do
23       should contain_cinder_config('hippo/volume_backend_name').with(
24         :value => 'hippo')
25       should contain_cinder_config('hippo/volume_driver').with_value(
26         'cinder.volume.drivers.nfs.NfsDriver')
27       should contain_cinder_config('hippo/nfs_shares_config').with_value(
28         '/etc/cinder/other_shares.conf')
29       should contain_cinder_config('hippo/nfs_mount_options').with_value(
30         'vers=3')
31       should contain_cinder_config('hippo/nfs_sparsed_volumes').with_value(
32         true)
33       should contain_cinder_config('hippo/nfs_mount_point_base').with_value(
34         '/cinder_mount_point')
35       should contain_cinder_config('hippo/nfs_disk_util').with_value(
36         'du')
37       should contain_cinder_config('hippo/nfs_used_ratio').with_value(
38         '0.7')
39       should contain_cinder_config('hippo/nfs_oversub_ratio').with_value(
40         '0.9')
41       should contain_file('/etc/cinder/other_shares.conf').with(
42         :content => "10.10.10.10:/shares\n10.10.10.10:/shares2",
43         :require => 'Package[cinder]',
44         :notify  => 'Service[cinder-volume]'
45       )
46     end
47   end
48 end