]> git.donarmstrong.com Git - dsa-puppet.git/blob - 3rdparty/modules/nova/spec/classes/nova_compute_vmware_spec.rb
try again, with puppetforge modules, correctly included now
[dsa-puppet.git] / 3rdparty / modules / nova / spec / classes / nova_compute_vmware_spec.rb
1 require 'spec_helper'
2
3 describe 'nova::compute::vmware' do
4
5   let :params do
6     {:host_ip => '127.0.0.1',
7      :host_username => 'root',
8      :host_password => 'passw0rd',
9      :cluster_name => 'cluster1'}
10   end
11
12   let :optional_params do
13     {:api_retry_count => 10,
14      :maximum_objects => 100,
15      :task_poll_interval => 10.5,
16      :use_linked_clone => false,
17      :wsdl_location => 'http://127.0.0.1:8080/vmware/SDK/wsdl/vim25/vimService.wsdl'}
18   end
19
20   it 'configures vmwareapi in nova.conf' do
21     should contain_nova_config('DEFAULT/compute_driver').with_value('vmwareapi.VMwareVCDriver')
22     should contain_nova_config('VMWARE/host_ip').with_value(params[:host_ip])
23     should contain_nova_config('VMWARE/host_username').with_value(params[:host_username])
24     should contain_nova_config('VMWARE/host_password').with_value(params[:host_password])
25     should contain_nova_config('VMWARE/cluster_name').with_value(params[:cluster_name])
26     should contain_nova_config('VMWARE/api_retry_count').with_value(5)
27     should contain_nova_config('VMWARE/maximum_objects').with_value(100)
28     should contain_nova_config('VMWARE/task_poll_interval').with_value(5.0)
29     should contain_nova_config('VMWARE/use_linked_clone').with_value(true)
30     should_not contain_nova_config('VMWARE/wsdl_location')
31   end
32
33   it 'installs suds python package' do
34     should contain_package('python-suds').with(
35                :ensure => 'present'
36                 )
37   end
38
39   context 'with optional parameters' do
40     before :each do
41       params.merge!(optional_params)
42     end
43
44     it 'configures vmwareapi in nova.conf' do
45       should contain_nova_config('VMWARE/api_retry_count').with_value(params[:api_retry_count])
46       should contain_nova_config('VMWARE/maximum_objects').with_value(params[:maximum_objects])
47       should contain_nova_config('VMWARE/task_poll_interval').with_value(params[:task_poll_interval])
48       should contain_nova_config('VMWARE/use_linked_clone').with_value(false)
49       should contain_nova_config('VMWARE/wsdl_location').with_value(params[:wsdl_location])
50     end
51   end
52 end