oslo db: check puppet resource instead of actual config in spec
Change-Id: Iea6c3e4abd5eac70a223ae7d19869bebf6708446
This commit is contained in:
parent
597ed34734
commit
3a3c9102a3
|
@ -4,14 +4,16 @@ describe 'magnum::db' do
|
|||
|
||||
shared_examples 'magnum::db' do
|
||||
context 'with default parameters' do
|
||||
it { is_expected.to contain_magnum_config('database/connection').with_value('mysql://magnum:magnum@localhost:3306/magnum') }
|
||||
it { is_expected.to contain_magnum_config('database/idle_timeout').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_magnum_config('database/min_pool_size').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_magnum_config('database/max_retries').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_magnum_config('database/retry_interval').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_magnum_config('database/max_pool_size').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_magnum_config('database/max_overflow').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_magnum_config('database/db_max_retries').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_oslo__db('magnum_config').with(
|
||||
:db_max_retries => '<SERVICE DEFAULT>',
|
||||
:connection => 'mysql://magnum:magnum@localhost:3306/magnum',
|
||||
: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,19 +29,21 @@ describe 'magnum::db' do
|
|||
}
|
||||
end
|
||||
|
||||
it { is_expected.to contain_magnum_config('database/connection').with_value('mysql://magnum:magnum@localhost/magnum') }
|
||||
it { is_expected.to contain_magnum_config('database/idle_timeout').with_value('3601') }
|
||||
it { is_expected.to contain_magnum_config('database/min_pool_size').with_value('2') }
|
||||
it { is_expected.to contain_magnum_config('database/max_retries').with_value('11') }
|
||||
it { is_expected.to contain_magnum_config('database/retry_interval').with_value('11') }
|
||||
it { is_expected.to contain_magnum_config('database/max_pool_size').with_value('11') }
|
||||
it { is_expected.to contain_magnum_config('database/max_overflow').with_value('21') }
|
||||
it { is_expected.to contain_magnum_config('database/db_max_retries').with_value('-1') }
|
||||
it { is_expected.to contain_oslo__db('magnum_config').with(
|
||||
:db_max_retries => '-1',
|
||||
:connection => 'mysql://magnum:magnum@localhost/magnum',
|
||||
:idle_timeout => '3601',
|
||||
:min_pool_size => '2',
|
||||
:max_pool_size => '11',
|
||||
:max_retries => '11',
|
||||
:retry_interval => '11',
|
||||
:max_overflow => '21',
|
||||
)}
|
||||
end
|
||||
|
||||
context 'with postgresql backend' do
|
||||
let :params do
|
||||
{ :database_connection => 'postgresql://magnum:magnum@localhost/magnum', }
|
||||
{ :database_connection => 'postgresql://magnum:magnum@localhost/magnum', }
|
||||
end
|
||||
|
||||
it 'install the proper backend package' do
|
||||
|
@ -50,7 +54,7 @@ describe 'magnum::db' do
|
|||
|
||||
context 'with incorrect database_connection string' do
|
||||
let :params do
|
||||
{ :database_connection => 'sqlite://magnum:magnum@localhost/magnum', }
|
||||
{ :database_connection => 'sqlite://magnum:magnum@localhost/magnum', }
|
||||
end
|
||||
|
||||
it_raises 'a Puppet::Error', /validate_re/
|
||||
|
|
Loading…
Reference in New Issue