puppet-zaqar/spec/classes/zaqar_policy_spec.rb
ZhongShengping ac45966573 Use oslo module for logging and policy configuration
Change-Id: I6a6c3dc4a54ac72ab212b3bd1a82d9f023876650
2016-05-09 08:34:59 +08:00

39 lines
911 B
Ruby

require 'spec_helper'
describe 'zaqar::policy' do
shared_examples_for 'zaqar policies' do
let :params do
{
:policy_path => '/etc/zaqar/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_zaqar_config('oslo_policy/policy_file').with_value('/etc/zaqar/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_configures 'zaqar policies'
end
end
end