2015-04-09 14:59:51 +03:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe 'swift::proxy::dlo' do
|
2018-05-17 00:13:44 +02:00
|
|
|
shared_examples 'swift::proxy::dlo' do
|
|
|
|
describe "when using default parameters" do
|
|
|
|
it { is_expected.to contain_swift_proxy_config('filter:dlo/use').with_value('egg:swift#dlo') }
|
2021-12-20 10:17:56 +09:00
|
|
|
it { is_expected.to contain_swift_proxy_config('filter:dlo/rate_limit_after_segment').with_value('<SERVICE DEFAULT>') }
|
|
|
|
it { is_expected.to contain_swift_proxy_config('filter:dlo/rate_limit_segments_per_sec').with_value('<SERVICE DEFAULT>') }
|
|
|
|
it { is_expected.to contain_swift_proxy_config('filter:dlo/max_get_time').with_value('<SERVICE DEFAULT>') }
|
2018-05-17 00:13:44 +02:00
|
|
|
end
|
2015-04-09 14:59:51 +03:00
|
|
|
|
2018-05-17 00:13:44 +02:00
|
|
|
describe "when overriding default parameters" do
|
|
|
|
let :params do
|
|
|
|
{
|
2021-12-20 10:17:56 +09:00
|
|
|
:rate_limit_after_segment => '10',
|
|
|
|
:rate_limit_segments_per_sec => '1',
|
|
|
|
:max_get_time => '86400',
|
2018-05-17 00:13:44 +02:00
|
|
|
}
|
|
|
|
end
|
2015-04-09 14:59:51 +03:00
|
|
|
|
2021-12-20 10:17:56 +09:00
|
|
|
it { is_expected.to contain_swift_proxy_config('filter:dlo/rate_limit_after_segment').with_value('10') }
|
|
|
|
it { is_expected.to contain_swift_proxy_config('filter:dlo/rate_limit_segments_per_sec').with_value('1') }
|
|
|
|
it { is_expected.to contain_swift_proxy_config('filter:dlo/max_get_time').with_value('86400') }
|
2018-05-17 00:13:44 +02:00
|
|
|
end
|
2015-04-09 14:59:51 +03:00
|
|
|
end
|
|
|
|
|
2018-05-17 00:13:44 +02:00
|
|
|
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_configures 'swift::proxy::dlo'
|
2015-04-09 14:59:51 +03:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|