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: Iaaa0ae75219a8beb42964675f13778dae17b9db4 Depends-On: I9d535ab38afea852559df2b3073bd4b74a2a3947
This commit is contained in:
@@ -249,16 +249,9 @@ describe 'cinder::api' do
|
|||||||
:validate => true,
|
:validate => true,
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
it { is_expected.to contain_exec('execute cinder-api validation').with(
|
it { is_expected.to contain_openstacklib__service_validation('cinder-api').with(
|
||||||
:path => '/usr/bin:/bin:/usr/sbin:/sbin',
|
|
||||||
:provider => 'shell',
|
|
||||||
:tries => '10',
|
|
||||||
:try_sleep => '2',
|
|
||||||
:command => 'cinder --os-auth-url http://localhost:5000 --os-project-name services --os-username cinder --os-password foo list',
|
:command => 'cinder --os-auth-url http://localhost:5000 --os-project-name services --os-username cinder --os-password foo list',
|
||||||
)}
|
:subscribe => 'Service[cinder-api]',
|
||||||
|
|
||||||
it { is_expected.to contain_anchor('create cinder-api anchor').with(
|
|
||||||
:require => 'Exec[execute cinder-api validation]',
|
|
||||||
)}
|
)}
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -269,16 +262,9 @@ describe 'cinder::api' do
|
|||||||
:validation_options => { 'cinder-api' => { 'command' => 'my-script' } }
|
:validation_options => { 'cinder-api' => { 'command' => 'my-script' } }
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
it { is_expected.to contain_exec('execute cinder-api validation').with(
|
it { is_expected.to contain_openstacklib__service_validation('cinder-api').with(
|
||||||
:path => '/usr/bin:/bin:/usr/sbin:/sbin',
|
|
||||||
:provider => 'shell',
|
|
||||||
:tries => '10',
|
|
||||||
:try_sleep => '2',
|
|
||||||
:command => 'my-script',
|
:command => 'my-script',
|
||||||
)}
|
:subscribe => 'Service[cinder-api]',
|
||||||
|
|
||||||
it { is_expected.to contain_anchor('create cinder-api anchor').with(
|
|
||||||
:require => 'Exec[execute cinder-api validation]',
|
|
||||||
)}
|
)}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -3,55 +3,29 @@ require 'spec_helper'
|
|||||||
describe 'cinder::wsgi::apache' do
|
describe 'cinder::wsgi::apache' do
|
||||||
|
|
||||||
shared_examples_for 'apache serving cinder with mod_wsgi' do
|
shared_examples_for 'apache serving cinder with mod_wsgi' do
|
||||||
it { is_expected.to contain_service('httpd').with_name(platform_params[:httpd_service_name]) }
|
context 'with default parameters' do
|
||||||
it { is_expected.to contain_class('cinder::params') }
|
it { is_expected.to contain_class('cinder::params') }
|
||||||
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') }
|
||||||
|
it { is_expected.to contain_class('apache::mod::ssl') }
|
||||||
describe 'with default parameters' do
|
it { is_expected.to contain_openstacklib__wsgi__apache('cinder_wsgi').with(
|
||||||
|
:bind_port => 8776,
|
||||||
it { is_expected.to contain_file("#{platform_params[:wsgi_script_path]}").with(
|
:group => 'cinder',
|
||||||
'ensure' => 'directory',
|
:path => '/',
|
||||||
'owner' => 'cinder',
|
:servername => facts[:fqdn],
|
||||||
'group' => 'cinder',
|
:ssl => true,
|
||||||
'require' => 'Package[httpd]'
|
:threads => facts[:os_workers],
|
||||||
|
:user => 'cinder',
|
||||||
|
:workers => 1,
|
||||||
|
:wsgi_daemon_process => 'cinder-api',
|
||||||
|
:wsgi_process_group => 'cinder-api',
|
||||||
|
:wsgi_script_dir => platform_params[:wsgi_script_path],
|
||||||
|
:wsgi_script_file => 'cinder-api',
|
||||||
|
:wsgi_script_source => platform_params[:wsgi_script_source],
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|
||||||
it { is_expected.to contain_file('cinder_wsgi').with(
|
|
||||||
'ensure' => 'file',
|
|
||||||
'path' => "#{platform_params[:wsgi_script_path]}/cinder-api",
|
|
||||||
'source' => platform_params[:wsgi_script_source],
|
|
||||||
'owner' => 'cinder',
|
|
||||||
'group' => 'cinder',
|
|
||||||
'mode' => '0644'
|
|
||||||
)}
|
|
||||||
it { is_expected.to contain_file('cinder_wsgi').that_requires("File[#{platform_params[:wsgi_script_path]}]") }
|
|
||||||
|
|
||||||
it { is_expected.to contain_apache__vhost('cinder_wsgi').with(
|
|
||||||
'servername' => 'some.host.tld',
|
|
||||||
'ip' => nil,
|
|
||||||
'port' => '8776',
|
|
||||||
'docroot' => "#{platform_params[:wsgi_script_path]}",
|
|
||||||
'docroot_owner' => 'cinder',
|
|
||||||
'docroot_group' => 'cinder',
|
|
||||||
'ssl' => 'true',
|
|
||||||
'wsgi_daemon_process' => 'cinder-api',
|
|
||||||
'wsgi_daemon_process_options' => {
|
|
||||||
'user' => 'cinder',
|
|
||||||
'group' => 'cinder',
|
|
||||||
'processes' => 1,
|
|
||||||
'threads' => '42',
|
|
||||||
'display-name' => 'cinder_wsgi',
|
|
||||||
},
|
|
||||||
'wsgi_process_group' => 'cinder-api',
|
|
||||||
'wsgi_script_aliases' => { '/' => "#{platform_params[:wsgi_script_path]}/cinder-api" },
|
|
||||||
'require' => 'File[cinder_wsgi]'
|
|
||||||
)}
|
|
||||||
it { is_expected.to contain_concat("#{platform_params[:httpd_ports_file]}") }
|
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'when overriding parameters using different ports' do
|
context'when overriding parameters using different ports' do
|
||||||
let :params do
|
let :params do
|
||||||
{
|
{
|
||||||
:servername => 'dummy.host',
|
:servername => 'dummy.host',
|
||||||
@@ -62,29 +36,27 @@ describe 'cinder::wsgi::apache' do
|
|||||||
:workers => 37,
|
:workers => 37,
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
it { is_expected.to contain_class('cinder::params') }
|
||||||
it { is_expected.to contain_apache__vhost('cinder_wsgi').with(
|
it { is_expected.to contain_class('apache') }
|
||||||
'servername' => 'dummy.host',
|
it { is_expected.to contain_class('apache::mod::wsgi') }
|
||||||
'ip' => '10.42.51.1',
|
it { is_expected.to_not contain_class('apache::mod::ssl') }
|
||||||
'port' => '12345',
|
it { is_expected.to contain_openstacklib__wsgi__apache('cinder_wsgi').with(
|
||||||
'docroot' => "#{platform_params[:wsgi_script_path]}",
|
:bind_host => '10.42.51.1',
|
||||||
'docroot_owner' => 'cinder',
|
:bind_port => 12345,
|
||||||
'docroot_group' => 'cinder',
|
:group => 'cinder',
|
||||||
'ssl' => 'false',
|
:path => '/',
|
||||||
'wsgi_daemon_process' => 'cinder-api',
|
:servername => 'dummy.host',
|
||||||
'wsgi_daemon_process_options' => {
|
:ssl => false,
|
||||||
'user' => 'cinder',
|
:threads => facts[:os_workers],
|
||||||
'group' => 'cinder',
|
:user => 'cinder',
|
||||||
'processes' => '37',
|
:workers => 37,
|
||||||
'threads' => '42',
|
:wsgi_daemon_process => 'cinder-api',
|
||||||
'display-name' => 'cinder-api',
|
:wsgi_process_display_name => 'cinder-api',
|
||||||
},
|
:wsgi_process_group => 'cinder-api',
|
||||||
'wsgi_process_group' => 'cinder-api',
|
:wsgi_script_dir => platform_params[:wsgi_script_path],
|
||||||
'wsgi_script_aliases' => { '/' => "#{platform_params[:wsgi_script_path]}/cinder-api" },
|
:wsgi_script_file => 'cinder-api',
|
||||||
'require' => 'File[cinder_wsgi]'
|
:wsgi_script_source => platform_params[:wsgi_script_source],
|
||||||
)}
|
)}
|
||||||
|
|
||||||
it { is_expected.to contain_concat("#{platform_params[:httpd_ports_file]}") }
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user