Fix unit tests
The unit tests were broken by a change to openstacklib Id09c3358c5843510e6a2a8c0e2d4aeb3607e098b which renamed some of the resources in the openstacklib classes. The problem is that our tests in this module should not have been testing what occurs within openstacklib so this fix updates the tests to only check what we are doing within this module. Change-Id: Idb09a2ecc467891942e253de79980b142235a838 Depends-On: I9d535ab38afea852559df2b3073bd4b74a2a3947
This commit is contained in:
parent
b76c0cac97
commit
2bb7c50d3e
|
@ -3,56 +3,29 @@ require 'spec_helper'
|
|||
describe 'neutron::wsgi::apache' do
|
||||
|
||||
shared_examples_for 'apache serving neutron with mod_wsgi' do
|
||||
it { is_expected.to contain_service('httpd').with_name(platform_parameters[:httpd_service_name]) }
|
||||
it { is_expected.to contain_class('neutron::deps') }
|
||||
it { is_expected.to contain_class('neutron::params') }
|
||||
it { is_expected.to contain_class('apache') }
|
||||
it { is_expected.to contain_class('apache::mod::wsgi') }
|
||||
|
||||
describe 'with default parameters' do
|
||||
|
||||
it { is_expected.to contain_file("#{platform_parameters[:wsgi_script_path]}").with(
|
||||
'ensure' => 'directory',
|
||||
'owner' => 'neutron',
|
||||
'group' => 'neutron',
|
||||
'require' => 'Package[httpd]'
|
||||
context 'with default parameters' do
|
||||
it { is_expected.to contain_class('neutron::params') }
|
||||
it { is_expected.to contain_class('apache') }
|
||||
it { is_expected.to contain_class('apache::mod::wsgi') }
|
||||
it { is_expected.to contain_class('apache::mod::ssl') }
|
||||
it { is_expected.to contain_openstacklib__wsgi__apache('neutron_wsgi').with(
|
||||
:bind_port => 9696,
|
||||
:group => 'neutron',
|
||||
:path => '/',
|
||||
:servername => facts[:fqdn],
|
||||
:ssl => true,
|
||||
:threads => 1,
|
||||
:user => 'neutron',
|
||||
:workers => facts[:os_workers],
|
||||
:wsgi_daemon_process => 'neutron',
|
||||
:wsgi_process_group => 'neutron',
|
||||
:wsgi_script_dir => platform_params[:wsgi_script_path],
|
||||
:wsgi_script_file => 'app',
|
||||
:wsgi_script_source => platform_params[:wsgi_script_source],
|
||||
)}
|
||||
|
||||
|
||||
it { is_expected.to contain_file('neutron_wsgi').with(
|
||||
'ensure' => 'file',
|
||||
'path' => "#{platform_parameters[:wsgi_script_path]}/app",
|
||||
'source' => platform_parameters[:wsgi_script_source],
|
||||
'owner' => 'neutron',
|
||||
'group' => 'neutron',
|
||||
'mode' => '0644'
|
||||
)}
|
||||
it { is_expected.to contain_file('neutron_wsgi').that_requires("File[#{platform_parameters[:wsgi_script_path]}]") }
|
||||
|
||||
it { is_expected.to contain_apache__vhost('neutron_wsgi').with(
|
||||
'servername' => 'some.host.tld',
|
||||
'ip' => nil,
|
||||
'port' => '9696',
|
||||
'docroot' => "#{platform_parameters[:wsgi_script_path]}",
|
||||
'docroot_owner' => 'neutron',
|
||||
'docroot_group' => 'neutron',
|
||||
'ssl' => 'true',
|
||||
'wsgi_daemon_process' => 'neutron',
|
||||
'wsgi_daemon_process_options' => {
|
||||
'user' => 'neutron',
|
||||
'group' => 'neutron',
|
||||
'processes' => '8',
|
||||
'threads' => '1',
|
||||
'display-name' => 'neutron_wsgi',
|
||||
},
|
||||
'wsgi_process_group' => 'neutron',
|
||||
'wsgi_script_aliases' => { '/' => "#{platform_parameters[:wsgi_script_path]}/app" },
|
||||
'require' => 'File[neutron_wsgi]'
|
||||
)}
|
||||
it { is_expected.to contain_concat("#{platform_parameters[:httpd_ports_file]}") }
|
||||
end
|
||||
|
||||
describe 'when overriding parameters using different ports' do
|
||||
context 'when overriding parameters using different ports' do
|
||||
let :params do
|
||||
{
|
||||
:servername => 'dummy.host',
|
||||
|
@ -63,29 +36,27 @@ describe 'neutron::wsgi::apache' do
|
|||
:workers => 37,
|
||||
}
|
||||
end
|
||||
|
||||
it { is_expected.to contain_apache__vhost('neutron_wsgi').with(
|
||||
'servername' => 'dummy.host',
|
||||
'ip' => '10.42.51.1',
|
||||
'port' => '12345',
|
||||
'docroot' => "#{platform_parameters[:wsgi_script_path]}",
|
||||
'docroot_owner' => 'neutron',
|
||||
'docroot_group' => 'neutron',
|
||||
'ssl' => 'false',
|
||||
'wsgi_daemon_process' => 'neutron',
|
||||
'wsgi_daemon_process_options' => {
|
||||
'user' => 'neutron',
|
||||
'group' => 'neutron',
|
||||
'processes' => '37',
|
||||
'threads' => '1',
|
||||
'display-name' => 'neutron',
|
||||
},
|
||||
'wsgi_process_group' => 'neutron',
|
||||
'wsgi_script_aliases' => { '/' => "#{platform_parameters[:wsgi_script_path]}/app" },
|
||||
'require' => 'File[neutron_wsgi]'
|
||||
it { is_expected.to contain_class('neutron::params') }
|
||||
it { is_expected.to contain_class('apache') }
|
||||
it { is_expected.to contain_class('apache::mod::wsgi') }
|
||||
it { is_expected.to_not contain_class('apache::mod::ssl') }
|
||||
it { is_expected.to contain_openstacklib__wsgi__apache('neutron_wsgi').with(
|
||||
:bind_host => '10.42.51.1',
|
||||
:bind_port => 12345,
|
||||
:group => 'neutron',
|
||||
:path => '/',
|
||||
:servername => 'dummy.host',
|
||||
:ssl => false,
|
||||
:threads => 1,
|
||||
:user => 'neutron',
|
||||
:workers => 37,
|
||||
:wsgi_daemon_process => 'neutron',
|
||||
:wsgi_process_display_name => 'neutron',
|
||||
:wsgi_process_group => 'neutron',
|
||||
:wsgi_script_dir => platform_params[:wsgi_script_path],
|
||||
:wsgi_script_file => 'app',
|
||||
:wsgi_script_source => platform_params[:wsgi_script_source],
|
||||
)}
|
||||
|
||||
it { is_expected.to contain_concat("#{platform_parameters[:httpd_ports_file]}") }
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -101,7 +72,7 @@ describe 'neutron::wsgi::apache' do
|
|||
}))
|
||||
end
|
||||
|
||||
let(:platform_parameters) do
|
||||
let(:platform_params) do
|
||||
case facts[:osfamily]
|
||||
when 'Debian'
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue