swift: container ACL - use ID's for tenant and user

Switch to using ID's instead of names for the test tenant and user.

Under Keystone v3 names (vs ids) are only supported for members of
the 'default' domain, so if accounts are created in a different domain
the container ACL tests will fail.

Switch to using ID's which are guaranteed to be unique across domains,
resolving test failures in this type of deployment configuration.

Change-Id: I79e5754379e3cf72d2a9858e6e69e8c190b0b2ed
This commit is contained in:
James Page 2018-09-25 10:24:30 +01:00
parent 7e3c936898
commit c45eb61de2
1 changed files with 6 additions and 6 deletions

View File

@ -38,9 +38,9 @@ class ObjectTestACLs(base.BaseObjectTest):
def test_read_object_with_rights(self):
# attempt to read object using authorized user
# update X-Container-Read metadata ACL
tenant_name = self.os_roles_operator_alt.credentials.tenant_name
username = self.os_roles_operator_alt.credentials.username
cont_headers = {'X-Container-Read': tenant_name + ':' + username}
tenant_id = self.os_roles_operator_alt.credentials.tenant_id
user_id = self.os_roles_operator_alt.credentials.user_id
cont_headers = {'X-Container-Read': tenant_id + ':' + user_id}
container_client = self.os_roles_operator.container_client
resp_meta, _ = (
container_client.create_update_or_delete_container_metadata(
@ -66,9 +66,9 @@ class ObjectTestACLs(base.BaseObjectTest):
def test_write_object_with_rights(self):
# attempt to write object using authorized user
# update X-Container-Write metadata ACL
tenant_name = self.os_roles_operator_alt.credentials.tenant_name
username = self.os_roles_operator_alt.credentials.username
cont_headers = {'X-Container-Write': tenant_name + ':' + username}
tenant_id = self.os_roles_operator_alt.credentials.tenant_id
user_id = self.os_roles_operator_alt.credentials.user_id
cont_headers = {'X-Container-Write': tenant_id + ':' + user_id}
container_client = self.os_roles_operator.container_client
resp_meta, _ = (
container_client.create_update_or_delete_container_metadata(