oslo db: check puppet resource instead of actual config in spec
Change-Id: I4a0a8cb9e4b9e64091ea6a2d09f9e999720735ca
This commit is contained in:
parent
a105fbaaf6
commit
3705c795af
@ -6,14 +6,15 @@ describe 'trove::db' do
|
||||
|
||||
context 'with default parameters' do
|
||||
|
||||
it { is_expected.to contain_trove_config('database/connection').with_value('sqlite:////var/lib/trove/trove.sqlite').with_secret(true) }
|
||||
it { is_expected.to contain_trove_config('database/idle_timeout').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_trove_config('database/min_pool_size').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_trove_config('database/max_pool_size').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_trove_config('database/max_overflow').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_trove_config('database/max_retries').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_trove_config('database/retry_interval').with_value('<SERVICE DEFAULT>') }
|
||||
|
||||
it { is_expected.to contain_oslo__db('trove_config').with(
|
||||
:connection => 'sqlite:////var/lib/trove/trove.sqlite',
|
||||
:idle_timeout => '<SERVICE DEFAULT>',
|
||||
:min_pool_size => '<SERVICE DEFAULT>',
|
||||
:max_pool_size => '<SERVICE DEFAULT>',
|
||||
:max_retries => '<SERVICE DEFAULT>',
|
||||
:retry_interval => '<SERVICE DEFAULT>',
|
||||
:max_overflow => '<SERVICE DEFAULT>',
|
||||
)}
|
||||
end
|
||||
|
||||
context 'with specific parameters' do
|
||||
@ -27,18 +28,20 @@ describe 'trove::db' do
|
||||
:database_retry_interval => '11', }
|
||||
end
|
||||
|
||||
it { is_expected.to contain_trove_config('database/connection').with_value('mysql+pymysql://trove:trove@localhost/trove').with_secret(true) }
|
||||
it { is_expected.to contain_trove_config('database/idle_timeout').with_value('3601') }
|
||||
it { is_expected.to contain_trove_config('database/min_pool_size').with_value('2') }
|
||||
it { is_expected.to contain_trove_config('database/max_retries').with_value('11') }
|
||||
it { is_expected.to contain_trove_config('database/max_pool_size').with_value('21') }
|
||||
it { is_expected.to contain_trove_config('database/max_overflow').with_value('21') }
|
||||
it { is_expected.to contain_trove_config('database/retry_interval').with_value('11') }
|
||||
it { is_expected.to contain_oslo__db('trove_config').with(
|
||||
:connection => 'mysql+pymysql://trove:trove@localhost/trove',
|
||||
:idle_timeout => '3601',
|
||||
:min_pool_size => '2',
|
||||
:max_pool_size => '21',
|
||||
:max_retries => '11',
|
||||
:retry_interval => '11',
|
||||
:max_overflow => '21',
|
||||
)}
|
||||
end
|
||||
|
||||
context 'with MySQL-python library as backend package' do
|
||||
let :params do
|
||||
{ :database_connection => 'mysql://trove:trove@localhost/trove', }
|
||||
{ :database_connection => 'mysql://trove:trove@localhost/trove', }
|
||||
end
|
||||
|
||||
it { is_expected.to contain_package('python-mysqldb').with(:ensure => 'present') }
|
||||
@ -46,7 +49,7 @@ describe 'trove::db' do
|
||||
|
||||
context 'with postgresql backend' do
|
||||
let :params do
|
||||
{ :database_connection => 'postgresql://trove:trove@localhost/trove', }
|
||||
{ :database_connection => 'postgresql://trove:trove@localhost/trove', }
|
||||
end
|
||||
|
||||
it 'install the proper backend package' do
|
||||
@ -57,7 +60,7 @@ describe 'trove::db' do
|
||||
|
||||
context 'with incorrect database_connection string' do
|
||||
let :params do
|
||||
{ :database_connection => 'redis://trove:trove@localhost/trove', }
|
||||
{ :database_connection => 'redis://trove:trove@localhost/trove', }
|
||||
end
|
||||
|
||||
it_raises 'a Puppet::Error', /validate_re/
|
||||
@ -65,7 +68,7 @@ describe 'trove::db' do
|
||||
|
||||
context 'with incorrect pymysql database_connection string' do
|
||||
let :params do
|
||||
{ :database_connection => 'foo+pymysql://trove:trove@localhost/trove', }
|
||||
{ :database_connection => 'foo+pymysql://trove:trove@localhost/trove', }
|
||||
end
|
||||
|
||||
it_raises 'a Puppet::Error', /validate_re/
|
||||
@ -76,7 +79,7 @@ describe 'trove::db' do
|
||||
shared_examples_for 'trove::db on Debian platforms' do
|
||||
context 'using pymysql driver' do
|
||||
let :params do
|
||||
{ :database_connection => 'mysql+pymysql://trove:trove@localhost/trove', }
|
||||
{ :database_connection => 'mysql+pymysql://trove:trove@localhost/trove', }
|
||||
end
|
||||
|
||||
it 'install the proper backend package' do
|
||||
@ -92,7 +95,7 @@ describe 'trove::db' do
|
||||
shared_examples_for 'trove::db on RedHat platforms' do
|
||||
context 'using pymysql driver' do
|
||||
let :params do
|
||||
{ :database_connection => 'mysql+pymysql://trove:trove@localhost/trove', }
|
||||
{ :database_connection => 'mysql+pymysql://trove:trove@localhost/trove', }
|
||||
end
|
||||
|
||||
it { is_expected.not_to contain_package('db_backend_package') }
|
||||
@ -100,7 +103,7 @@ describe 'trove::db' do
|
||||
end
|
||||
|
||||
on_supported_os({
|
||||
:supported_os => OSDefaults.get_supported_os
|
||||
:supported_os => OSDefaults.get_supported_os
|
||||
}).each do |os,facts|
|
||||
context "on #{os}" do
|
||||
let (:facts) do
|
||||
|
Loading…
Reference in New Issue
Block a user