oslo db: check puppet resource instead of actual config in spec

Change-Id: I4a0a8cb9e4b9e64091ea6a2d09f9e999720735ca
This commit is contained in:
ZhongShengping 2017-04-11 14:31:09 +08:00
parent a105fbaaf6
commit 3705c795af

View File

@ -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,13 +28,15 @@ 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