summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Cassiba <s@cassiba.com>2018-06-12 22:15:12 -0700
committerSamuel Cassiba <s@cassiba.com>2018-06-14 19:14:30 -0700
commit9b67abe1d8f8fe368e5089d9ab083f48d20578a1 (patch)
tree13119e6445251e6f4cfeb617db7caa777a37ea7c
parent3e33e9985b202f47852a663788277fabf6f991f9 (diff)
Simplify identity endpoint
Per the Keystone Install Guide[1] the admin endpoint is superseded in favor of a single public endpoint. As a result, the admin endpoint is no longer deployed by default. [1] https://docs.openstack.org/keystone/queens/install/keystone-install-ubuntu.html#install-and-configure-components Change-Id: I06d0f98e641a041ddc864f524858edc0cffbbbba Implements: blueprint simplify-identity-endpoint
Notes
Notes (review): Code-Review+2: Jan Klare <j.klare@cloudbau.de> Workflow+1: Christoph Albers <c.albers@x-ion.de> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Thu, 28 Jun 2018 14:31:52 +0000 Reviewed-on: https://review.openstack.org/574983 Project: openstack/cookbook-openstack-integration-test Branch: refs/heads/master
-rw-r--r--recipes/setup.rb13
-rw-r--r--spec/setup_spec.rb14
-rw-r--r--spec/spec_helper.rb13
3 files changed, 21 insertions, 19 deletions
diff --git a/recipes/setup.rb b/recipes/setup.rb
index eb10608..39592f3 100644
--- a/recipes/setup.rb
+++ b/recipes/setup.rb
@@ -35,9 +35,8 @@ platform_options['tempest_packages'].each do |pkg|
35 end 35 end
36end 36end
37 37
38identity_admin_endpoint = admin_endpoint 'identity' 38identity_endpoint = public_endpoint 'identity'
39identity_public_endpoint = public_endpoint 'identity' 39auth_url = auth_uri_transform identity_endpoint.to_s, node['openstack']['api']['auth']['version']
40auth_url = ::URI.decode identity_admin_endpoint.to_s
41 40
42admin_user = node['openstack']['identity']['admin_user'] 41admin_user = node['openstack']['identity']['admin_user']
43admin_pass = get_password 'user', admin_user 42admin_pass = get_password 'user', admin_user
@@ -133,9 +132,9 @@ ruby_block 'Create nano flavor 99' do
133 block do 132 block do
134 begin 133 begin
135 env = openstack_command_env(admin_user, admin_project, 'Default', 'Default') 134 env = openstack_command_env(admin_user, admin_project, 'Default', 'Default')
136 output = openstack_command('nova', 'flavor-list', env) 135 output = openstack_command('openstack', 'flavor list', env)
137 unless output.include? 'm1.nano' 136 unless output.include? 'm1.nano'
138 openstack_command('nova', 'flavor-create m1.nano 99 64 0 1', env) 137 openstack_command('openstack', 'flavor create --id 99 --vcpus 1 --ram 64 --disk 1 m1.nano', env)
139 end 138 end
140 rescue RuntimeError => e 139 rescue RuntimeError => e
141 Chef::Log.error("Could not create flavor m1.nano. Error was #{e.message}") 140 Chef::Log.error("Could not create flavor m1.nano. Error was #{e.message}")
@@ -146,8 +145,8 @@ end
146node.default['openstack']['integration-test']['conf'].tap do |conf| 145node.default['openstack']['integration-test']['conf'].tap do |conf|
147 conf['compute']['image_ref'] = node['openstack']['integration-test']['image1']['id'] 146 conf['compute']['image_ref'] = node['openstack']['integration-test']['image1']['id']
148 conf['compute']['image_ref_alt'] = node['openstack']['integration-test']['image2']['id'] 147 conf['compute']['image_ref_alt'] = node['openstack']['integration-test']['image2']['id']
149 conf['identity']['uri'] = "#{identity_public_endpoint.scheme}://#{identity_public_endpoint.host}:#{identity_public_endpoint.port}/v2.0/" 148 conf['identity']['uri'] = "#{identity_endpoint.scheme}://#{identity_endpoint.host}:#{identity_endpoint.port}/v3/"
150 conf['identity']['uri_v3'] = "#{identity_public_endpoint.scheme}://#{identity_public_endpoint.host}:#{identity_public_endpoint.port}/v3/" 149 conf['identity']['uri_v3'] = "#{identity_endpoint.scheme}://#{identity_endpoint.host}:#{identity_endpoint.port}/v3/"
151end 150end
152 151
153node.default['openstack']['integration-test']['conf_secrets'].tap do |conf_secrets| 152node.default['openstack']['integration-test']['conf_secrets'].tap do |conf_secrets|
diff --git a/spec/setup_spec.rb b/spec/setup_spec.rb
index ec4d700..06636bb 100644
--- a/spec/setup_spec.rb
+++ b/spec/setup_spec.rb
@@ -12,7 +12,7 @@ describe 'openstack-integration-test::setup' do
12 include_context 'tempest-stubs' 12 include_context 'tempest-stubs'
13 13
14 connection_params = { 14 connection_params = {
15 openstack_auth_url: 'http://127.0.0.1:35357/v3/auth/tokens', 15 openstack_auth_url: 'http://127.0.0.1:5000/v3/auth/tokens',
16 openstack_username: 'admin', 16 openstack_username: 'admin',
17 openstack_api_key: 'admin', 17 openstack_api_key: 'admin',
18 openstack_project_name: 'admin', 18 openstack_project_name: 'admin',
@@ -105,7 +105,7 @@ describe 'openstack-integration-test::setup' do
105 identity_user: 'admin', 105 identity_user: 'admin',
106 identity_pass: 'admin', 106 identity_pass: 'admin',
107 identity_tenant: 'admin', 107 identity_tenant: 'admin',
108 identity_uri: 'http://127.0.0.1:35357/v3', 108 identity_uri: 'http://127.0.0.1:5000/v3',
109 identity_user_domain_name: 'default', 109 identity_user_domain_name: 'default',
110 identity_project_domain_name: 'default', 110 identity_project_domain_name: 'default',
111 image_name: 'cirros-test1', 111 image_name: 'cirros-test1',
@@ -119,7 +119,7 @@ describe 'openstack-integration-test::setup' do
119 identity_user: 'admin', 119 identity_user: 'admin',
120 identity_pass: 'admin', 120 identity_pass: 'admin',
121 identity_tenant: 'admin', 121 identity_tenant: 'admin',
122 identity_uri: 'http://127.0.0.1:35357/v3', 122 identity_uri: 'http://127.0.0.1:5000/v3',
123 identity_user_domain_name: 'default', 123 identity_user_domain_name: 'default',
124 identity_project_domain_name: 'default', 124 identity_project_domain_name: 'default',
125 image_name: 'cirros-test2', 125 image_name: 'cirros-test2',
@@ -151,9 +151,9 @@ describe 'openstack-integration-test::setup' do
151 ) 151 )
152 end 152 end
153 153
154 it 'has a v2 auth URI with the default scheme' do 154 it 'has an auth URI with the default scheme' do
155 expect(chef_run).to render_file(file.name).with_content( 155 expect(chef_run).to render_file(file.name).with_content(
156 'uri = http://127.0.0.1:5000/v2.0' 156 'uri = http://127.0.0.1:5000/v3'
157 ) 157 )
158 end 158 end
159 159
@@ -178,9 +178,9 @@ describe 'openstack-integration-test::setup' do
178 end 178 end
179 let(:file) { chef_run.template('/opt/tempest/etc/tempest.conf') } 179 let(:file) { chef_run.template('/opt/tempest/etc/tempest.conf') }
180 180
181 it 'has a v2 auth URI with the secure scheme' do 181 it 'has an auth URI with the secure scheme' do
182 expect(chef_run).to render_file(file.name).with_content( 182 expect(chef_run).to render_file(file.name).with_content(
183 'uri = https://127.0.0.1:5000/v2.0' 183 'uri = https://127.0.0.1:5000/v3'
184 ) 184 )
185 end 185 end
186 186
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index a2e289e..719dc90 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -6,16 +6,19 @@ ChefSpec::Coverage.start! { add_filter 'openstack-integration-test' }
6 6
7require 'chef/application' 7require 'chef/application'
8 8
9LOG_LEVEL = :fatal 9RSpec.configure do |config|
10 config.color = true
11 config.formatter = :documentation
12 config.log_level = :fatal
13end
14
10REDHAT_OPTS = { 15REDHAT_OPTS = {
11 platform: 'redhat', 16 platform: 'redhat',
12 version: '7.3', 17 version: '7.4',
13 log_level: LOG_LEVEL,
14}.freeze 18}.freeze
15UBUNTU_OPTS = { 19UBUNTU_OPTS = {
16 platform: 'ubuntu', 20 platform: 'ubuntu',
17 version: '16.04', 21 version: '16.04',
18 log_level: LOG_LEVEL,
19}.freeze 22}.freeze
20 23
21shared_context 'tempest-stubs' do 24shared_context 'tempest-stubs' do
@@ -25,7 +28,7 @@ shared_context 'tempest-stubs' do
25 'OS_USERNAME' => 'admin', 28 'OS_USERNAME' => 'admin',
26 'OS_PASSWORD' => 'admin', 29 'OS_PASSWORD' => 'admin',
27 'OS_PROJECT_NAME' => 'admin', 30 'OS_PROJECT_NAME' => 'admin',
28 'OS_AUTH_URL' => 'http://127.0.0.1:35357/v3', 31 'OS_AUTH_URL' => 'http://127.0.0.1:5000/v3',
29 'OS_USER_DOMAIN_NAME' => 'default', 32 'OS_USER_DOMAIN_NAME' => 'default',
30 'OS_PROJECT_DOMAIN_NAME' => 'default', 33 'OS_PROJECT_DOMAIN_NAME' => 'default',
31 'OS_IDENTITY_API_VERSION' => 3, 34 'OS_IDENTITY_API_VERSION' => 3,