Files
puppet-octavia/spec/classes/octavia_compute_spec.rb
Takashi Kajinami cf24d758af Add support for [compute] parameters
This change introduces the new octavia::compute class, to manage
parameters in the [compute] section.

Change-Id: I139ed46b7acbb81d9c01c8708f91af9e5d2900a3
2021-11-30 00:37:40 +09:00

46 lines
1.3 KiB
Ruby

require 'spec_helper'
describe 'octavia::compute' do
shared_examples 'octavia::compute' do
context 'with default parameters' do
it {
should contain_octavia_config('compute/max_retries').with_value('<SERVICE DEFAULT>')
should contain_octavia_config('compute/retry_interval').with_value('<SERVICE DEFAULT>')
should contain_octavia_config('compute/retry_backoff').with_value('<SERVICE DEFAULT>')
should contain_octavia_config('compute/retry_max').with_value('<SERVICE DEFAULT>')
}
end
context 'with parameters set' do
let :params do
{
:max_retries => 15,
:retry_interval => 1,
:retry_backoff => 2,
:retry_max => 10,
}
end
it {
should contain_octavia_config('compute/max_retries').with_value(15)
should contain_octavia_config('compute/retry_interval').with_value(1)
should contain_octavia_config('compute/retry_backoff').with_value(2)
should contain_octavia_config('compute/retry_max').with_value(10)
}
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 'octavia::compute'
end
end
end