0b12686518bcf9c5d88d1ef80c2f8a5512609c83
[mirror/dsa-puppet.git] / 3rdparty / modules / nova / spec / classes / nova_vnc_proxy_spec.rb
1 require 'spec_helper'
2
3 describe 'nova::vncproxy' do
4
5   let :pre_condition do
6     'include nova'
7   end
8
9   let :params do
10     {:enabled => true}
11   end
12
13   describe 'on debian platforms' do
14     let :facts do
15       { :osfamily => 'Debian' }
16     end
17
18     it { should contain_package('python-numpy').with(
19       :ensure => 'present',
20       :name   => 'python-numpy'
21     )}
22
23     it { should contain_nova_config('DEFAULT/novncproxy_host').with(:value => '0.0.0.0') }
24     it { should contain_nova_config('DEFAULT/novncproxy_port').with(:value => '6080') }
25     it { should contain_nova_config('DEFAULT/novncproxy_base_url').with(:value => 'http://0.0.0.0:6080/vnc_auto.html') }
26
27     it { should contain_package('nova-vncproxy').with(
28       :name   => 'nova-novncproxy',
29       :ensure => 'present'
30     ) }
31     it { should contain_service('nova-vncproxy').with(
32       :name      => 'nova-novncproxy',
33       :hasstatus => true,
34       :ensure    => 'running'
35     )}
36
37     describe 'with manage_service as false' do
38       let :params do
39         { :enabled        => true,
40           :manage_service => false
41         }
42       end
43       it { should contain_service('nova-vncproxy').without_ensure }
44     end
45
46     describe 'with package version' do
47       let :params do
48         {:ensure_package => '2012.1-2'}
49       end
50       it { should contain_package('nova-vncproxy').with(
51         'ensure' => '2012.1-2'
52       )}
53     end
54
55   end
56
57   describe 'on debian OS' do
58       let :facts do
59         { :osfamily => 'Debian', :operatingsystem => 'Debian' }
60       end
61       it { should contain_package('nova-vncproxy').with(
62         :name   => "nova-consoleproxy",
63         :ensure => 'present'
64       )}
65       it { should contain_service('nova-vncproxy').with(
66         :name      => 'nova-novncproxy',
67         :hasstatus => true,
68         :ensure    => 'running'
69       )}
70   end
71
72
73   describe 'on Redhatish platforms' do
74
75     let :facts do
76       { :osfamily => 'Redhat' }
77     end
78
79     it { should contain_package('python-numpy').with(
80       :name   => 'numpy',
81       :ensure => 'present'
82     )}
83
84   end
85
86 end