Files
puppet-openstack/spec/classes/openstack_cinder_controller_spec.rb
danehans dee1b10c14 Add support for SQL idle timeout.
Previously, OpenStack services logged
frequent database-has-gone-away errors.

This patch adds a parameter that can configure
the sql_idle_timeout which can be decreased
to reduce these errors.

More information on this issue can be found here:
  https://bugs.launchpad.net/nova/+bug/1007027 for more details.

Change-Id: I6e9388b36207be87f7e706be18b4cd4060956a55
2013-07-15 16:18:58 +00:00

64 lines
1.9 KiB
Ruby

require 'spec_helper'
describe 'openstack::cinder::controller' do
let :params do
{
:db_password => 'db_password',
:rabbit_password => 'rabpass',
:keystone_password => 'user_pass'
}
end
let :facts do
{ :osfamily => 'Redhat' }
end
it 'should configure using the default values' do
should contain_class('cinder').with(
:sql_connection => "mysql://cinder:#{params[:db_password]}@127.0.0.1/cinder?charset=utf8",
:sql_idle_timeout => '3600',
:rpc_backend => 'cinder.openstack.common.rpc.impl_kombu',
:rabbit_userid => 'guest',
:rabbit_password => params[:rabbit_password],
:rabbit_host => '127.0.0.1',
:rabbit_port => '5672',
:rabbit_hosts => false,
:rabbit_virtual_host => '/',
:package_ensure => 'present',
:api_paste_config => '/etc/cinder/api-paste.ini',
:debug => false,
:verbose => false
)
should contain_class('cinder::api').with(
:keystone_password => params[:keystone_password],
:keystone_enabled => true,
:keystone_user => 'cinder',
:keystone_auth_host => 'localhost',
:keystone_auth_port => '35357',
:keystone_auth_protocol => 'http',
:service_port => '5000',
:package_ensure => 'present',
:bind_host => '0.0.0.0',
:enabled => true
)
should contain_class('cinder::scheduler').with(
:scheduler_driver => 'cinder.scheduler.simple.SimpleScheduler',
:package_ensure => 'present',
:enabled => true
)
end
context 'with unsupported db type' do
before do
params.merge!({:db_type => 'sqlite'})
end
it do
expect { subject }.to raise_error(Puppet::Error, /Unsupported db_type sqlite/)
end
end
end