]> git.donarmstrong.com Git - dsa-puppet.git/blob - 3rdparty/modules/keystone/spec/classes/keystone_endpoint_spec.rb
61b596abd44f7cb7dfcf6f88fe185a19b3364eb0
[dsa-puppet.git] / 3rdparty / modules / keystone / spec / classes / keystone_endpoint_spec.rb
1 require 'spec_helper'
2
3 describe 'keystone::endpoint' do
4
5   it { should contain_keystone_service('keystone').with(
6     :ensure      => 'present',
7     :type        => 'identity',
8     :description => 'OpenStack Identity Service'
9   )}
10
11   describe 'with default parameters' do
12     it { should contain_keystone_endpoint('RegionOne/keystone').with(
13       :ensure       => 'present',
14       :public_url   => 'http://127.0.0.1:5000/v2.0',
15       :admin_url    => 'http://127.0.0.1:35357/v2.0',
16       :internal_url => 'http://127.0.0.1:5000/v2.0'
17     )}
18   end
19
20   describe 'with overridden parameters' do
21
22     let :params do
23       { :version      => 'v42.6',
24         :public_url   => 'https://identity.some.tld/the/main/endpoint',
25         :admin_url    => 'https://identity-int.some.tld/some/admin/endpoint',
26         :internal_url => 'https://identity-int.some.tld/some/internal/endpoint' }
27     end
28
29     it { should contain_keystone_endpoint('RegionOne/keystone').with(
30       :ensure       => 'present',
31       :public_url   => 'https://identity.some.tld/the/main/endpoint/v42.6',
32       :admin_url    => 'https://identity-int.some.tld/some/admin/endpoint/v42.6',
33       :internal_url => 'https://identity-int.some.tld/some/internal/endpoint/v42.6'
34     )}
35   end
36
37   describe 'without internal_url parameter' do
38
39     let :params do
40       { :public_url => 'https://identity.some.tld/the/main/endpoint' }
41     end
42
43     it 'internal_url should default to public_url' do
44       should contain_keystone_endpoint('RegionOne/keystone').with(
45         :ensure       => 'present',
46         :public_url   => 'https://identity.some.tld/the/main/endpoint/v2.0',
47         :internal_url => 'https://identity.some.tld/the/main/endpoint/v2.0'
48       )
49     end
50   end
51
52   describe 'with deprecated parameters' do
53
54     let :params do
55       { :public_address   => '10.0.0.1',
56         :admin_address    => '10.0.0.2',
57         :internal_address => '10.0.0.3',
58         :public_port      => '23456',
59         :admin_port       => '12345',
60         :region           => 'RegionTwo',
61         :version          => 'v3.0' }
62     end
63
64     it { should contain_keystone_endpoint('RegionTwo/keystone').with(
65       :ensure       => 'present',
66       :public_url   => 'http://10.0.0.1:23456/v3.0',
67       :admin_url    => 'http://10.0.0.2:12345/v3.0',
68       :internal_url => 'http://10.0.0.3:23456/v3.0'
69     )}
70
71     describe 'public_address overrides public_url' do
72       let :params do
73         { :public_address => '10.0.0.1',
74           :public_port    => '12345',
75           :public_url     => 'http://10.10.10.10:23456/v3.0' }
76       end
77
78       it { should contain_keystone_endpoint('RegionOne/keystone').with(
79         :ensure     => 'present',
80         :public_url => 'http://10.0.0.1:12345/v2.0'
81       )}
82     end
83   end
84
85   describe 'with overridden deprecated internal_port' do
86
87     let :params do
88       { :internal_port => '12345' }
89     end
90
91     it { should contain_keystone_endpoint('RegionOne/keystone').with(
92       :ensure       => 'present',
93       :public_url   => 'http://127.0.0.1:5000/v2.0',
94       :admin_url    => 'http://127.0.0.1:35357/v2.0',
95       :internal_url => 'http://127.0.0.1:12345/v2.0'
96     )}
97   end
98
99 end