2015-11-05 16:07:28 +00:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe 'magnum::policy' do
|
|
|
|
|
|
|
|
shared_examples_for 'magnum policies' do
|
|
|
|
let :params do
|
|
|
|
{
|
|
|
|
:policy_path => '/etc/magnum/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({
|
2018-01-10 14:09:35 -08:00
|
|
|
:key => 'context_is_admin',
|
|
|
|
:value => 'foo:bar',
|
|
|
|
:file_user => 'root',
|
|
|
|
:file_group => 'magnum',
|
2015-11-05 16:07:28 +00:00
|
|
|
})
|
2017-05-23 15:13:43 +08:00
|
|
|
is_expected.to contain_oslo__policy('magnum_config').with(
|
|
|
|
:policy_file => '/etc/magnum/policy.json',
|
|
|
|
)
|
2015-11-05 16:07:28 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2016-04-22 14:15:11 -07:00
|
|
|
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
|
2015-11-05 16:07:28 +00:00
|
|
|
|
2018-01-10 14:09:35 -08:00
|
|
|
it_configures 'magnum policies'
|
2015-11-05 16:07:28 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|