
Nova is able to talk to a read-only database for some tables so it improves the scalability of MySQL server and reduce the access to the server in charge of writes. More documentation: https://wiki.openstack.org/wiki/Slave_usage Change-Id: I1d44332acb381b11d90b63535d274f535be26d55
50 lines
1.2 KiB
Ruby
50 lines
1.2 KiB
Ruby
require 'spec_helper'
|
|
|
|
describe 'nova::db' do
|
|
|
|
let :params do
|
|
{}
|
|
end
|
|
|
|
shared_examples 'nova-db' do
|
|
|
|
context 'with default parameters' do
|
|
it { should_not contain_nova_config('database/connection') }
|
|
it { should_not contain_nova_config('database/slave_connection') }
|
|
it { should_not contain_nova_config('database/idle_timeout') }
|
|
end
|
|
|
|
context 'with overriden parameters' do
|
|
before :each do
|
|
params.merge!(
|
|
:database_connection => 'mysql://user:pass@db/db',
|
|
:slave_connection => 'mysql://user:pass@slave/db',
|
|
:database_idle_timeout => '30',
|
|
)
|
|
end
|
|
|
|
it { should contain_nova_config('database/connection').with_value('mysql://user:pass@db/db').with_secret(true) }
|
|
it { should contain_nova_config('database/slave_connection').with_value('mysql://user:pass@slave/db').with_secret(true) }
|
|
it { should contain_nova_config('database/idle_timeout').with_value('30') }
|
|
end
|
|
|
|
end
|
|
|
|
context 'on Debian platforms' do
|
|
let :facts do
|
|
{ :osfamily => 'Debian' }
|
|
end
|
|
|
|
it_configures 'nova-db'
|
|
end
|
|
|
|
context 'on Redhat platforms' do
|
|
let :facts do
|
|
{ :osfamily => 'RedHat' }
|
|
end
|
|
|
|
it_configures 'nova-db'
|
|
end
|
|
|
|
end
|