2013-04-12 17:00:31 +02:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe 'nova::spicehtml5proxy' do
|
|
|
|
|
|
|
|
let :pre_condition do
|
|
|
|
'include nova'
|
|
|
|
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
|
|
|
shared_examples 'nova-spicehtml5proxy debian package' do
|
|
|
|
let :params do
|
|
|
|
{ :enabled => true }
|
|
|
|
end
|
|
|
|
|
|
|
|
it { is_expected.to 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]',
|
|
|
|
)}
|
|
|
|
end
|
2013-04-12 17:00:31 +02:00
|
|
|
|
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
|
|
|
shared_examples 'nova-spicehtml5proxy' do
|
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(
|
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
|
|
|
|
2015-03-16 03:05:59 +01:00
|
|
|
it { is_expected.to 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
|
|
|
|
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(
|
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
|
|
|
|
|
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',
|
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
|
|
|
:os_package_type => 'ubuntu',
|
2018-11-26 13:22:46 -07:00
|
|
|
:os => { :family => 'Debian', :release => { :major => '16'}}
|
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
|
|
|
})
|
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({
|
2017-09-09 14:47:03 +02:00
|
|
|
:osfamily => 'Debian',
|
|
|
|
:operatingsystem => 'Debian',
|
|
|
|
:operatingsystemmajrelease => '9',
|
2018-11-26 13:22:46 -07:00
|
|
|
:os_package_type => 'debian',
|
|
|
|
:os => { :family => 'Debian', :release => { :major => '9'}}
|
2015-11-23 20:37:52 +00:00
|
|
|
})
|
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
|
|
|
|
|
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
|
|
|
it_configures 'nova-spicehtml5proxy debian package'
|
2013-12-04 20:32:36 -05:00
|
|
|
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',
|
2018-11-26 13:22:46 -07:00
|
|
|
:os_package_type => 'debian',
|
|
|
|
:os => { :family => 'Debian', :release => { :major => '16'}}
|
2015-11-23 20:37:52 +00:00
|
|
|
})
|
2015-11-04 13:59:31 -06:00
|
|
|
end
|
|
|
|
|
|
|
|
let :platform_params do
|
|
|
|
{ :spicehtml5proxy_package_name => 'nova-consoleproxy',
|
|
|
|
:spicehtml5proxy_service_name => 'nova-spicehtml5proxy' }
|
|
|
|
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
|
|
|
it_configures 'nova-spicehtml5proxy debian package'
|
2015-11-04 13:59:31 -06:00
|
|
|
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
|
2018-11-26 13:22:46 -07:00
|
|
|
@default_facts.merge({ :osfamily => 'RedHat',
|
|
|
|
:os => { :family => 'RedHat', :release => { :major => '7'}}
|
|
|
|
})
|
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
|