Add support for https endpoint in auth URI

Since the 'scheme' for the identity endpoint is defined as a
node attribute, we can use this value when constructing the auth
URI in the tempest.conf

Closes-Bug: #1650364
Change-Id: Ieaadef347661547cb549870e42e2a0d92c722b8e
This commit is contained in:
Kyle Jorgensen 2016-12-20 14:58:13 -08:00
parent 17ed254138
commit 4a6f46749b
3 changed files with 37 additions and 3 deletions

View File

@ -163,6 +163,7 @@ template '/opt/tempest/etc/tempest.conf' do
'tempest_disable_ssl_validation' => node['openstack']['integration-test']['disable_ssl_validation'],
'identity_endpoint_host' => identity_public_endpoint.host,
'identity_endpoint_port' => identity_public_endpoint.port,
'identity_endpoint_scheme' => identity_public_endpoint.scheme,
'tempest_use_dynamic_credentials' => node['openstack']['integration-test']['use_dynamic_credentials'],
'tempest_user1' => node['openstack']['integration-test']['user1']['user_name'],
'tempest_user1_pass' => node['openstack']['integration-test']['user1']['password'],

View File

@ -198,7 +198,7 @@ describe 'openstack-integration-test::setup' do
expect(chef_run).to run_ruby_block('Create nano flavor 99')
end
describe 'tempest.conf' do
describe 'tempest.conf default' do
let(:file) { chef_run.template('/opt/tempest/etc/tempest.conf') }
it 'creates tempest.conf' do
@ -224,6 +224,39 @@ describe 'openstack-integration-test::setup' do
'image_ref_alt = 5d1ff378-e9c1-4db7-97c1-d35f07824595'
)
end
it 'has a v2 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'
)
end
it 'has a v3 auth URI with the default scheme' do
expect(chef_run).to render_file(file.name).with_content(
'uri_v3 = http://127.0.0.1:5000/v3'
)
end
end
describe 'tempest.conf with HTTPS' do
let(:runner) { ChefSpec::SoloRunner.new(UBUNTU_OPTS) }
let(:chef_run) do
runner.node.normal['openstack']['endpoints']['public']['identity']['scheme'] = 'https'
runner.converge(described_recipe)
end
let(:file) { chef_run.template('/opt/tempest/etc/tempest.conf') }
it 'has a v2 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'
)
end
it 'has a v3 auth URI with the secure scheme' do
expect(chef_run).to render_file(file.name).with_content(
'uri_v3 = https://127.0.0.1:5000/v3'
)
end
end
end
end

View File

@ -13,8 +13,8 @@ catalog_type = identity
disable_ssl_certificate_validation = <%= @tempest_disable_ssl_validation %>
uri = http://<%= @identity_endpoint_host %>:<%= @identity_endpoint_port %>/v2.0/
uri_v3 = http://<%= @identity_endpoint_host %>:<%= @identity_endpoint_port %>/v3/
uri = <%= @identity_endpoint_scheme %>://<%= @identity_endpoint_host %>:<%= @identity_endpoint_port %>/v2.0/
uri_v3 = <%= @identity_endpoint_scheme %>://<%= @identity_endpoint_host %>:<%= @identity_endpoint_port %>/v3/
v3_endpoint_type = publicURL
strategy = keystone