puppet-octavia/spec/classes/octavia_roles_spec.rb
Brent Eagles d6c8f91f63 Add keystone roles for Octavia policies
This patch adds creation of the necessary keystone roles to support
using Octavia's access policies.

Related-Bug: #1762774
Change-Id: Ib34ad49d52bb6afba6d035cf966592e0f0fd9a85
2018-04-11 14:18:29 -02:30

51 lines
1.3 KiB
Ruby

require 'spec_helper'
describe 'octavia::roles' do
let :params do
{
}
end
shared_examples_for 'octavia-roles' do
context 'when using default args' do
it 'creates keystone roles' do
is_expected.to contain_keystone_role('load-balancer_observer')
is_expected.to contain_keystone_role('load-balancer_global_observer')
is_expected.to contain_keystone_role('load-balancer_member')
is_expected.to contain_keystone_role('load-balancer_quota_admin')
is_expected.to contain_keystone_role('load-balancer_admin')
is_expected.to contain_keystone_role('admin')
end
end
context 'when using custom roles' do
before do
params.merge!({
:role_names => ['foo', 'bar', 'krispy']
})
end
it 'creates custom keystone roles' do
is_expected.to contain_keystone_role('foo')
is_expected.to contain_keystone_role('bar')
is_expected.to contain_keystone_role('krispy')
is_expected.not_to contain_keystone_role('load-balancer_observer')
end
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_behaves_like 'octavia-roles'
end
end
end