2014-09-26 23:03:16 +00:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe 'glance::policy' do
|
|
|
|
|
|
|
|
shared_examples_for 'glance policies' do
|
|
|
|
let :params do
|
|
|
|
{
|
|
|
|
:policy_path => '/etc/glance/policy.json',
|
|
|
|
:policies => {
|
|
|
|
'context_is_admin' => {
|
|
|
|
'key' => 'context_is_admin',
|
|
|
|
'value' => 'foo:bar'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'set up the policies' do
|
2015-02-25 04:37:44 +00:00
|
|
|
is_expected.to contain_openstacklib__policy__base('context_is_admin').with({
|
2014-11-10 19:19:13 +00:00
|
|
|
:key => 'context_is_admin',
|
|
|
|
:value => 'foo:bar'
|
2014-09-26 23:03:16 +00:00
|
|
|
})
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'on Debian platforms' do
|
|
|
|
let :facts do
|
|
|
|
{ :osfamily => 'Debian' }
|
|
|
|
end
|
|
|
|
|
|
|
|
it_configures 'glance policies'
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'on RedHat platforms' do
|
|
|
|
let :facts do
|
|
|
|
{ :osfamily => 'RedHat' }
|
|
|
|
end
|
|
|
|
|
|
|
|
it_configures 'glance policies'
|
|
|
|
end
|
|
|
|
end
|