puppet-trove/spec/classes/trove_quota_spec.rb
Xingchao Yu cc138ca445 Add trove::quota class
This patch is aim to add a specific class for managing trove quota
related parameters.

Change-Id: Id84e0ac02809f9adb6e5d3027a10eb1e2063e88f
Closes-Bug: #1469577
2015-06-29 03:11:13 +08:00

40 lines
1.4 KiB
Ruby

require 'spec_helper'
describe 'trove::quota' do
describe 'with default parameters' do
it 'contains default values' do
is_expected.to contain_trove_config('DEFAULT/max_instances_per_user').with(
:value => 5)
is_expected.to contain_trove_config('DEFAULT/max_accepted_volume_size').with(
:value => 5)
is_expected.to contain_trove_config('DEFAULT/max_volumes_per_user').with(
:value => 20)
is_expected.to contain_trove_config('DEFAULT/max_backups_per_user').with(
:value => 50)
is_expected.to contain_trove_config('DEFAULT/quota_driver').with(
:value => 'trove.quota.quota.DbQuotaDriver')
end
end
describe 'with overridden parameters' do
let :params do
{ :max_instances_per_user => 10,
:max_accepted_volume_size => 10,
:max_volumes_per_user => 100,
:max_backups_per_user => 100,
}
end
it 'contains overrided values' do
is_expected.to contain_trove_config('DEFAULT/max_instances_per_user').with(
:value => 10)
is_expected.to contain_trove_config('DEFAULT/max_accepted_volume_size').with(
:value => 10)
is_expected.to contain_trove_config('DEFAULT/max_volumes_per_user').with(
:value => 100)
is_expected.to contain_trove_config('DEFAULT/max_backups_per_user').with(
:value => 100)
end
end
end