2013-04-12 17:00:31 +02:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe 'nova::spicehtml5proxy' do
|
|
|
|
|
|
|
|
let :pre_condition do
|
|
|
|
'include nova'
|
|
|
|
end
|
|
|
|
|
2018-11-28 17:34:42 +01:00
|
|
|
shared_examples 'nova::spicehtml5proxy' do
|
2013-12-04 20:32:36 -05:00
|
|
|
it 'configures nova.conf' do
|
2018-11-28 17:34:42 +01:00
|
|
|
should contain_nova_config('spice/html5proxy_host').with(:value => '0.0.0.0')
|
|
|
|
should 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
|
|
|
|
2018-11-28 17:34:42 +01:00
|
|
|
it { should contain_package('nova-spicehtml5proxy').with(
|
Fix VNC console in Debian
In Debian, SPICE is the default. Unfortunately, puppet-openstack fails to
set [spice]/enabled = false when VNC is selected, and therefore, both VNC
and SPICE ends up being enabled in nova.conf.
Also, Debian has a unique package nova-consoleproxy handling SPICE, VNC
and the XenVNC console, with /etc/default/nova-consoleproxy being used to
select what daemon to start. As puppet-openstack doesn't set it before
starting the VNC console service, it stays with spicehtml5 as default
value, and therefore, nova-novncproxy cannot start.
This patch fixes both issues.
Change-Id: Ia40805f27e8833fa01576432ae792e1becedd729
2018-04-25 21:29:54 +02:00
|
|
|
:ensure => 'present',
|
|
|
|
:name => platform_params[:spicehtml5proxy_package_name]
|
2013-04-12 17:00:31 +02:00
|
|
|
) }
|
2013-12-04 20:32:36 -05:00
|
|
|
|
2018-11-28 17:34:42 +01:00
|
|
|
it { should contain_service('nova-spicehtml5proxy').with(
|
Fix VNC console in Debian
In Debian, SPICE is the default. Unfortunately, puppet-openstack fails to
set [spice]/enabled = false when VNC is selected, and therefore, both VNC
and SPICE ends up being enabled in nova.conf.
Also, Debian has a unique package nova-consoleproxy handling SPICE, VNC
and the XenVNC console, with /etc/default/nova-consoleproxy being used to
select what daemon to start. As puppet-openstack doesn't set it before
starting the VNC console service, it stays with spicehtml5 as default
value, and therefore, nova-novncproxy cannot start.
This patch fixes both issues.
Change-Id: Ia40805f27e8833fa01576432ae792e1becedd729
2018-04-25 21:29:54 +02:00
|
|
|
:ensure => 'running',
|
2013-12-04 20:32:36 -05:00
|
|
|
:name => platform_params[:spicehtml5proxy_service_name],
|
Fix VNC console in Debian
In Debian, SPICE is the default. Unfortunately, puppet-openstack fails to
set [spice]/enabled = false when VNC is selected, and therefore, both VNC
and SPICE ends up being enabled in nova.conf.
Also, Debian has a unique package nova-consoleproxy handling SPICE, VNC
and the XenVNC console, with /etc/default/nova-consoleproxy being used to
select what daemon to start. As puppet-openstack doesn't set it before
starting the VNC console service, it stays with spicehtml5 as default
value, and therefore, nova-novncproxy cannot start.
This patch fixes both issues.
Change-Id: Ia40805f27e8833fa01576432ae792e1becedd729
2018-04-25 21:29:54 +02:00
|
|
|
:hasstatus => true
|
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
|
Fix VNC console in Debian
In Debian, SPICE is the default. Unfortunately, puppet-openstack fails to
set [spice]/enabled = false when VNC is selected, and therefore, both VNC
and SPICE ends up being enabled in nova.conf.
Also, Debian has a unique package nova-consoleproxy handling SPICE, VNC
and the XenVNC console, with /etc/default/nova-consoleproxy being used to
select what daemon to start. As puppet-openstack doesn't set it before
starting the VNC console service, it stays with spicehtml5 as default
value, and therefore, nova-novncproxy cannot start.
This patch fixes both issues.
Change-Id: Ia40805f27e8833fa01576432ae792e1becedd729
2018-04-25 21:29:54 +02:00
|
|
|
|
2018-11-28 17:34:42 +01:00
|
|
|
it { should 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
|
|
|
|
2018-11-28 17:34:42 +01:00
|
|
|
it { should contain_package('nova-spicehtml5proxy').with(
|
Fix VNC console in Debian
In Debian, SPICE is the default. Unfortunately, puppet-openstack fails to
set [spice]/enabled = false when VNC is selected, and therefore, both VNC
and SPICE ends up being enabled in nova.conf.
Also, Debian has a unique package nova-consoleproxy handling SPICE, VNC
and the XenVNC console, with /etc/default/nova-consoleproxy being used to
select what daemon to start. As puppet-openstack doesn't set it before
starting the VNC console service, it stays with spicehtml5 as default
value, and therefore, nova-novncproxy cannot start.
This patch fixes both issues.
Change-Id: Ia40805f27e8833fa01576432ae792e1becedd729
2018-04-25 21:29:54 +02:00
|
|
|
:ensure => params[:ensure_package],
|
|
|
|
:name => platform_params[:spicehtml5proxy_package_name],
|
2013-04-12 17:00:31 +02:00
|
|
|
)}
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2018-11-28 17:34:42 +01:00
|
|
|
shared_examples 'nova::spicehtml5proxy on Debian' do
|
|
|
|
let :params do
|
|
|
|
{
|
|
|
|
:enabled => true
|
|
|
|
}
|
2013-12-04 20:32:36 -05:00
|
|
|
end
|
|
|
|
|
2018-11-28 17:34:42 +01:00
|
|
|
it { should contain_file_line('/etc/default/nova-consoleproxy:NOVA_CONSOLE_PROXY_TYPE').with(
|
|
|
|
:path => '/etc/default/nova-consoleproxy',
|
|
|
|
:match => '^NOVA_CONSOLE_PROXY_TYPE=(.*)$',
|
|
|
|
:line => 'NOVA_CONSOLE_PROXY_TYPE=spicehtml5',
|
|
|
|
:tag => 'nova-consoleproxy',
|
|
|
|
:require => 'Anchor[nova::config::begin]',
|
|
|
|
:notify => 'Anchor[nova::config::end]',
|
|
|
|
)}
|
2013-12-04 20:32:36 -05:00
|
|
|
end
|
|
|
|
|
2018-11-28 17:34:42 +01:00
|
|
|
on_supported_os({
|
|
|
|
:supported_os => OSDefaults.get_supported_os
|
|
|
|
}).each do |os,facts|
|
|
|
|
context "on #{os}" do
|
|
|
|
let (:facts) do
|
2021-11-04 22:31:33 +09:00
|
|
|
facts.merge!(OSDefaults.get_facts())
|
2018-11-28 17:34:42 +01:00
|
|
|
end
|
2015-11-04 13:59:31 -06:00
|
|
|
|
2018-11-28 17:34:42 +01:00
|
|
|
let (:platform_params) do
|
|
|
|
case facts[:osfamily]
|
|
|
|
when 'Debian'
|
2021-11-04 22:31:33 +09:00
|
|
|
if facts[:operatingsystem] == 'Debian' then
|
2018-11-28 17:34:42 +01:00
|
|
|
package_name = 'nova-consoleproxy'
|
|
|
|
service_name = 'nova-spicehtml5proxy'
|
|
|
|
else
|
|
|
|
package_name = 'nova-spiceproxy'
|
|
|
|
service_name = 'nova-spiceproxy'
|
|
|
|
end
|
|
|
|
{
|
|
|
|
:spicehtml5proxy_package_name => package_name,
|
|
|
|
:spicehtml5proxy_service_name => service_name
|
|
|
|
}
|
|
|
|
when 'RedHat'
|
|
|
|
{
|
|
|
|
:spicehtml5proxy_package_name => 'openstack-nova-console',
|
|
|
|
:spicehtml5proxy_service_name => 'openstack-nova-spicehtml5proxy'
|
|
|
|
}
|
|
|
|
end
|
|
|
|
end
|
2015-11-04 13:59:31 -06:00
|
|
|
|
2018-11-28 17:34:42 +01:00
|
|
|
it_behaves_like 'nova::spicehtml5proxy'
|
2015-11-04 13:59:31 -06:00
|
|
|
|
2021-11-04 22:31:33 +09:00
|
|
|
if facts[:operatingsystem] == 'Debian'
|
2018-11-28 17:34:42 +01:00
|
|
|
it_behaves_like 'nova::spicehtml5proxy on Debian'
|
|
|
|
end
|
2013-12-04 20:32:36 -05:00
|
|
|
end
|
2013-04-12 17:00:31 +02:00
|
|
|
end
|
|
|
|
end
|