
Since Grizzly, nova-compute does not need database access anymore. Currently, only nova-api, nova-scheduler and nova-conductor really need database access. * Keep original nova parameters with backward compatibility * Create nova::db with database parameters * Import nova::db in nova::init for backward compatibility * Import nova::db in nova::{api,conductor,scheduler} * Refactorize unit tests for conductor & scheduler Change-Id: I42b9d2b1efb5856fed6550c25ac3142952690df1 Implements: blueprint move-db-params
47 lines
989 B
Ruby
47 lines
989 B
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/idle_timeout') }
|
|
end
|
|
|
|
context 'with overriden parameters' do
|
|
before :each do
|
|
params.merge!(
|
|
:database_connection => 'mysql://user:pass@db/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/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
|