Merge "Fix multi_vim tempest test failure"
This commit is contained in:
commit
21164c9581
@ -14,6 +14,7 @@
|
||||
import base64
|
||||
from urlparse import urlparse
|
||||
|
||||
from keystoneclient import service_catalog as ks_service_catalog
|
||||
from oslo_serialization import jsonutils
|
||||
from oslo_utils import uuidutils
|
||||
from tempest.lib import decorators
|
||||
@ -66,18 +67,35 @@ class MultiVimActionsTests(base.TestCase):
|
||||
# List stacks with client1, but with the target headers of client2,
|
||||
# and additionally with an invalid X-Target-Service-Catalog.
|
||||
extra_headers = _extract_target_headers_from_client(client_2)
|
||||
service_dict = dict(client_2.auth_provider.cache[1])
|
||||
|
||||
for endpoint in service_dict['serviceCatalog']:
|
||||
if endpoint['name'] == 'heat':
|
||||
endpoint['endpoints'][0]['publicURL'] = "invalid"
|
||||
# Use ServiceCatalog to eliminate differences between keystone v2 and
|
||||
# v3.
|
||||
token_data = client_2.auth_provider.auth_data[1]
|
||||
service_catalog = ks_service_catalog.ServiceCatalog.factory(
|
||||
token_data
|
||||
).get_data()
|
||||
|
||||
service_catalog = {
|
||||
for service in service_catalog:
|
||||
if service['name'] == 'heat':
|
||||
for ep in service['endpoints']:
|
||||
if 'publicURL' in ep:
|
||||
ep['publicURL'] = "invalid"
|
||||
elif ep['interface'] == 'public':
|
||||
ep['url'] = "invalid"
|
||||
break
|
||||
break
|
||||
|
||||
if 'catalog' in token_data:
|
||||
token_data['catalog'] = service_catalog
|
||||
else:
|
||||
token_data['serviceCatalog'] = service_catalog
|
||||
|
||||
invalid_service_catalog = {
|
||||
"X-Target-Service-Catalog": base64.b64encode(
|
||||
jsonutils.dumps(service_dict)
|
||||
jsonutils.dumps(token_data)
|
||||
)
|
||||
}
|
||||
extra_headers.update(service_catalog)
|
||||
extra_headers.update(invalid_service_catalog)
|
||||
result = _execute_action(
|
||||
client_1,
|
||||
_get_list_stack_request(),
|
||||
|
Loading…
Reference in New Issue
Block a user