puppet-neutron/spec/classes/neutron_policy_spec.rb
Sergey Kolekonov 69e809bcca Move Neutron to $::os_service_default - part 1
This change updates the values that are currently undefined to use
$::os_service_default fact.

Change-Id: Id0b1a696d4f151a776cd27acefb825f63fb0e162
2015-11-26 17:39:06 +03:00

53 lines
1.1 KiB
Ruby

require 'spec_helper'
describe 'neutron::policy' do
let :test_facts do
{ :operatingsystem => 'default',
:operatingsystemrelease => 'default'
}
end
shared_examples_for 'neutron policies' do
let :params do
{
:policy_path => '/etc/neutron/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'
})
end
end
context 'on Debian platforms' do
let :facts do
@default_facts.merge(test_facts.merge({
:osfamily => 'Debian'
}))
end
it_configures 'neutron policies'
end
context 'on RedHat platforms' do
let :facts do
@default_facts.merge(test_facts.merge({
:osfamily => 'RedHat',
:operatingsystemrelease => '7'
}))
end
it_configures 'neutron policies'
end
end