diff --git a/spec/classes/glance_api_db_spec.rb b/spec/classes/glance_api_db_spec.rb index d8ea2ad7..977f25e9 100644 --- a/spec/classes/glance_api_db_spec.rb +++ b/spec/classes/glance_api_db_spec.rb @@ -4,13 +4,15 @@ describe 'glance::api::db' do shared_examples 'glance::api::db' do context 'with default parameters' do - it { is_expected.to contain_glance_api_config('database/connection').with_value('sqlite:///var/lib/glance/glance.sqlite').with_secret(true) } - it { is_expected.to contain_glance_api_config('database/idle_timeout').with_value('') } - it { is_expected.to contain_glance_api_config('database/min_pool_size').with_value('') } - it { is_expected.to contain_glance_api_config('database/max_retries').with_value('') } - it { is_expected.to contain_glance_api_config('database/retry_interval').with_value('') } - it { is_expected.to contain_glance_api_config('database/max_pool_size').with_value('') } - it { is_expected.to contain_glance_api_config('database/max_overflow').with_value('') } + it { is_expected.to contain_oslo__db('glance_api_config').with( + :connection => 'sqlite:///var/lib/glance/glance.sqlite', + :idle_timeout => '', + :min_pool_size => '', + :max_pool_size => '', + :max_retries => '', + :retry_interval => '', + :max_overflow => '', + )} end context 'with specific parameters' do @@ -25,13 +27,15 @@ describe 'glance::api::db' do } end - it { is_expected.to contain_glance_api_config('database/connection').with_value('mysql+pymysql://glance_api:glance@localhost/glance').with_secret(true) } - it { is_expected.to contain_glance_api_config('database/idle_timeout').with_value('3601') } - it { is_expected.to contain_glance_api_config('database/min_pool_size').with_value('2') } - it { is_expected.to contain_glance_api_config('database/max_retries').with_value('11') } - it { is_expected.to contain_glance_api_config('database/retry_interval').with_value('11') } - it { is_expected.to contain_glance_api_config('database/max_pool_size').with_value('11') } - it { is_expected.to contain_glance_api_config('database/max_overflow').with_value('21') } + it { is_expected.to contain_oslo__db('glance_api_config').with( + :connection => 'mysql+pymysql://glance_api:glance@localhost/glance', + :idle_timeout => '3601', + :min_pool_size => '2', + :max_pool_size => '11', + :max_retries => '11', + :retry_interval => '11', + :max_overflow => '21', + )} end context 'with MySQL-python library as backend package' do diff --git a/spec/classes/glance_registry_db_spec.rb b/spec/classes/glance_registry_db_spec.rb index 6a7b3039..01a91ba7 100644 --- a/spec/classes/glance_registry_db_spec.rb +++ b/spec/classes/glance_registry_db_spec.rb @@ -4,14 +4,16 @@ describe 'glance::registry::db' do shared_examples 'glance::registry::db' do context 'with default parameters' do - it { is_expected.to contain_glance_registry_config('database/db_max_retries').with_value('') } - it { is_expected.to contain_glance_registry_config('database/connection').with_value('sqlite:///var/lib/glance/glance.sqlite').with_secret(true) } - it { is_expected.to contain_glance_registry_config('database/idle_timeout').with_value('') } - it { is_expected.to contain_glance_registry_config('database/min_pool_size').with_value('') } - it { is_expected.to contain_glance_registry_config('database/max_retries').with_value('') } - it { is_expected.to contain_glance_registry_config('database/retry_interval').with_value('') } - it { is_expected.to contain_glance_registry_config('database/max_pool_size').with_value('') } - it { is_expected.to contain_glance_registry_config('database/max_overflow').with_value('') } + it { is_expected.to contain_oslo__db('glance_registry_config').with( + :db_max_retries => '', + :connection => 'sqlite:///var/lib/glance/glance.sqlite', + :idle_timeout => '', + :min_pool_size => '', + :max_pool_size => '', + :max_retries => '', + :retry_interval => '', + :max_overflow => '', + )} end context 'with specific parameters' do @@ -27,14 +29,16 @@ describe 'glance::registry::db' do } end - it { is_expected.to contain_glance_registry_config('database/db_max_retries').with_value('-1') } - it { is_expected.to contain_glance_registry_config('database/connection').with_value('mysql+pymysql://glance_registry:glance@localhost/glance').with_secret(true) } - it { is_expected.to contain_glance_registry_config('database/idle_timeout').with_value('3601') } - it { is_expected.to contain_glance_registry_config('database/min_pool_size').with_value('2') } - it { is_expected.to contain_glance_registry_config('database/max_retries').with_value('11') } - it { is_expected.to contain_glance_registry_config('database/retry_interval').with_value('11') } - it { is_expected.to contain_glance_registry_config('database/max_pool_size').with_value('11') } - it { is_expected.to contain_glance_registry_config('database/max_overflow').with_value('21') } + it { is_expected.to contain_oslo__db('glance_registry_config').with( + :db_max_retries => '-1', + :connection => 'mysql+pymysql://glance_registry:glance@localhost/glance', + :idle_timeout => '3601', + :min_pool_size => '2', + :max_pool_size => '11', + :max_retries => '11', + :retry_interval => '11', + :max_overflow => '21', + )} end context 'with MySQL-python library as backend package' do