Merge "Simplify identity endpoint"

This commit is contained in:
Zuul 2018-06-28 14:31:52 +00:00 committed by Gerrit Code Review
commit 2727d676ff
3 changed files with 21 additions and 19 deletions

View File

@ -35,9 +35,8 @@ platform_options['tempest_packages'].each do |pkg|
end
end
identity_admin_endpoint = admin_endpoint 'identity'
identity_public_endpoint = public_endpoint 'identity'
auth_url = ::URI.decode identity_admin_endpoint.to_s
identity_endpoint = public_endpoint 'identity'
auth_url = auth_uri_transform identity_endpoint.to_s, node['openstack']['api']['auth']['version']
admin_user = node['openstack']['identity']['admin_user']
admin_pass = get_password 'user', admin_user
@ -133,9 +132,9 @@ ruby_block 'Create nano flavor 99' do
block do
begin
env = openstack_command_env(admin_user, admin_project, 'Default', 'Default')
output = openstack_command('nova', 'flavor-list', env)
output = openstack_command('openstack', 'flavor list', env)
unless output.include? 'm1.nano'
openstack_command('nova', 'flavor-create m1.nano 99 64 0 1', env)
openstack_command('openstack', 'flavor create --id 99 --vcpus 1 --ram 64 --disk 1 m1.nano', env)
end
rescue RuntimeError => e
Chef::Log.error("Could not create flavor m1.nano. Error was #{e.message}")
@ -146,8 +145,8 @@ end
node.default['openstack']['integration-test']['conf'].tap do |conf|
conf['compute']['image_ref'] = node['openstack']['integration-test']['image1']['id']
conf['compute']['image_ref_alt'] = node['openstack']['integration-test']['image2']['id']
conf['identity']['uri'] = "#{identity_public_endpoint.scheme}://#{identity_public_endpoint.host}:#{identity_public_endpoint.port}/v2.0/"
conf['identity']['uri_v3'] = "#{identity_public_endpoint.scheme}://#{identity_public_endpoint.host}:#{identity_public_endpoint.port}/v3/"
conf['identity']['uri'] = "#{identity_endpoint.scheme}://#{identity_endpoint.host}:#{identity_endpoint.port}/v3/"
conf['identity']['uri_v3'] = "#{identity_endpoint.scheme}://#{identity_endpoint.host}:#{identity_endpoint.port}/v3/"
end
node.default['openstack']['integration-test']['conf_secrets'].tap do |conf_secrets|

View File

@ -12,7 +12,7 @@ describe 'openstack-integration-test::setup' do
include_context 'tempest-stubs'
connection_params = {
openstack_auth_url: 'http://127.0.0.1:35357/v3/auth/tokens',
openstack_auth_url: 'http://127.0.0.1:5000/v3/auth/tokens',
openstack_username: 'admin',
openstack_api_key: 'admin',
openstack_project_name: 'admin',
@ -105,7 +105,7 @@ describe 'openstack-integration-test::setup' do
identity_user: 'admin',
identity_pass: 'admin',
identity_tenant: 'admin',
identity_uri: 'http://127.0.0.1:35357/v3',
identity_uri: 'http://127.0.0.1:5000/v3',
identity_user_domain_name: 'default',
identity_project_domain_name: 'default',
image_name: 'cirros-test1',
@ -119,7 +119,7 @@ describe 'openstack-integration-test::setup' do
identity_user: 'admin',
identity_pass: 'admin',
identity_tenant: 'admin',
identity_uri: 'http://127.0.0.1:35357/v3',
identity_uri: 'http://127.0.0.1:5000/v3',
identity_user_domain_name: 'default',
identity_project_domain_name: 'default',
image_name: 'cirros-test2',
@ -151,9 +151,9 @@ describe 'openstack-integration-test::setup' do
)
end
it 'has a v2 auth URI with the default scheme' do
it 'has an auth URI with the default scheme' do
expect(chef_run).to render_file(file.name).with_content(
'uri = http://127.0.0.1:5000/v2.0'
'uri = http://127.0.0.1:5000/v3'
)
end
@ -178,9 +178,9 @@ describe 'openstack-integration-test::setup' do
end
let(:file) { chef_run.template('/opt/tempest/etc/tempest.conf') }
it 'has a v2 auth URI with the secure scheme' do
it 'has an auth URI with the secure scheme' do
expect(chef_run).to render_file(file.name).with_content(
'uri = https://127.0.0.1:5000/v2.0'
'uri = https://127.0.0.1:5000/v3'
)
end

View File

@ -6,16 +6,19 @@ ChefSpec::Coverage.start! { add_filter 'openstack-integration-test' }
require 'chef/application'
LOG_LEVEL = :fatal
RSpec.configure do |config|
config.color = true
config.formatter = :documentation
config.log_level = :fatal
end
REDHAT_OPTS = {
platform: 'redhat',
version: '7.3',
log_level: LOG_LEVEL,
version: '7.4',
}.freeze
UBUNTU_OPTS = {
platform: 'ubuntu',
version: '16.04',
log_level: LOG_LEVEL,
}.freeze
shared_context 'tempest-stubs' do
@ -25,7 +28,7 @@ shared_context 'tempest-stubs' do
'OS_USERNAME' => 'admin',
'OS_PASSWORD' => 'admin',
'OS_PROJECT_NAME' => 'admin',
'OS_AUTH_URL' => 'http://127.0.0.1:35357/v3',
'OS_AUTH_URL' => 'http://127.0.0.1:5000/v3',
'OS_USER_DOMAIN_NAME' => 'default',
'OS_PROJECT_DOMAIN_NAME' => 'default',
'OS_IDENTITY_API_VERSION' => 3,