puppet-zaqar/spec/classes/zaqar_policy_spec.rb
ZhongShengping 10a0d020d1 oslo policy: check puppet resource instead of actual config in spec
Change-Id: Ic72b612fbee61d05215f2fa2d40e55a17ee72f9a
2017-05-23 15:33:08 +08:00

41 lines
927 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_oslo__policy('zaqar_config').with(
:policy_file => '/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