
This patch aim to update our specs test in order to work with the rspec-puppet release 2.0.0, in the mean time, we update rspec syntax order to be prepared for rspec 3.x move. In details: * Upgrade and pin rspec-puppet from 1.0.1 to 2.0.0 * Use shared_examples "a Puppet::Error" for puppet::error tests * * Convert 'should' keyword to 'is_expected.to' (prepare rspec 3.x) * * Fix spec tests for rspec-puppet 2.0.0 * Clean Gemfile (remove over-specificication of runtime deps of puppetlabs_spec_helper) Change-Id: I172439c6ed185bb38b325b2524cab1475cdc7504
93 lines
2.3 KiB
Ruby
93 lines
2.3 KiB
Ruby
require 'spec_helper'
|
|
|
|
describe 'nova::spicehtml5proxy' do
|
|
|
|
let :pre_condition do
|
|
'include nova'
|
|
end
|
|
|
|
let :params do
|
|
{ :enabled => true }
|
|
end
|
|
|
|
shared_examples 'nova-spicehtml5proxy' do
|
|
|
|
it 'configures nova.conf' do
|
|
is_expected.to contain_nova_config('DEFAULT/spicehtml5proxy_host').with(:value => '0.0.0.0')
|
|
is_expected.to contain_nova_config('DEFAULT/spicehtml5proxy_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
|