Debian Codegraph @

spec/classes/nova_keystone_auth_spec.rb

raw
1 #
2 # Unit tests for nova::keystone::auth
3 #
4
5 require 'spec_helper'
6
7 describe 'nova::keystone::auth' do
8 shared_examples_for 'nova::keystone::auth' do
9 context 'with default class parameters' do
10 let :params do
11 { :password => 'nova_password' }
12 end
13
14 it { is_expected.to contain_keystone__resource__service_identity('nova').with(
15 :configure_user => true,
16 :configure_user_role => true,
17 :configure_endpoint => true,
18 :configure_service => true,
19 :service_name => 'nova',
20 :service_type => 'compute',
21 :service_description => 'OpenStack Compute Service',
22 :region => 'RegionOne',
23 :auth_name => 'nova',
24 :password => 'nova_password',
25 :email => 'nova@localhost',
26 :tenant => 'services',
27 :roles => ['admin', 'service'],
28 :system_scope => 'all',
29 :system_roles => [],
30 :public_url => 'http://127.0.0.1:8774/v2.1',
31 :internal_url => 'http://127.0.0.1:8774/v2.1',
32 :admin_url => 'http://127.0.0.1:8774/v2.1',
33 ) }
34 end
35
36 context 'when overriding parameters' do
37 let :params do
38 { :password => 'nova_password',
39 :auth_name => 'alt_nova',
40 :email => 'alt_nova@alt_localhost',
41 :tenant => 'alt_service',
42 :configure_endpoint => false,
43 :configure_user => false,
44 :configure_user_role => false,
45 :configure_service => false,
46 :service_description => 'Alternative OpenStack Compute Service',
47 :service_name => 'alt_service',
48 :service_type => 'alt_compute',
49 :region => 'RegionTwo',
50 :roles => ['admin'],
51 :system_scope => 'alt_all',
52 :system_roles => ['admin', 'member', 'reader'],
53 :public_url => 'https://10.10.10.10:80',
54 :internal_url => 'http://10.10.10.11:81',
55 :admin_url => 'http://10.10.10.12:81' }
56 end
57
58 it { is_expected.to contain_keystone__resource__service_identity('nova').with(
59 :configure_user => false,
60 :configure_user_role => false,
61 :configure_endpoint => false,
62 :configure_service => false,
63 :service_name => 'alt_service',
64 :service_type => 'alt_compute',
65 :service_description => 'Alternative OpenStack Compute Service',
66 :region => 'RegionTwo',
67 :auth_name => 'alt_nova',
68 :password => 'nova_password',
69 :email => 'alt_nova@alt_localhost',
70 :tenant => 'alt_service',
71 :roles => ['admin'],
72 :system_scope => 'alt_all',
73 :system_roles => ['admin', 'member', 'reader'],
74 :public_url => 'https://10.10.10.10:80',
75 :internal_url => 'http://10.10.10.11:81',
76 :admin_url => 'http://10.10.10.12:81',
77 ) }
78 end
79 end
80
81 on_supported_os({
82 :supported_os => OSDefaults.get_supported_os
83 }).each do |os,facts|
84 context "on #{os}" do
85 let (:facts) do
86 facts.merge!(OSDefaults.get_facts())
87 end
88
89 it_behaves_like 'nova::keystone::auth'
90 end
91 end
92 end