2013-04-12 17:00:31 +02:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe 'nova::spicehtml5proxy' do
|
|
|
|
|
|
|
|
let :pre_condition do
|
|
|
|
'include nova'
|
|
|
|
end
|
|
|
|
|
2013-12-04 20:32:36 -05:00
|
|
|
shared_examples 'nova-spicehtml5proxy' do
|
2013-04-12 17:00:31 +02:00
|
|
|
|
2013-12-04 20:32:36 -05:00
|
|
|
it 'configures nova.conf' do
|
2014-11-19 14:32:12 +01:00
|
|
|
is_expected.to contain_nova_config('spice/html5proxy_host').with(:value => '0.0.0.0')
|
|
|
|
is_expected.to contain_nova_config('spice/html5proxy_port').with(:value => '6082')
|
2013-12-04 20:32:36 -05:00
|
|
|
end
|
2013-04-12 17:00:31 +02:00
|
|
|
|
2015-03-16 03:05:59 +01:00
|
|
|
it { is_expected.to contain_package('nova-spicehtml5proxy').with(
|
2013-12-04 20:32:36 -05:00
|
|
|
:name => platform_params[:spicehtml5proxy_package_name],
|
2013-04-12 17:00:31 +02:00
|
|
|
:ensure => 'present'
|
|
|
|
) }
|
2013-12-04 20:32:36 -05:00
|
|
|
|
2015-03-16 03:05:59 +01:00
|
|
|
it { is_expected.to contain_service('nova-spicehtml5proxy').with(
|
2013-12-04 20:32:36 -05:00
|
|
|
:name => platform_params[:spicehtml5proxy_service_name],
|
2013-04-12 17:00:31 +02:00
|
|
|
:hasstatus => 'true',
|
2013-12-04 20:32:36 -05:00
|
|
|
:ensure => 'running'
|
2013-04-12 17:00:31 +02:00
|
|
|
)}
|
|
|
|
|
2014-01-13 22:58:10 -06:00
|
|
|
context 'with manage_service as false' do
|
|
|
|
let :params do
|
|
|
|
{ :enabled => true,
|
|
|
|
:manage_service => false
|
|
|
|
}
|
|
|
|
end
|
2015-03-16 03:05:59 +01:00
|
|
|
it { is_expected.to contain_service('nova-spicehtml5proxy').without_ensure }
|
2014-01-13 22:58:10 -06:00
|
|
|
end
|
|
|
|
|
2013-12-04 20:32:36 -05:00
|
|
|
context 'with package version' do
|
2013-04-12 17:00:31 +02:00
|
|
|
let :params do
|
2013-12-04 20:32:36 -05:00
|
|
|
{ :ensure_package => '2012.1-2' }
|
2013-04-12 17:00:31 +02:00
|
|
|
end
|
2013-12-04 20:32:36 -05:00
|
|
|
|
2015-03-16 03:05:59 +01:00
|
|
|
it { is_expected.to contain_package('nova-spicehtml5proxy').with(
|
2013-12-04 20:32:36 -05:00
|
|
|
:ensure => params[:ensure_package]
|
2013-04-12 17:00:31 +02:00
|
|
|
)}
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2013-12-04 20:32:36 -05:00
|
|
|
context 'on Ubuntu system' do
|
2013-04-12 17:00:31 +02:00
|
|
|
let :facts do
|
2015-11-23 20:37:52 +00:00
|
|
|
@default_facts.merge({
|
|
|
|
:osfamily => 'Debian',
|
2015-11-04 13:59:31 -06:00
|
|
|
:operatingsystem => 'Ubuntu',
|
2015-11-23 20:37:52 +00:00
|
|
|
:os_package_type => 'ubuntu'
|
|
|
|
})
|
2013-04-12 17:00:31 +02:00
|
|
|
end
|
2013-12-04 20:32:36 -05:00
|
|
|
|
|
|
|
let :platform_params do
|
|
|
|
{ :spicehtml5proxy_package_name => 'nova-spiceproxy',
|
2014-10-30 13:34:39 +01:00
|
|
|
:spicehtml5proxy_service_name => 'nova-spiceproxy' }
|
2013-12-04 20:32:36 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
it_configures 'nova-spicehtml5proxy'
|
2013-04-12 17:00:31 +02:00
|
|
|
end
|
|
|
|
|
2013-12-04 20:32:36 -05:00
|
|
|
context 'on Debian system' do
|
|
|
|
let :facts do
|
2015-11-23 20:37:52 +00:00
|
|
|
@default_facts.merge({
|
|
|
|
:osfamily => 'Debian',
|
2015-11-04 13:59:31 -06:00
|
|
|
:operatingsystem => 'Debian',
|
2015-11-23 20:37:52 +00:00
|
|
|
:os_package_type => 'debian'
|
|
|
|
})
|
2013-12-04 20:32:36 -05:00
|
|
|
end
|
2013-04-12 17:00:31 +02:00
|
|
|
|
2013-12-04 20:32:36 -05:00
|
|
|
let :platform_params do
|
|
|
|
{ :spicehtml5proxy_package_name => 'nova-consoleproxy',
|
|
|
|
:spicehtml5proxy_service_name => 'nova-spicehtml5proxy' }
|
|
|
|
end
|
|
|
|
|
|
|
|
it_configures 'nova-spicehtml5proxy'
|
|
|
|
end
|
|
|
|
|
2015-11-04 13:59:31 -06:00
|
|
|
context 'on Ubuntu system with Debian packages' do
|
|
|
|
let :facts do
|
2015-11-23 20:37:52 +00:00
|
|
|
@default_facts.merge({
|
|
|
|
:osfamily => 'Debian',
|
2015-11-04 13:59:31 -06:00
|
|
|
:operatingsystem => 'Ubuntu',
|
2015-11-23 20:37:52 +00:00
|
|
|
:os_package_type => 'debian'
|
|
|
|
})
|
2015-11-04 13:59:31 -06:00
|
|
|
end
|
|
|
|
|
|
|
|
let :platform_params do
|
|
|
|
{ :spicehtml5proxy_package_name => 'nova-consoleproxy',
|
|
|
|
:spicehtml5proxy_service_name => 'nova-spicehtml5proxy' }
|
|
|
|
end
|
|
|
|
|
|
|
|
it_configures 'nova-spicehtml5proxy'
|
|
|
|
end
|
|
|
|
|
|
|
|
|
2013-12-04 20:32:36 -05:00
|
|
|
context 'on Redhat platforms' do
|
2013-04-12 17:00:31 +02:00
|
|
|
let :facts do
|
2015-11-23 20:37:52 +00:00
|
|
|
@default_facts.merge({ :osfamily => 'RedHat' })
|
2013-04-12 17:00:31 +02:00
|
|
|
end
|
2013-12-04 20:32:36 -05:00
|
|
|
|
|
|
|
let :platform_params do
|
|
|
|
{ :spicehtml5proxy_package_name => 'openstack-nova-console',
|
|
|
|
:spicehtml5proxy_service_name => 'openstack-nova-spicehtml5proxy' }
|
|
|
|
end
|
|
|
|
|
|
|
|
it_configures 'nova-spicehtml5proxy'
|
2013-04-12 17:00:31 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|