
Previously, memcached would always be included in the openstack::horizon class. Additionally, the cache_server_ip parameter was used concurrently by memcached and horizon classes. This prevented users from 1. Using an existing memcached deployment 2. Binding memcached to a local address and having Horizon use an external memcached server. This change implements the configure_memcached and memcached_listen_ip parameters. configure_memcached allows users to enable/disable the memcached class on an as-needed basis. memcached_listen_ip allows users to seperate the IP address used for binding memcached from the address used by Horizon to access memcached. configure_memcached defaults to 'true' and memcached_listen_ip defaults to undef for backwards compatibility and to enable memcached and have memcached use cache_server_ip for binding an IP. Change-Id: I5e4f4b5786d5ce7da59004a6a55b675a6dd32541
78 lines
2.1 KiB
Ruby
78 lines
2.1 KiB
Ruby
require 'spec_helper'
|
|
|
|
describe 'openstack::horizon' do
|
|
|
|
let :required_params do
|
|
{ :secret_key => 'super_secret' }
|
|
end
|
|
|
|
let :params do
|
|
required_params
|
|
end
|
|
|
|
let :facts do
|
|
{
|
|
:osfamily => 'Redhat',
|
|
:memorysize => '1GB',
|
|
:processorcount => '1',
|
|
:concat_basedir => '/tmp',
|
|
:operatingsystemrelease => '5'
|
|
}
|
|
end
|
|
|
|
it 'should configure horizon and memcache using default parameters and secret key' do
|
|
should contain_class('memcached').with(
|
|
:listen_ip => '127.0.0.1',
|
|
:tcp_port => '11211',
|
|
:udp_port => '11211'
|
|
)
|
|
should contain_class('horizon').with(
|
|
:cache_server_ip => '127.0.0.1',
|
|
:cache_server_port => '11211',
|
|
:secret_key => 'super_secret',
|
|
:horizon_app_links => false,
|
|
:keystone_host => '127.0.0.1',
|
|
:keystone_scheme => 'http',
|
|
:keystone_default_role => 'Member',
|
|
:django_debug => 'False',
|
|
:api_result_limit => 1000
|
|
)
|
|
end
|
|
|
|
context 'when memcached is disabled' do
|
|
let :params do
|
|
required_params.merge(
|
|
:configure_memcached => false
|
|
)
|
|
end
|
|
it 'should configure horizon without memcached using default parameters and secret key' do
|
|
should_not contain_class('memcached')
|
|
should contain_class('horizon').with(
|
|
:cache_server_ip => '127.0.0.1',
|
|
:cache_server_port => '11211',
|
|
:secret_key => 'super_secret',
|
|
:horizon_app_links => false,
|
|
:keystone_host => '127.0.0.1',
|
|
:keystone_scheme => 'http',
|
|
:keystone_default_role => 'Member',
|
|
:django_debug => 'False',
|
|
:api_result_limit => 1000
|
|
)
|
|
end
|
|
end
|
|
|
|
context 'when memcached listen ip is overridden' do
|
|
let :params do
|
|
required_params.merge(
|
|
:configure_memcached => true,
|
|
:memcached_listen_ip => '10.10.10.10'
|
|
)
|
|
end
|
|
it 'should override params for memcached' do
|
|
should contain_class('memcached').with(
|
|
:listen_ip => '10.10.10.10'
|
|
)
|
|
end
|
|
end
|
|
end
|