Files
puppet-cloudkitty/spec/classes/cloudkitty_policy_spec.rb
ZhongShengping 67243efaf7 Add test for policy
Change-Id: I233a9897f7c340a8a47c46dd9743ef62f7728593
2016-10-27 23:23:35 +08:00

38 lines
940 B
Ruby

require 'spec_helper'
describe 'cloudkitty::policy' do
shared_examples_for 'cloudkitty-policies' do
let :params do
{
:policy_path => '/etc/cloudkitty/policy.json',
:policies => {
'context_is_admin' => {
'key' => 'context_is_admin',
'value' => 'foo:bar'
}
}
}
end
it 'set up the policies' do
is_expected.to contain_openstacklib__policy__base('context_is_admin').with({
:key => 'context_is_admin',
:value => 'foo:bar'
})
is_expected.to contain_cloudkitty_config('oslo_policy/policy_file').with_value('/etc/cloudkitty/policy.json')
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 'cloudkitty-policies'
end
end
end