e8be948eb7
This change updates the tests to properly use rspec-puppet-facts and on_supported_os. Change-Id: Ia96c837440b1df3785d9abfd3a3ac8bfdf21c9ab
55 lines
1.7 KiB
Ruby
55 lines
1.7 KiB
Ruby
require 'spec_helper'
|
|
|
|
describe 'trove::quota' do
|
|
|
|
shared_examples_for 'trove::quota' do
|
|
context 'with default parameters' do
|
|
it 'contains default values' do
|
|
is_expected.to contain_trove_config('DEFAULT/max_instances_per_tenant').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_tenant').with(
|
|
:value => 20)
|
|
is_expected.to contain_trove_config('DEFAULT/max_backups_per_tenant').with(
|
|
:value => 50)
|
|
is_expected.to contain_trove_config('DEFAULT/quota_driver').with(
|
|
:value => 'trove.quota.quota.DbQuotaDriver')
|
|
end
|
|
end
|
|
|
|
context 'with overridden parameters' do
|
|
let :params do
|
|
{ :max_instances_per_tenant => 10,
|
|
:max_accepted_volume_size => 10,
|
|
:max_volumes_per_tenant => 100,
|
|
:max_backups_per_tenant => 100,
|
|
}
|
|
end
|
|
it 'contains overrided values' do
|
|
is_expected.to contain_trove_config('DEFAULT/max_instances_per_tenant').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_tenant').with(
|
|
:value => 100)
|
|
is_expected.to contain_trove_config('DEFAULT/max_backups_per_tenant').with(
|
|
:value => 100)
|
|
end
|
|
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_configures 'trove::quota'
|
|
end
|
|
end
|
|
|
|
end
|