3 describe 'nova::keystone::auth' do
6 {:password => 'nova_password'}
9 context 'with default parameters' do
11 it { should contain_keystone_user('nova').with(
13 :password => 'nova_password'
16 it { should contain_keystone_user_role('nova@services').with(
21 it { should contain_keystone_service('nova').with(
24 :description => 'Openstack Compute Service'
27 it { should contain_keystone_service('novav3').with(
30 :description => 'Openstack Compute Service v3'
33 it { should contain_keystone_service('nova_ec2').with(
36 :description => 'EC2 Service'
39 it { should contain_keystone_endpoint('RegionOne/nova').with(
41 :public_url => 'http://127.0.0.1:8774/v2/%(tenant_id)s',
42 :admin_url => 'http://127.0.0.1:8774/v2/%(tenant_id)s',
43 :internal_url => 'http://127.0.0.1:8774/v2/%(tenant_id)s'
46 it { should contain_keystone_endpoint('RegionOne/novav3').with(
48 :public_url => 'http://127.0.0.1:8774/v3',
49 :admin_url => 'http://127.0.0.1:8774/v3',
50 :internal_url => 'http://127.0.0.1:8774/v3'
53 it { should contain_keystone_endpoint('RegionOne/nova_ec2').with(
55 :public_url => 'http://127.0.0.1:8773/services/Cloud',
56 :admin_url => 'http://127.0.0.1:8773/services/Admin',
57 :internal_url => 'http://127.0.0.1:8773/services/Cloud'
62 context 'when setting auth name' do
64 params.merge!( :auth_name => 'foo' )
67 it { should contain_keystone_user('foo').with(
69 :password => 'nova_password'
72 it { should contain_keystone_user_role('foo@services').with(
77 it { should contain_keystone_service('foo').with(
80 :description => 'Openstack Compute Service'
83 it { should contain_keystone_service('foo_ec2').with(
86 :description => 'EC2 Service'
91 context 'when overriding endpoint params' do
94 :public_address => '10.0.0.1',
95 :admin_address => '10.0.0.2',
96 :internal_address => '10.0.0.3',
97 :compute_port => '9774',
99 :compute_version => 'v2.2',
100 :region => 'RegionTwo',
101 :admin_protocol => 'https',
102 :internal_protocol => 'https',
103 :public_protocol => 'https'
107 it { should contain_keystone_endpoint('RegionTwo/nova').with(
108 :ensure => 'present',
109 :public_url => 'https://10.0.0.1:9774/v2.2/%(tenant_id)s',
110 :admin_url => 'https://10.0.0.2:9774/v2.2/%(tenant_id)s',
111 :internal_url => 'https://10.0.0.3:9774/v2.2/%(tenant_id)s'
114 it { should contain_keystone_endpoint('RegionTwo/nova_ec2').with(
115 :ensure => 'present',
116 :public_url => 'https://10.0.0.1:9773/services/Cloud',
117 :admin_url => 'https://10.0.0.2:9773/services/Admin',
118 :internal_url => 'https://10.0.0.3:9773/services/Cloud'
123 describe 'when disabling endpoint configuration' do
125 params.merge!( :configure_endpoint => false )
128 it { should_not contain_keystone_endpoint('RegionOne/nova') }
131 describe 'when disabling EC2 endpoint' do
133 params.merge!( :configure_ec2_endpoint => false )
136 it { should_not contain_keystone_service('nova_ec2') }
137 it { should_not contain_keystone_endpoint('RegionOne/nova_ec2') }
140 describe 'when disabling user configuration' do
142 params.merge!( :configure_user => false )
145 it { should_not contain_keystone_user('nova') }
147 it { should contain_keystone_user_role('nova@services') }
149 it { should contain_keystone_service('nova').with(
150 :ensure => 'present',
152 :description => 'Openstack Compute Service'
156 describe 'when disabling user and user role configuration' do
159 :configure_user => false,
160 :configure_user_role => false,
161 :password => 'nova_password'
165 it { should_not contain_keystone_user('nova') }
167 it { should_not contain_keystone_user_role('nova@services') }
169 it { should contain_keystone_service('nova').with(
170 :ensure => 'present',
172 :description => 'Openstack Compute Service'
176 describe 'when configuring nova-api and the keystone endpoint' do
177 let :pre_condition do
178 "class { 'nova::api': admin_password => 'test' }
183 { :osfamily => "Debian"}
192 it { should contain_keystone_endpoint('RegionOne/nova').with_notify('Service[nova-api]') }
195 describe 'when overriding service names' do
199 :service_name => 'nova_service',
200 :service_name_v3 => 'nova_service_v3',
201 :password => 'nova_password'
205 it { should contain_keystone_user('nova') }
206 it { should contain_keystone_user_role('nova@services') }
207 it { should contain_keystone_service('nova_service') }
208 it { should contain_keystone_service('nova_service_v3') }
209 it { should contain_keystone_service('nova_service_ec2') }
210 it { should contain_keystone_endpoint('RegionOne/nova_service') }
211 it { should contain_keystone_endpoint('RegionOne/nova_service_v3') }
212 it { should contain_keystone_endpoint('RegionOne/nova_service_ec2') }