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 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_oslo__db('trove_config').with(
it { is_expected.to contain_trove_config('database/idle_timeout').with_value('<SERVICE DEFAULT>') } :connection => 'sqlite:////var/lib/trove/trove.sqlite',
it { is_expected.to contain_trove_config('database/min_pool_size').with_value('<SERVICE DEFAULT>') } :idle_timeout => '<SERVICE DEFAULT>',
it { is_expected.to contain_trove_config('database/max_pool_size').with_value('<SERVICE DEFAULT>') } :min_pool_size => '<SERVICE DEFAULT>',
it { is_expected.to contain_trove_config('database/max_overflow').with_value('<SERVICE DEFAULT>') } :max_pool_size => '<SERVICE DEFAULT>',
it { is_expected.to contain_trove_config('database/max_retries').with_value('<SERVICE DEFAULT>') } :max_retries => '<SERVICE DEFAULT>',
it { is_expected.to contain_trove_config('database/retry_interval').with_value('<SERVICE DEFAULT>') } :retry_interval => '<SERVICE DEFAULT>',
:max_overflow => '<SERVICE DEFAULT>',
)}
end end
context 'with specific parameters' do context 'with specific parameters' do
@ -27,13 +28,15 @@ describe 'trove::db' do
:database_retry_interval => '11', } :database_retry_interval => '11', }
end 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_oslo__db('trove_config').with(
it { is_expected.to contain_trove_config('database/idle_timeout').with_value('3601') } :connection => 'mysql+pymysql://trove:trove@localhost/trove',
it { is_expected.to contain_trove_config('database/min_pool_size').with_value('2') } :idle_timeout => '3601',
it { is_expected.to contain_trove_config('database/max_retries').with_value('11') } :min_pool_size => '2',
it { is_expected.to contain_trove_config('database/max_pool_size').with_value('21') } :max_pool_size => '21',
it { is_expected.to contain_trove_config('database/max_overflow').with_value('21') } :max_retries => '11',
it { is_expected.to contain_trove_config('database/retry_interval').with_value('11') } :retry_interval => '11',
:max_overflow => '21',
)}
end end
context 'with MySQL-python library as backend package' do context 'with MySQL-python library as backend package' do