Files
puppet-nova/spec/classes/nova_spicehtml5_proxy_spec.rb
kirby@puppetlabs.com 895e057abb Enable nova service by default
This commit updates the default value for enable for nova components to
default to true, instead of false. Without this
change the nova service is not enabled by default resulting in a
different behavior than with other puppet openstack modules.
Associated tests are updated to expect the change in defaults.

Co-Authored-By: Cody Herriges <cody@puppetlabs.com>
Change-Id: I49fc84f9fedfe00d7846441e1b49334abb09e0eb
Closes-bug: #1220473
2015-07-15 13:58:09 -07:00

89 lines
2.2 KiB
Ruby

require 'spec_helper'
describe 'nova::spicehtml5proxy' do
let :pre_condition do
'include nova'
end
shared_examples 'nova-spicehtml5proxy' do
it 'configures nova.conf' do
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')
end
it { is_expected.to contain_package('nova-spicehtml5proxy').with(
:name => platform_params[:spicehtml5proxy_package_name],
:ensure => 'present'
) }
it { is_expected.to contain_service('nova-spicehtml5proxy').with(
:name => platform_params[:spicehtml5proxy_service_name],
:hasstatus => 'true',
:ensure => 'running'
)}
context 'with manage_service as false' do
let :params do
{ :enabled => true,
:manage_service => false
}
end
it { is_expected.to contain_service('nova-spicehtml5proxy').without_ensure }
end
context 'with package version' do
let :params do
{ :ensure_package => '2012.1-2' }
end
it { is_expected.to contain_package('nova-spicehtml5proxy').with(
:ensure => params[:ensure_package]
)}
end
end
context 'on Ubuntu system' do
let :facts do
{ :osfamily => 'Debian',
:operatingsystem => 'Ubuntu' }
end
let :platform_params do
{ :spicehtml5proxy_package_name => 'nova-spiceproxy',
:spicehtml5proxy_service_name => 'nova-spiceproxy' }
end
it_configures 'nova-spicehtml5proxy'
end
context 'on Debian system' do
let :facts do
{ :osfamily => 'Debian',
:operatingsystem => 'Debian' }
end
let :platform_params do
{ :spicehtml5proxy_package_name => 'nova-consoleproxy',
:spicehtml5proxy_service_name => 'nova-spicehtml5proxy' }
end
it_configures 'nova-spicehtml5proxy'
end
context 'on Redhat platforms' do
let :facts do
{ :osfamily => 'RedHat' }
end
let :platform_params do
{ :spicehtml5proxy_package_name => 'openstack-nova-console',
:spicehtml5proxy_service_name => 'openstack-nova-spicehtml5proxy' }
end
it_configures 'nova-spicehtml5proxy'
end
end