Add endpoint_type config option
Prior to their removal from the tempest repository, the heat tests
supported an endpoint_type option[1] to configure which endpoint
interface to use in its requests to the Orchestration service and other
OpenStack services. This patch adds back this support so that users can
configure the heat tests to run against non-public interfaces.
[1] http://git.openstack.org/cgit/openstack/tempest/tree/tempest/config.py?h=17.2.0#n943
Change-Id: Id86f90e428136198b4244f12da5eb53f673fd788
diff --git a/heat_tempest_plugin/services/clients.py b/heat_tempest_plugin/services/clients.py
index ca79374..4567968 100644
--- a/heat_tempest_plugin/services/clients.py
+++ b/heat_tempest_plugin/services/clients.py
@@ -47,10 +47,12 @@
def project_id(self):
return self.auth_plugin.get_project_id(self.session)
- def get_endpoint_url(self, service_type, region=None):
+ def get_endpoint_url(self, service_type, region=None,
+ endpoint_type='public'):
kwargs = {
'service_type': service_type,
- 'region_name': region}
+ 'region_name': region,
+ 'interface': endpoint_type}
return self.auth_ref.service_catalog.url_for(**kwargs)
@@ -108,7 +110,8 @@
try:
if endpoint is None:
endpoint = self.identity_client.get_endpoint_url(
- 'orchestration', self.conf.region)
+ 'orchestration', region=self.conf.region,
+ endpoint_type=self.conf.endpoint_type)
except kc_exceptions.EndpointNotFound:
return None
else:
@@ -151,7 +154,7 @@
self.NOVA_API_VERSION,
session=self.identity_client.session,
service_type='compute',
- endpoint_type='publicURL',
+ endpoint_type=self.conf.endpoint_type,
region_name=self.conf.region,
os_cache=False,
http_log_debug=True)
@@ -162,13 +165,13 @@
session=self.identity_client.session,
service_type='network',
region_name=self.conf.region,
- endpoint_type='publicURL')
+ endpoint_type=self.conf.endpoint_type)
def _get_volume_client(self):
return cinder_client.Client(
self.CINDERCLIENT_VERSION,
session=self.identity_client.session,
- endpoint_type='publicURL',
+ endpoint_type=self.conf.endpoint_type,
region_name=self.conf.region,
http_log_debug=True)
@@ -176,7 +179,7 @@
args = {
'auth_version': self.auth_version,
'session': self.identity_client.session,
- 'os_options': {'endpoint_type': 'publicURL',
+ 'os_options': {'endpoint_type': self.conf.endpoint_type,
'region_name': self.conf.region,
'service_type': 'object-store'},
}
@@ -184,7 +187,7 @@
def _get_metric_client(self):
- adapter_options = {'interface': 'public',
+ adapter_options = {'interface': self.conf.endpoint_type,
'region_name': self.conf.region}
args = {
'session': self.identity_client.session,