| 1 |
require 'spec_helper' |
| 2 |
|
| 3 |
describe 'cloudkitty::orchestrator' do |
| 4 |
|
| 5 |
shared_examples_for 'cloudkitty::orchestrator' do |
| 6 |
|
| 7 |
context 'with defaults' do |
| 8 |
it { is_expected.to contain_class('cloudkitty::deps') } |
| 9 |
|
| 10 |
it 'configures orchestrator' do |
| 11 |
is_expected.to contain_cloudkitty_config('orchestrator/coordination_url')\ |
| 12 |
.with_value('<SERVICE DEFAULT>').with_secret(true) |
| 13 |
is_expected.to contain_oslo__coordination('cloudkitty_config').with( |
| 14 |
:backend_url => '<SERVICE DEFAULT>', |
| 15 |
:manage_backend_package => true, |
| 16 |
:package_ensure => 'present', |
| 17 |
:manage_config => false, |
| 18 |
) |
| 19 |
is_expected.to contain_cloudkitty_config('orchestrator/max_workers').with_value(4) |
| 20 |
is_expected.to contain_cloudkitty_config('orchestrator/max_workers_reprocessing').with_value(4) |
| 21 |
is_expected.to contain_cloudkitty_config('orchestrator/max_threads').with_value('<SERVICE DEFAULT>') |
| 22 |
end |
| 23 |
end |
| 24 |
|
| 25 |
context 'with parameters set' do |
| 26 |
let :params do |
| 27 |
{ |
| 28 |
:coordination_url => 'etcd3+http://127.0.0.1:2379', |
| 29 |
:max_workers => 4, |
| 30 |
:max_workers_reprocessing => 5, |
| 31 |
:max_threads => 16, |
| 32 |
:manage_backend_package => false, |
| 33 |
:backend_package_ensure => 'latest', |
| 34 |
} |
| 35 |
end |
| 36 |
|
| 37 |
it 'configures orchestrator' do |
| 38 |
is_expected.to contain_cloudkitty_config('orchestrator/coordination_url')\ |
| 39 |
.with_value('etcd3+http://127.0.0.1:2379').with_secret(true) |
| 40 |
is_expected.to contain_oslo__coordination('cloudkitty_config').with( |
| 41 |
:backend_url => 'etcd3+http://127.0.0.1:2379', |
| 42 |
:manage_backend_package => false, |
| 43 |
:package_ensure => 'latest', |
| 44 |
:manage_config => false, |
| 45 |
) |
| 46 |
is_expected.to contain_cloudkitty_config('orchestrator/max_workers').with_value(4) |
| 47 |
is_expected.to contain_cloudkitty_config('orchestrator/max_workers_reprocessing').with_value(5) |
| 48 |
is_expected.to contain_cloudkitty_config('orchestrator/max_threads').with_value(16) |
| 49 |
end |
| 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 |
:os_workers => 4, |
| 60 |
)) |
| 61 |
end |
| 62 |
|
| 63 |
it_configures 'cloudkitty::orchestrator' |
| 64 |
end |
| 65 |
end |
| 66 |
|
| 67 |
end |