85940acaaea0861dd7e6955cb319950f406b7074
[mirror/dsa-puppet.git] / 3rdparty / modules / cinder / spec / defines / cinder_backend_vmdk_spec.rb
1 require 'spec_helper'
2
3 describe 'cinder::backend::vmdk' do
4
5   let(:title) { 'hippo' }
6
7   let :params do
8     {
9         :host_ip => '172.16.16.16',
10         :host_password => 'asdf',
11         :host_username => 'user'
12     }
13   end
14
15   let :optional_params do
16     {
17         :volume_folder => 'cinder-volume-folder',
18         :api_retry_count => 5,
19         :max_object_retrieval => 200,
20         :task_poll_interval => 10,
21         :image_transfer_timeout_secs => 3600,
22         :wsdl_location => 'http://127.0.0.1:8080/vmware/SDK/wsdl/vim25/vimService.wsdl'
23     }
24   end
25
26   it 'should configure vmdk driver in cinder.conf' do
27     should contain_cinder_config('hippo/volume_backend_name').with_value('hippo')
28     should contain_cinder_config('hippo/volume_driver').with_value('cinder.volume.drivers.vmware.vmdk.VMwareVcVmdkDriver')
29     should contain_cinder_config('hippo/vmware_host_ip').with_value(params[:host_ip])
30     should contain_cinder_config('hippo/vmware_host_username').with_value(params[:host_username])
31     should contain_cinder_config('hippo/vmware_host_password').with_value(params[:host_password])
32     should contain_cinder_config('hippo/vmware_volume_folder').with_value('cinder-volumes')
33     should contain_cinder_config('hippo/vmware_api_retry_count').with_value(10)
34     should contain_cinder_config('hippo/vmware_max_object_retrieval').with_value(100)
35     should contain_cinder_config('hippo/vmware_task_poll_interval').with_value(5)
36     should contain_cinder_config('hippo/vmware_image_transfer_timeout_secs').with_value(7200)
37     should_not contain_cinder_config('hippo/vmware_wsdl_location')
38   end
39
40   it 'installs suds python package' do
41     should contain_package('python-suds').with(
42                :ensure => 'present')
43   end
44
45   context 'with optional parameters' do
46     before :each do
47       params.merge!(optional_params)
48     end
49
50     it 'should configure vmdk driver in cinder.conf' do
51       should contain_cinder_config('hippo/vmware_volume_folder').with_value(params[:volume_folder])
52       should contain_cinder_config('hippo/vmware_api_retry_count').with_value(params[:api_retry_count])
53       should contain_cinder_config('hippo/vmware_max_object_retrieval').with_value(params[:max_object_retrieval])
54       should contain_cinder_config('hippo/vmware_task_poll_interval').with_value(params[:task_poll_interval])
55       should contain_cinder_config('hippo/vmware_image_transfer_timeout_secs').with_value(params[:image_transfer_timeout_secs])
56       should contain_cinder_config('hippo/vmware_wsdl_location').with_value(params[:wsdl_location])
57     end
58   end
59 end