Switch wsgi test to use rspec-puppet-facts
The apache module expects the operatingsystem fact to be set and because the wsgi tests were not using rspec-puppet-facts the missing fact is causing failures. This change switches the wsgi test to leverage rspec-puppet-facts to ensure all the basic facts are being provided to resolve the unit test failures. Change-Id: Ic5d9bd9939ad153d92af2480742506c92acda2c6 Closes-Bug: #1651522
This commit is contained in:
parent
4801dd0ce3
commit
7b897406aa
@ -2,14 +2,6 @@ require 'spec_helper'
|
|||||||
|
|
||||||
describe 'nova::wsgi::apache' do
|
describe 'nova::wsgi::apache' do
|
||||||
|
|
||||||
let :global_facts do
|
|
||||||
@default_facts.merge({
|
|
||||||
:processorcount => 42,
|
|
||||||
:concat_basedir => '/var/lib/puppet/concat',
|
|
||||||
:fqdn => 'some.host.tld'
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
let :pre_condition do
|
let :pre_condition do
|
||||||
"include nova
|
"include nova
|
||||||
class { '::nova::keystone::authtoken':
|
class { '::nova::keystone::authtoken':
|
||||||
@ -26,7 +18,7 @@ describe 'nova::wsgi::apache' do
|
|||||||
it { is_expected.to contain_class('apache') }
|
it { is_expected.to contain_class('apache') }
|
||||||
it { is_expected.to contain_class('apache::mod::wsgi') }
|
it { is_expected.to contain_class('apache::mod::wsgi') }
|
||||||
|
|
||||||
describe 'with default parameters' do
|
context 'with default parameters' do
|
||||||
|
|
||||||
let :pre_condition do
|
let :pre_condition do
|
||||||
"include nova
|
"include nova
|
||||||
@ -84,7 +76,7 @@ describe 'nova::wsgi::apache' do
|
|||||||
it { is_expected.to contain_concat("#{platform_parameters[:httpd_ports_file]}") }
|
it { is_expected.to contain_concat("#{platform_parameters[:httpd_ports_file]}") }
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'when overriding parameters using different ports' do
|
context 'when overriding parameters using different ports' do
|
||||||
let :pre_condition do
|
let :pre_condition do
|
||||||
"include nova
|
"include nova
|
||||||
class { '::nova::keystone::authtoken':
|
class { '::nova::keystone::authtoken':
|
||||||
@ -120,7 +112,7 @@ describe 'nova::wsgi::apache' do
|
|||||||
)}
|
)}
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'when ::nova::api is missing in the composition layer' do
|
context 'when ::nova::api is missing in the composition layer' do
|
||||||
|
|
||||||
let :pre_condition do
|
let :pre_condition do
|
||||||
"include nova"
|
"include nova"
|
||||||
@ -131,44 +123,34 @@ describe 'nova::wsgi::apache' do
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'on RedHat platforms' do
|
on_supported_os({
|
||||||
let :facts do
|
:supported_os => OSDefaults.get_supported_os
|
||||||
global_facts.merge({
|
}).each do |os,facts|
|
||||||
:osfamily => 'RedHat',
|
context "on #{os}" do
|
||||||
:operatingsystemrelease => '7.0'
|
let (:facts) do
|
||||||
})
|
facts.merge!(OSDefaults.get_facts({ :fqdn => 'some.host.tld'}))
|
||||||
end
|
end
|
||||||
|
|
||||||
let :platform_parameters do
|
let (:platform_parameters) do
|
||||||
{
|
case facts[:osfamily]
|
||||||
:httpd_service_name => 'httpd',
|
when 'Debian'
|
||||||
:httpd_ports_file => '/etc/httpd/conf/ports.conf',
|
{
|
||||||
:wsgi_script_path => '/var/www/cgi-bin/nova',
|
:httpd_service_name => 'apache2',
|
||||||
:api_wsgi_script_source => '/usr/lib/python2.7/site-packages/nova/wsgi/nova-api.py',
|
:httpd_ports_file => '/etc/apache2/ports.conf',
|
||||||
}
|
:wsgi_script_path => '/usr/lib/cgi-bin/nova',
|
||||||
|
:api_wsgi_script_source => '/usr/lib/python2.7/dist-packages/nova/wsgi/nova-api.py',
|
||||||
|
}
|
||||||
|
when 'RedHat'
|
||||||
|
{
|
||||||
|
:httpd_service_name => 'httpd',
|
||||||
|
:httpd_ports_file => '/etc/httpd/conf/ports.conf',
|
||||||
|
:wsgi_script_path => '/var/www/cgi-bin/nova',
|
||||||
|
:api_wsgi_script_source => '/usr/lib/python2.7/site-packages/nova/wsgi/nova-api.py',
|
||||||
|
}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
it_behaves_like 'apache serving nova with mod_wsgi'
|
||||||
end
|
end
|
||||||
|
|
||||||
it_configures 'apache serving nova with mod_wsgi'
|
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'on Debian platforms' do
|
|
||||||
let :facts do
|
|
||||||
global_facts.merge({
|
|
||||||
:osfamily => 'Debian',
|
|
||||||
:operatingsystem => 'Debian',
|
|
||||||
:operatingsystemrelease => '7.0'
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
let :platform_parameters do
|
|
||||||
{
|
|
||||||
:httpd_service_name => 'apache2',
|
|
||||||
:httpd_ports_file => '/etc/apache2/ports.conf',
|
|
||||||
:wsgi_script_path => '/usr/lib/cgi-bin/nova',
|
|
||||||
:api_wsgi_script_source => '/usr/lib/python2.7/dist-packages/nova/wsgi/nova-api.py',
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
it_configures 'apache serving nova with mod_wsgi'
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user