Merge "Do not hard-code defaults of [filter:dlo] parameters"
This commit is contained in:
commit
91176e13d2
|
@ -8,17 +8,18 @@
|
|||
# == Parameters
|
||||
#
|
||||
# [*rate_limit_after_segment*]
|
||||
# Start rate-limiting DLO segment serving after the Nth segment of a segmented object.
|
||||
# Default to 10.
|
||||
# (Optional) Start rate-limiting DLO segment serving after the Nth segment of
|
||||
# a segmented object.
|
||||
# Defaults to $::os_service_default.
|
||||
#
|
||||
# [*rate_limit_segments_per_sec*]
|
||||
# Once segment rate-limiting kicks in for an object, limit segments served to N per second.
|
||||
# 0 means no rate-limiting.
|
||||
# Default to 1.
|
||||
# (Optional) Once segment rate-limiting kicks in for an object, limit segments
|
||||
# served to N per second. 0 means no rate-limiting.
|
||||
# Defaults to $::os_service_default.
|
||||
#
|
||||
# [*max_get_time*]
|
||||
# Time limit on GET requests (seconds).
|
||||
# Default to 86400.
|
||||
# (Optional) Time limit on GET requests (seconds).
|
||||
# Defaults to $::os_service_default.
|
||||
#
|
||||
# == Authors
|
||||
#
|
||||
|
@ -29,9 +30,9 @@
|
|||
# Copyright 2015 Mirantis Inc, unless otherwise noted.
|
||||
#
|
||||
class swift::proxy::dlo (
|
||||
$rate_limit_after_segment = '10',
|
||||
$rate_limit_segments_per_sec = '1',
|
||||
$max_get_time = '86400'
|
||||
$rate_limit_after_segment = $::os_service_default,
|
||||
$rate_limit_segments_per_sec = $::os_service_default,
|
||||
$max_get_time = $::os_service_default,
|
||||
) {
|
||||
|
||||
include swift::deps
|
||||
|
|
|
@ -4,23 +4,23 @@ describe 'swift::proxy::dlo' do
|
|||
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') }
|
||||
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') }
|
||||
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>') }
|
||||
end
|
||||
|
||||
describe "when overriding default parameters" do
|
||||
let :params do
|
||||
{
|
||||
:rate_limit_after_segment => '30',
|
||||
:rate_limit_segments_per_sec => '5',
|
||||
:max_get_time => '6400',
|
||||
:rate_limit_after_segment => '10',
|
||||
:rate_limit_segments_per_sec => '1',
|
||||
:max_get_time => '86400',
|
||||
}
|
||||
end
|
||||
|
||||
it { is_expected.to contain_swift_proxy_config('filter:dlo/rate_limit_after_segment').with_value('30') }
|
||||
it { is_expected.to contain_swift_proxy_config('filter:dlo/rate_limit_segments_per_sec').with_value('5') }
|
||||
it { is_expected.to contain_swift_proxy_config('filter:dlo/max_get_time').with_value('6400') }
|
||||
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') }
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue