16091c8dd6
This change replaces current implementation about coordination parameters by oslo::coordination resource type, so that we can gather all logics related to coordination in a single place. Depends-on: https://review.opendev.org/791628 Change-Id: Id1a8ef196afe05d8e484c2a69ec92d6ebed7fbe2
49 lines
1.5 KiB
Ruby
49 lines
1.5 KiB
Ruby
require 'spec_helper'
|
|
|
|
describe 'aodh::coordination' do
|
|
shared_examples 'aodh::coordination' do
|
|
context 'with default parameters' do
|
|
it {
|
|
is_expected.to contain_oslo__coordination('aodh_config').with(
|
|
:backend_url => '<SERVICE DEFAULT>'
|
|
)
|
|
is_expected.to contain_aodh_config('coordination/heartbeat').with_value('<SERVICE DEFAULT>')
|
|
is_expected.to contain_aodh_config('coordination/retry_backoff').with_value('<SERVICE DEFAULT>')
|
|
is_expected.to contain_aodh_config('coordination/max_retry_interval').with_value('<SERVICE DEFAULT>')
|
|
}
|
|
end
|
|
|
|
context 'with specified parameters' do
|
|
let :params do
|
|
{
|
|
:backend_url => 'etcd3+http://127.0.0.1:2379',
|
|
:heartbeat => 1,
|
|
:retry_backoff => 1,
|
|
:max_retry_interval => 30,
|
|
}
|
|
end
|
|
|
|
it {
|
|
is_expected.to contain_oslo__coordination('aodh_config').with(
|
|
:backend_url => 'etcd3+http://127.0.0.1:2379'
|
|
)
|
|
is_expected.to contain_aodh_config('coordination/heartbeat').with_value(1)
|
|
is_expected.to contain_aodh_config('coordination/retry_backoff').with_value(1)
|
|
is_expected.to contain_aodh_config('coordination/max_retry_interval').with_value(30)
|
|
}
|
|
end
|
|
end
|
|
|
|
on_supported_os({
|
|
:supported_os => OSDefaults.get_supported_os
|
|
}).each do |os,facts|
|
|
context "on #{os}" do
|
|
let (:facts) do
|
|
facts.merge(OSDefaults.get_facts())
|
|
end
|
|
|
|
it_behaves_like 'aodh::coordination'
|
|
end
|
|
end
|
|
end
|