| 1 |
require 'spec_helper' |
| 2 |
|
| 3 |
describe 'cloudkitty::db' do |
| 4 |
|
| 5 |
shared_examples 'cloudkitty::db' do |
| 6 |
context 'with default parameters' do |
| 7 |
it { should contain_class('cloudkitty::deps') } |
| 8 |
|
| 9 |
it { should contain_oslo__db('cloudkitty_config').with( |
| 10 |
:db_max_retries => '<SERVICE DEFAULT>', |
| 11 |
:connection => 'sqlite:////var/lib/cloudkitty/cloudkitty.sqlite', |
| 12 |
:connection_recycle_time => '<SERVICE DEFAULT>', |
| 13 |
:max_pool_size => '<SERVICE DEFAULT>', |
| 14 |
:max_retries => '<SERVICE DEFAULT>', |
| 15 |
:retry_interval => '<SERVICE DEFAULT>', |
| 16 |
:max_overflow => '<SERVICE DEFAULT>', |
| 17 |
:pool_timeout => '<SERVICE DEFAULT>', |
| 18 |
:mysql_enable_ndb => '<SERVICE DEFAULT>', |
| 19 |
)} |
| 20 |
end |
| 21 |
|
| 22 |
context 'with specific parameters' do |
| 23 |
let :params do |
| 24 |
{ |
| 25 |
:database_connection => 'mysql+pymysql://cloudkitty:cloudkitty@localhost/cloudkitty', |
| 26 |
:database_connection_recycle_time => '3601', |
| 27 |
:database_db_max_retries => '-1', |
| 28 |
:database_max_retries => '11', |
| 29 |
:database_retry_interval => '11', |
| 30 |
:database_max_pool_size => '11', |
| 31 |
:database_max_overflow => '21', |
| 32 |
:database_pool_timeout => '21', |
| 33 |
:mysql_enable_ndb => true, |
| 34 |
} |
| 35 |
end |
| 36 |
|
| 37 |
it { should contain_class('cloudkitty::deps') } |
| 38 |
|
| 39 |
it { should contain_oslo__db('cloudkitty_config').with( |
| 40 |
:db_max_retries => '-1', |
| 41 |
:connection => 'mysql+pymysql://cloudkitty:cloudkitty@localhost/cloudkitty', |
| 42 |
:connection_recycle_time => '3601', |
| 43 |
:max_pool_size => '11', |
| 44 |
:max_retries => '11', |
| 45 |
:retry_interval => '11', |
| 46 |
:max_overflow => '21', |
| 47 |
:pool_timeout => '21', |
| 48 |
:mysql_enable_ndb => true, |
| 49 |
)} |
| 50 |
end |
| 51 |
end |
| 52 |
|
| 53 |
on_supported_os({ |
| 54 |
:supported_os => OSDefaults.get_supported_os |
| 55 |
}).each do |os,facts| |
| 56 |
context "on #{os}" do |
| 57 |
let (:facts) do |
| 58 |
facts.merge!(OSDefaults.get_facts()) |
| 59 |
end |
| 60 |
|
| 61 |
it_behaves_like 'cloudkitty::db' |
| 62 |
end |
| 63 |
end |
| 64 |
end |